server: Explicitly add FILE_DELETE_CHILD permission when file write access is allowed.

This commit is contained in:
Dmitry Timoshkov 2011-03-16 18:46:00 +08:00 committed by Alexandre Julliard
parent 19c4331d61
commit da077956e1
2 changed files with 4 additions and 5 deletions

View File

@ -889,10 +889,9 @@ todo_wine {
SetLastError(0xdeadbeef);
rc = AccessCheck(sd, token, FILE_DELETE_CHILD, &mapping, &priv_set, &priv_set_len, &granted, &status);
ok(rc, "AccessCheck error %d\n", GetLastError());
todo_wine {
ok(status == 1, "expected 1, got %d\n", status);
ok(granted == FILE_DELETE_CHILD, "expected FILE_DELETE_CHILD, got %#x\n", granted);
}
granted = 0xdeadbeef;
status = 0xdeadbeef;
SetLastError(0xdeadbeef);

View File

@ -360,7 +360,7 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
if (mode & S_IRUSR)
aaa->Mask |= FILE_GENERIC_READ;
if (mode & S_IWUSR)
aaa->Mask |= FILE_GENERIC_WRITE | DELETE;
aaa->Mask |= FILE_GENERIC_WRITE | DELETE | FILE_DELETE_CHILD;
if (mode & S_IXUSR)
aaa->Mask |= FILE_GENERIC_EXECUTE;
sid = (SID *)&aaa->SidStart;
@ -381,7 +381,7 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
if (!(mode & S_IRUSR) && (mode & (S_IRGRP|S_IROTH)))
ada->Mask |= FILE_GENERIC_READ;
if (!(mode & S_IWUSR) && (mode & (S_IWGRP|S_IROTH)))
ada->Mask |= FILE_GENERIC_WRITE | DELETE;
ada->Mask |= FILE_GENERIC_WRITE | DELETE | FILE_DELETE_CHILD;
if (!(mode & S_IXUSR) && (mode & (S_IXGRP|S_IXOTH)))
ada->Mask |= FILE_GENERIC_EXECUTE;
ada->Mask &= ~STANDARD_RIGHTS_ALL; /* never deny standard rights */
@ -401,7 +401,7 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
if (mode & S_IROTH)
aaa->Mask |= FILE_GENERIC_READ;
if (mode & S_IWOTH)
aaa->Mask |= FILE_GENERIC_WRITE | DELETE;
aaa->Mask |= FILE_GENERIC_WRITE | DELETE | FILE_DELETE_CHILD;
if (mode & S_IXOTH)
aaa->Mask |= FILE_GENERIC_EXECUTE;
sid = (SID *)&aaa->SidStart;