server: Don't do access checks on the security descriptors of newly created objects.
diff --git a/server/semaphore.c b/server/semaphore.c
index 09445e1..1412170 100644
--- a/server/semaphore.c
+++ b/server/semaphore.c
@@ -187,7 +187,10 @@
if ((sem = create_semaphore( root, &name, req->attributes, req->initial, req->max, sd )))
{
- reply->handle = alloc_handle( current->process, sem, req->access, req->attributes );
+ if (get_error() == STATUS_OBJECT_NAME_EXISTS)
+ reply->handle = alloc_handle( current->process, sem, req->access, req->attributes );
+ else
+ reply->handle = alloc_handle_no_access_check( current->process, sem, req->access, req->attributes );
release_object( sem );
}