1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

Mask off the aDIR on setfileinfo.

Jeremy.
(This used to be commit d9cb1bf20ac8a739102b03d9a70e34fe5cb2f0f7)
This commit is contained in:
Jeremy Allison 2002-03-05 01:43:50 +00:00
parent 308b222ffd
commit 5d1db25abd
3 changed files with 10 additions and 0 deletions

View File

@ -195,6 +195,8 @@ int file_chmod(connection_struct *conn,char *fname,int dosmode,SMB_STRUCT_STAT *
if (S_ISDIR(st->st_mode)) if (S_ISDIR(st->st_mode))
dosmode |= aDIR; dosmode |= aDIR;
else
dosmode &= ~aDIR;
if (dos_mode(conn,fname,st) == dosmode) if (dos_mode(conn,fname,st) == dosmode)
return(0); return(0);

View File

@ -517,6 +517,9 @@ int reply_setatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
if (VALID_STAT_OF_DIR(sbuf)) if (VALID_STAT_OF_DIR(sbuf))
mode |= aDIR; mode |= aDIR;
else
mode &= ~aDIR;
if (check_name(fname,conn)) if (check_name(fname,conn))
ok = (file_chmod(conn,fname,mode,NULL) == 0); ok = (file_chmod(conn,fname,mode,NULL) == 0);
if (ok) if (ok)

View File

@ -2225,6 +2225,11 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
DEBUG(6,("size: %.0f ", (double)size)); DEBUG(6,("size: %.0f ", (double)size));
DEBUG(6,("mode: %x\n" , mode)); 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) || if(!((info_level == SMB_SET_FILE_END_OF_FILE_INFO) ||
(info_level == SMB_SET_FILE_ALLOCATION_INFO) || (info_level == SMB_SET_FILE_ALLOCATION_INFO) ||
(info_level == SMB_FILE_ALLOCATION_INFORMATION) || (info_level == SMB_FILE_ALLOCATION_INFORMATION) ||