1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

Fix changing of attributes via setattr. Samba4 test fixes.

Jeremy.
This commit is contained in:
Jeremy Allison -
parent a93fa23c17
commit 97e1d5c957
2 changed files with 23 additions and 10 deletions

View File

@ -544,13 +544,18 @@ int reply_setatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
mode = SVAL(inbuf,smb_vwv0);
mtime = make_unix_date3(inbuf+smb_vwv1);
if (VALID_STAT_OF_DIR(sbuf))
mode |= aDIR;
else
mode &= ~aDIR;
if (mode != FILE_ATTRIBUTE_NORMAL) {
if (VALID_STAT_OF_DIR(sbuf))
mode |= aDIR;
else
mode &= ~aDIR;
if (check_name(fname,conn))
ok = (file_chmod(conn,fname,mode,NULL) == 0);
} else {
ok = True;
}
if (check_name(fname,conn))
ok = (file_chmod(conn,fname,mode,NULL) == 0);
if (ok)
ok = set_filetime(conn,fname,mtime);

View File

@ -1871,6 +1871,9 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
base_name = p+1;
mode = dos_mode(conn,fname,&sbuf);
if (!mode)
mode = FILE_ATTRIBUTE_NORMAL;
fullpathname = fname;
file_size = get_file_size(sbuf);
allocation_size = get_allocation_size(fsp,&sbuf);
@ -2915,10 +2918,15 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n",
DEBUG(6,("modtime: %s ", ctime(&tvs.modtime)));
DEBUG(6,("size: %.0f ", (double)size));
if (S_ISDIR(sbuf.st_mode))
dosmode |= aDIR;
else
dosmode &= ~aDIR;
if (dosmode == FILE_ATTRIBUTE_NORMAL)
dosmode = 0;
if (dosmode) {
if (S_ISDIR(sbuf.st_mode))
dosmode |= aDIR;
else
dosmode &= ~aDIR;
}
DEBUG(6,("dosmode: %x\n" , dosmode));