server: Only call fchmod in file_set_fd if the mode actually changed.

This commit is contained in:
Rob Shearman 2007-10-06 14:31:34 +02:00 committed by Alexandre Julliard
parent f43d8b65c1
commit f5070b0511
1 changed files with 8 additions and 5 deletions

View File

@ -503,13 +503,16 @@ static int file_set_sd( struct object *obj, const struct security_descriptor *sd
/* no ACL means full access rights to anyone */
new_mode |= S_IRWXU | S_IRWXO;
if (fchmod( unix_fd, new_mode & ~denied_mode ) == -1)
if (file->mode != (new_mode & ~denied_mode))
{
file_set_error();
return 0;
}
if (fchmod( unix_fd, new_mode & ~denied_mode ) == -1)
{
file_set_error();
return 0;
}
file->mode = new_mode & ~denied_mode;
file->mode = new_mode & ~denied_mode;
}
}
return 1;
}