diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 14e8300d14c..43406eb92e6 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -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); diff --git a/server/file.c b/server/file.c index d17b25b8ca0..cca2633c727 100644 --- a/server/file.c +++ b/server/file.c @@ -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;