only set FileAttributes if setattr value is non-zero

some fileio tests sends a setattr with basicinfo.fileattributes=0
we used to then send a setattr with zero hidden, system, and archive
attrs. instead in this case, we should be keeping the old values
for these attributes.
This commit is contained in:
Olga Kornievskaia 2012-06-11 12:22:39 -04:00
parent 19d813da6a
commit 64986c8665

View file

@ -64,6 +64,7 @@ static int handle_nfs41_setattr(setattr_upcall_args *args)
nfs41_file_info info = { 0 }, old_info = { 0 };
int status = NO_ERROR, getattr_status;
if (basic_info->FileAttributes) {
info.hidden = basic_info->FileAttributes & FILE_ATTRIBUTE_HIDDEN ? 1 : 0;
info.system = basic_info->FileAttributes & FILE_ATTRIBUTE_SYSTEM ? 1 : 0;
info.archive = basic_info->FileAttributes & FILE_ATTRIBUTE_ARCHIVE ? 1 : 0;
@ -82,7 +83,7 @@ static int handle_nfs41_setattr(setattr_upcall_args *args)
info.attrmask.arr[1] = FATTR4_WORD1_SYSTEM;
info.attrmask.count = 2;
}
}
if (old_info.mode == 0444 &&
((basic_info->FileAttributes & FILE_ATTRIBUTE_READONLY) == 0)) {
info.mode = 0644;