summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-03-05 01:43:50 +0000
committerJeremy Allison <jra@samba.org>2002-03-05 01:43:50 +0000
commit5d1db25abd340c2c689f913788911b3a2f411b38 (patch)
treede889c9a0fa3d7d102a13717ce39baf15c0d61e7 /source3/smbd
parent308b222ffd4705d8f4ff53fbb76fc7c1db29bd27 (diff)
downloadsamba-5d1db25abd340c2c689f913788911b3a2f411b38.tar.gz
samba-5d1db25abd340c2c689f913788911b3a2f411b38.tar.bz2
samba-5d1db25abd340c2c689f913788911b3a2f411b38.zip
Mask off the aDIR on setfileinfo.
Jeremy. (This used to be commit d9cb1bf20ac8a739102b03d9a70e34fe5cb2f0f7)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/dosmode.c2
-rw-r--r--source3/smbd/reply.c3
-rw-r--r--source3/smbd/trans2.c5
3 files changed, 10 insertions, 0 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 6750649eff..dcffe3aa90 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -195,6 +195,8 @@ int file_chmod(connection_struct *conn,char *fname,int dosmode,SMB_STRUCT_STAT *
if (S_ISDIR(st->st_mode))
dosmode |= aDIR;
+ else
+ dosmode &= ~aDIR;
if (dos_mode(conn,fname,st) == dosmode)
return(0);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 0a349a9c8a..0de0e15274 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -517,6 +517,9 @@ int reply_setatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
if (VALID_STAT_OF_DIR(sbuf))
mode |= aDIR;
+ else
+ mode &= ~aDIR;
+
if (check_name(fname,conn))
ok = (file_chmod(conn,fname,mode,NULL) == 0);
if (ok)
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 501057830a..d08e3419f9 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -2225,6 +2225,11 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
DEBUG(6,("size: %.0f ", (double)size));
DEBUG(6,("mode: %x\n" , mode));
+ if (S_ISDIR(sbuf.st_mode))
+ mode |= aDIR;
+ else
+ mode &= ~aDIR;
+
if(!((info_level == SMB_SET_FILE_END_OF_FILE_INFO) ||
(info_level == SMB_SET_FILE_ALLOCATION_INFO) ||
(info_level == SMB_FILE_ALLOCATION_INFORMATION) ||