summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-11-14 06:29:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:25 -0500
commit4c8fc93905e89e2c3efa1002ad8fbc2a78fe51e8 (patch)
treeff63478eb26c129bb07b415ef5da5f2e4a6aeffc /source3/smbd
parent3994f382263dbc199127b76c8e354b991da11188 (diff)
downloadsamba-4c8fc93905e89e2c3efa1002ad8fbc2a78fe51e8.tar.gz
samba-4c8fc93905e89e2c3efa1002ad8fbc2a78fe51e8.tar.bz2
samba-4c8fc93905e89e2c3efa1002ad8fbc2a78fe51e8.zip
r11718: Filter stored DOS attributes by SAMBA_ATTRIBUTES_MASK (0x7f).
Jeremy. (This used to be commit 61444049e1543b364eea2ee79743287c75d37db5)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/dosmode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index fec148b8e6..814d008cbb 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -337,6 +337,7 @@ uint32 dos_mode(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf)
if (result & aSYSTEM) DEBUG(8, ("s"));
if (result & aDIR ) DEBUG(8, ("d"));
if (result & aARCH ) DEBUG(8, ("a"));
+ if (result & FILE_ATTRIBUTE_SPARSE ) DEBUG(8, ("[sparse]"));
DEBUG(8,("\n"));
@@ -355,6 +356,9 @@ int file_set_dosmode(connection_struct *conn, const char *fname, uint32 dosmode,
mode_t unixmode;
int ret = -1;
+ /* We only allow READONLY|HIDDEN|SYSTEM|DIRECTORY|ARCHIVE here. */
+ dosmode &= SAMBA_ATTRIBUTES_MASK;
+
DEBUG(10,("file_set_dosmode: setting dos mode 0x%x on file %s\n", dosmode, fname));
if (!st || (st && !VALID_STAT(*st))) {
st = &st1;