diff options
author | Jeremy Allison <jra@samba.org> | 2009-12-15 18:03:47 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-12-15 18:03:47 -0800 |
commit | e831e3ee32ba3f1f492f9918d74a302731fa79a9 (patch) | |
tree | eea4c919a3e150053d6a56ea9f668de9967c1d97 /source3/smbd/dosmode.c | |
parent | 308b50a7bb07a7db6d2119f9ff08f33fce922562 (diff) | |
download | samba-e831e3ee32ba3f1f492f9918d74a302731fa79a9.tar.gz samba-e831e3ee32ba3f1f492f9918d74a302731fa79a9.tar.bz2 samba-e831e3ee32ba3f1f492f9918d74a302731fa79a9.zip |
Ensure dos_mode can return FILE_ATTRIBUTE_NORMAL, then filter the returned attributes by protocol level.
This makes us consistant in returning DOS attrs across all replies. Tested on OS/2 by Günter Kukkukk.
Jeremy.
Diffstat (limited to 'source3/smbd/dosmode.c')
-rw-r--r-- | source3/smbd/dosmode.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 0f31973675..aaef09bc85 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -21,6 +21,18 @@ #include "includes.h" #include "librpc/gen_ndr/ndr_xattr.h" +static uint32_t filter_mode_by_protocol(uint32_t mode) +{ + if (get_Protocol() <= PROTOCOL_LANMAN2) { + DEBUG(10,("filter_mode_by_protocol: " + "filtering result 0x%x to 0x%x\n", + (unsigned int)mode, + (unsigned int)(mode & 0x3f) )); + mode &= 0x3f; + } + return mode; +} + static int set_sparse_flag(const SMB_STRUCT_STAT * const sbuf) { #if defined (HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE) @@ -459,12 +471,12 @@ uint32 dos_mode_msdfs(connection_struct *conn, result |= aHIDDEN; } - if (get_Protocol() <= PROTOCOL_LANMAN2) { - DEBUG(10,("dos_mode_msdfs : filtering result 0x%x\n", - (unsigned int)result )); - result &= 0xff; + if (result == 0) { + result = FILE_ATTRIBUTE_NORMAL; } + result = filter_mode_by_protocol(result); + DEBUG(8,("dos_mode_msdfs returning ")); if (result & aHIDDEN) DEBUG(8, ("h")); @@ -645,12 +657,12 @@ uint32 dos_mode(connection_struct *conn, struct smb_filename *smb_fname) result |= aHIDDEN; } - if (get_Protocol() <= PROTOCOL_LANMAN2) { - DEBUG(10,("dos_mode : filtering result 0x%x\n", - (unsigned int)result )); - result &= 0xff; + if (result == 0) { + result = FILE_ATTRIBUTE_NORMAL; } + result = filter_mode_by_protocol(result); + DEBUG(8,("dos_mode returning ")); if (result & aHIDDEN) DEBUG(8, ("h")); |