summaryrefslogtreecommitdiffstats
path: root/source4/libcli/raw
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
commit6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch)
tree850c71039563c16a5d563c47e7ba2ab645baf198 /source4/libcli/raw
parent6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff)
parent2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff)
downloadsamba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.xz
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16samba-4.0.0alpha16
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r--source4/libcli/raw/clisocket.c2
-rw-r--r--source4/libcli/raw/clitransport.c2
-rw-r--r--source4/libcli/raw/interfaces.h4
-rw-r--r--source4/libcli/raw/rawfile.c47
-rw-r--r--source4/libcli/raw/rawsetfileinfo.c4
-rw-r--r--source4/libcli/raw/smb.h26
-rw-r--r--source4/libcli/raw/trans2.h157
7 files changed, 11 insertions, 231 deletions
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index 84bf250f6a1..bf608f1ec15 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -229,7 +229,7 @@ _PUBLIC_ struct smbcli_socket *smbcli_sock_connect_byname(const char *host, cons
make_nbt_name(&nbt_name, host, name_type);
- status = resolve_name(resolve_ctx, &nbt_name, tmp_ctx, &address, event_ctx);
+ status = resolve_name_ex(resolve_ctx, 0, 0, &nbt_name, tmp_ctx, &address, event_ctx);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(tmp_ctx);
return NULL;
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 7a3993c79bf..43316692a41 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -338,7 +338,7 @@ _PUBLIC_ void smbcli_transport_idle_handler(struct smbcli_transport *transport,
transport->socket->event.te = event_add_timed(transport->socket->event.ctx,
transport,
- timeval_current_ofs(0, period),
+ timeval_current_ofs_usec(period),
idle_handler, transport);
}
diff --git a/source4/libcli/raw/interfaces.h b/source4/libcli/raw/interfaces.h
index f3ce4e9c5f2..d20367474a3 100644
--- a/source4/libcli/raw/interfaces.h
+++ b/source4/libcli/raw/interfaces.h
@@ -924,8 +924,8 @@ enum smb_setfileinfo_level {
RAW_SFILEINFO_END_OF_FILE_INFO = SMB_SFILEINFO_END_OF_FILE_INFO,
RAW_SFILEINFO_UNIX_BASIC = SMB_SFILEINFO_UNIX_BASIC,
RAW_SFILEINFO_UNIX_INFO2 = SMB_SFILEINFO_UNIX_INFO2,
- RAW_SFILEINFO_UNIX_LINK = SMB_SFILEINFO_UNIX_LINK,
- RAW_SFILEINFO_UNIX_HLINK = SMB_SFILEINFO_UNIX_HLINK,
+ RAW_SFILEINFO_UNIX_LINK = SMB_SET_FILE_UNIX_LINK,
+ RAW_SFILEINFO_UNIX_HLINK = SMB_SET_FILE_UNIX_HLINK,
RAW_SFILEINFO_BASIC_INFORMATION = SMB_SFILEINFO_BASIC_INFORMATION,
RAW_SFILEINFO_RENAME_INFORMATION = SMB_SFILEINFO_RENAME_INFORMATION,
RAW_SFILEINFO_LINK_INFORMATION = SMB_SFILEINFO_LINK_INFORMATION,
diff --git a/source4/libcli/raw/rawfile.c b/source4/libcli/raw/rawfile.c
index 5797540edd0..1cacaab5cfd 100644
--- a/source4/libcli/raw/rawfile.c
+++ b/source4/libcli/raw/rawfile.c
@@ -29,52 +29,6 @@
if (!req) return NULL; \
} while (0)
-/**
- Return a string representing a CIFS attribute for a file.
-**/
-char *attrib_string(TALLOC_CTX *mem_ctx, uint32_t attrib)
-{
- int i, len;
- const struct {
- char c;
- uint16_t attr;
- } attr_strs[] = {
- {'V', FILE_ATTRIBUTE_VOLUME},
- {'D', FILE_ATTRIBUTE_DIRECTORY},
- {'A', FILE_ATTRIBUTE_ARCHIVE},
- {'H', FILE_ATTRIBUTE_HIDDEN},
- {'S', FILE_ATTRIBUTE_SYSTEM},
- {'N', FILE_ATTRIBUTE_NORMAL},
- {'R', FILE_ATTRIBUTE_READONLY},
- {'d', FILE_ATTRIBUTE_DEVICE},
- {'t', FILE_ATTRIBUTE_TEMPORARY},
- {'s', FILE_ATTRIBUTE_SPARSE},
- {'r', FILE_ATTRIBUTE_REPARSE_POINT},
- {'c', FILE_ATTRIBUTE_COMPRESSED},
- {'o', FILE_ATTRIBUTE_OFFLINE},
- {'n', FILE_ATTRIBUTE_NONINDEXED},
- {'e', FILE_ATTRIBUTE_ENCRYPTED}
- };
- char *ret;
-
- ret = talloc_array(mem_ctx, char, ARRAY_SIZE(attr_strs)+1);
- if (!ret) {
- return NULL;
- }
-
- for (len=i=0; i<ARRAY_SIZE(attr_strs); i++) {
- if (attrib & attr_strs[i].attr) {
- ret[len++] = attr_strs[i].c;
- }
- }
-
- ret[len] = 0;
-
- talloc_set_name_const(ret, ret);
-
- return ret;
-}
-
/****************************************************************************
Rename a file - async interface
****************************************************************************/
@@ -950,6 +904,7 @@ struct smbcli_request *smb_raw_lock_send(struct smbcli_tree *tree, union smb_loc
break;
}
case RAW_LOCK_SMB2:
+ case RAW_LOCK_SMB2_BREAK:
return NULL;
}
diff --git a/source4/libcli/raw/rawsetfileinfo.c b/source4/libcli/raw/rawsetfileinfo.c
index 6ad3e9ee8d9..ff36d50e94e 100644
--- a/source4/libcli/raw/rawsetfileinfo.c
+++ b/source4/libcli/raw/rawsetfileinfo.c
@@ -262,11 +262,11 @@ static bool smb_raw_setinfo_backend(struct smbcli_tree *tree,
return smb_raw_setfileinfo_passthru(mem_ctx, parms->generic.level,
parms, blob);
- /* Unhandled levels */
-
+ /* Unhandled levels */
case RAW_SFILEINFO_UNIX_LINK:
case RAW_SFILEINFO_UNIX_HLINK:
case RAW_SFILEINFO_RENAME_INFORMATION_SMB2:
+ case RAW_SFILEINFO_LINK_INFORMATION:
break;
}
diff --git a/source4/libcli/raw/smb.h b/source4/libcli/raw/smb.h
index 05bf91fe3bb..008ab57c0de 100644
--- a/source4/libcli/raw/smb.h
+++ b/source4/libcli/raw/smb.h
@@ -23,8 +23,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _SMB_H
-#define _SMB_H
+#ifndef _RAW_SMB_H
+#define _RAW_SMB_H
/* deny modes */
#define DENY_DOS 0
@@ -366,24 +366,6 @@
#define DESIRED_ACCESS_PIPE 0x2019f
-/* FileAttributes (search attributes) field */
-#define FILE_ATTRIBUTE_READONLY 0x0001
-#define FILE_ATTRIBUTE_HIDDEN 0x0002
-#define FILE_ATTRIBUTE_SYSTEM 0x0004
-#define FILE_ATTRIBUTE_VOLUME 0x0008
-#define FILE_ATTRIBUTE_DIRECTORY 0x0010
-#define FILE_ATTRIBUTE_ARCHIVE 0x0020
-#define FILE_ATTRIBUTE_DEVICE 0x0040
-#define FILE_ATTRIBUTE_NORMAL 0x0080
-#define FILE_ATTRIBUTE_TEMPORARY 0x0100
-#define FILE_ATTRIBUTE_SPARSE 0x0200
-#define FILE_ATTRIBUTE_REPARSE_POINT 0x0400
-#define FILE_ATTRIBUTE_COMPRESSED 0x0800
-#define FILE_ATTRIBUTE_OFFLINE 0x1000
-#define FILE_ATTRIBUTE_NONINDEXED 0x2000
-#define FILE_ATTRIBUTE_ENCRYPTED 0x4000
-#define FILE_ATTRIBUTE_ALL_MASK 0x7FFF
-
/* Flags - combined with attributes. */
#define FILE_FLAG_WRITE_THROUGH 0x80000000L
#define FILE_FLAG_NO_BUFFERING 0x20000000L
@@ -472,7 +454,7 @@
/* where to find the base of the SMB packet proper */
/* REWRITE TODO: smb_base needs to be removed */
-#define smb_base(buf) (((char *)(buf))+4)
+#define smb_base(buf) (((const char *)(buf))+4)
/* we don't allow server strings to be longer than 48 characters as
otherwise NT will not honour the announce packets */
@@ -600,4 +582,4 @@
#include "libcli/raw/interfaces.h"
#include "libcli/smb/smb_common.h"
-#endif /* _SMB_H */
+#endif /* _RAW_SMB_H */
diff --git a/source4/libcli/raw/trans2.h b/source4/libcli/raw/trans2.h
index 63632eb5edb..d9a3f5f7d2c 100644
--- a/source4/libcli/raw/trans2.h
+++ b/source4/libcli/raw/trans2.h
@@ -316,161 +316,4 @@ Found 0 aliased levels
#define MAX_MAC_INFO_LEVEL 0x3FF
#define SMB_QFS_MAC_FS_INFO 0x301
-
-
-/* UNIX CIFS Extensions - created by HP */
-/*
- * UNIX CIFS Extensions have the range 0x200 - 0x2FF reserved.
- * Supposedly Microsoft have agreed to this.
- */
-
-#define MIN_UNIX_INFO_LEVEL 0x200
-#define MAX_UNIX_INFO_LEVEL 0x2FF
-
-#define INFO_LEVEL_IS_UNIX(level) (((level) >= MIN_UNIX_INFO_LEVEL) && ((level) <= MAX_UNIX_INFO_LEVEL))
-
-#define SMB_MODE_NO_CHANGE 0xFFFFFFFF /* file mode value which */
- /* means "don't change it" */
-#define SMB_UID_NO_CHANGE 0xFFFFFFFF
-#define SMB_GID_NO_CHANGE 0xFFFFFFFF
-
-#define SMB_SIZE_NO_CHANGE_LO 0xFFFFFFFF
-#define SMB_SIZE_NO_CHANGE_HI 0xFFFFFFFF
-
-#define SMB_TIME_NO_CHANGE_LO 0xFFFFFFFF
-#define SMB_TIME_NO_CHANGE_HI 0xFFFFFFFF
-
-/*
-UNIX_BASIC info level:
-
-Offset Size Name
-0 LARGE_INTEGER EndOfFile File size
-8 LARGE_INTEGER Blocks Number of bytes used on disk (st_blocks).
-16 LARGE_INTEGER CreationTime Creation time
-24 LARGE_INTEGER LastAccessTime Last access time
-32 LARGE_INTEGER LastModificationTime Last modification time
-40 LARGE_INTEGER Uid Numeric user id for the owner
-48 LARGE_INTEGER Gid Numeric group id of owner
-56 ULONG Type Enumeration specifying the pathname type:
- 0 -- File
- 1 -- Directory
- 2 -- Symbolic link
- 3 -- Character device
- 4 -- Block device
- 5 -- FIFO (named pipe)
- 6 -- Unix domain socket
-
-60 LARGE_INTEGER devmajor Major device number if type is device
-68 LARGE_INTEGER devminor Minor device number if type is device
-76 LARGE_INTEGER uniqueid This is a server-assigned unique id for the file. The client
- will typically map this onto an inode number. The scope of
- uniqueness is the share.
-84 LARGE_INTEGER permissions Standard UNIX file permissions - see below.
-92 LARGE_INTEGER nlinks The number of directory entries that map to this entry
- (number of hard links)
-
-100 - end.
-*/
-
-/*
-SMB_QUERY_FILE_UNIX_INFO2 is SMB_QUERY_FILE_UNIX_BASIC with create
-time and file flags appended. The corresponding info level for
-findfirst/findnext is SMB_FIND_FILE_UNIX_UNIX2.
-
-Size Offset Value
----------------------
-0 LARGE_INTEGER EndOfFile File size
-8 LARGE_INTEGER Blocks Number of blocks used on disk
-16 LARGE_INTEGER ChangeTime Attribute change time
-24 LARGE_INTEGER LastAccessTime Last access time
-32 LARGE_INTEGER LastModificationTime Last modification time
-40 LARGE_INTEGER Uid Numeric user id for the owner
-48 LARGE_INTEGER Gid Numeric group id of owner
-56 ULONG Type Enumeration specifying the file type
-60 LARGE_INTEGER devmajor Major device number if type is device
-68 LARGE_INTEGER devminor Minor device number if type is device
-76 LARGE_INTEGER uniqueid This is a server-assigned unique id
-84 LARGE_INTEGER permissions Standard UNIX permissions
-92 LARGE_INTEGER nlinks Number of hard link)
-100 LARGE_INTEGER CreationTime Create/birth time
-108 ULONG FileFlags File flags enumeration
-112 ULONG FileFlagsMask Mask of valid flags
-*/
-
-/* UNIX filetype mappings. */
-
-#define UNIX_TYPE_FILE 0
-#define UNIX_TYPE_DIR 1
-#define UNIX_TYPE_SYMLINK 2
-#define UNIX_TYPE_CHARDEV 3
-#define UNIX_TYPE_BLKDEV 4
-#define UNIX_TYPE_FIFO 5
-#define UNIX_TYPE_SOCKET 6
-#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF
-
-/*
- * Oh this is fun. "Standard UNIX permissions" has no
- * meaning in POSIX. We need to define the mapping onto
- * and off the wire as this was not done in the original HP
- * spec. JRA.
- */
-
-#define UNIX_X_OTH 0000001
-#define UNIX_W_OTH 0000002
-#define UNIX_R_OTH 0000004
-#define UNIX_X_GRP 0000010
-#define UNIX_W_GRP 0000020
-#define UNIX_R_GRP 0000040
-#define UNIX_X_USR 0000100
-#define UNIX_W_USR 0000200
-#define UNIX_R_USR 0000400
-#define UNIX_STICKY 0001000
-#define UNIX_SET_GID 0002000
-#define UNIX_SET_UID 0004000
-
-/* Masks for the above */
-#define UNIX_OTH_MASK 0000007
-#define UNIX_GRP_MASK 0000070
-#define UNIX_USR_MASK 0000700
-#define UNIX_PERM_MASK 0000777
-#define UNIX_EXTRA_MASK 0007000
-#define UNIX_ALL_MASK 0007777
-
-/* Flags for the file_flags field in UNIX_INFO2: */
-#define EXT_SECURE_DELETE 0x00000001
-#define EXT_ENABLE_UNDELETE 0x00000002
-#define EXT_SYNCHRONOUS 0x00000004
-#define EXT_IMMUTABLE 0x00000008
-#define EXT_OPEN_APPEND_ONLY 0x00000010
-#define EXT_DO_NOT_BACKUP 0x00000020
-#define EXT_NO_UPDATE_ATIME 0x00000040
-#define EXT_HIDDEN 0x00000080
-
-#define SMB_QFILEINFO_UNIX_LINK 0x201
-#define SMB_SFILEINFO_UNIX_LINK 0x201
-#define SMB_SFILEINFO_UNIX_HLINK 0x203
-
-/*
- Info level for QVOLINFO - returns version of CIFS UNIX extensions, plus
- 64-bits worth of capability fun :-).
-*/
-
-#define SMB_QUERY_CIFS_UNIX_INFO 0x200
-
-/* Returns the following.
-
- UINT16 major version number
- UINT16 minor version number
- LARGE_INTEGER capability bitfield
-
-*/
-
-#define CIFS_UNIX_MAJOR_VERSION 1
-#define CIFS_UNIX_MINOR_VERSION 0
-
-#define CIFS_UNIX_FCNTL_LOCKS_CAP 0x1
-#define CIFS_UNIX_POSIX_ACLS_CAP 0x2
-
-/* ... more as we think of them :-). */
-
#endif