summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
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) ||