diff options
author | Jeremy Allison <jra@samba.org> | 2002-01-10 02:18:08 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-01-10 02:18:08 +0000 |
commit | fd56ebd54f68433c9f764cf73e05dbe0649d0716 (patch) | |
tree | 9fe20a274b655959a6e6606df7e383eba982bc89 /source3 | |
parent | f069a41c85497080e2bd8a234e12df2a90b5045b (diff) | |
download | samba-fd56ebd54f68433c9f764cf73e05dbe0649d0716.tar.gz samba-fd56ebd54f68433c9f764cf73e05dbe0649d0716.tar.bz2 samba-fd56ebd54f68433c9f764cf73e05dbe0649d0716.zip |
Oh joy - the original code didn't do mapping of the perms onto the wire.
Make it up as we go along... :-).
Jeremy.
(This used to be commit 4289fe3499e49c3ed356eff55ffbcfef4dca72af)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/trans2.h | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/source3/include/trans2.h b/source3/include/trans2.h index 53f351d5cf..e05440c796 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. SMB transaction2 handling - Copyright (C) Jeremy Allison 1994-1998 + Copyright (C) Jeremy Allison 1994-2002. Extensively modified by Andrew Tridgell, 1995 @@ -323,15 +323,6 @@ Byte offset Type name description #define MODE_NO_CHANGE -1 /* file mode value which */ /* means "don't change it" */ -#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 - /* LARGE_INTEGER EndOfFile File size LARGE_INTEGER Blocks Number of bytes used on disk (st_blocks). @@ -354,12 +345,51 @@ Byte offset Type name description 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. - LARGE_INTEGER permissions Standard UNIX file permissions + LARGE_INTEGER permissions Standard UNIX file permissions - see below. LARGE_INTEGER nlinks The number of directory entries that map to this entry (number of hard links) */ +/* 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 + * code. 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 + #define SMB_QUERY_FILE_UNIX_LINK 0x201 #define SMB_SET_FILE_UNIX_LINK 0x201 #define SMB_SET_FILE_UNIX_HLINK 0x203 |