Commit d2e216f4 authored by Erich E. Hoover's avatar Erich E. Hoover Committed by Alexandre Julliard

server: Create directories with the specified security attributes.

parent 95c414fe
...@@ -3081,9 +3081,8 @@ static void test_CreateDirectoryA(void) ...@@ -3081,9 +3081,8 @@ static void test_CreateDirectoryA(void)
bret = pGetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); bret = pGetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation);
ok(bret, "GetAclInformation failed\n"); ok(bret, "GetAclInformation failed\n");
todo_wine ok(acl_size.AceCount == 2, ok(acl_size.AceCount == 2, "GetAclInformation returned unexpected entry count (%d != 2).\n",
"GetAclInformation returned unexpected entry count (%d != 2).\n", acl_size.AceCount);
acl_size.AceCount);
if (acl_size.AceCount > 0) if (acl_size.AceCount > 0)
{ {
bret = pGetAce(pDacl, 0, (VOID **)&ace); bret = pGetAce(pDacl, 0, (VOID **)&ace);
......
...@@ -1768,7 +1768,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode, ...@@ -1768,7 +1768,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
/* create the directory if needed */ /* create the directory if needed */
if ((options & FILE_DIRECTORY_FILE) && (flags & O_CREAT)) if ((options & FILE_DIRECTORY_FILE) && (flags & O_CREAT))
{ {
if (mkdir( name, 0777 ) == -1) if (mkdir( name, *mode ) == -1)
{ {
if (errno != EEXIST || (flags & O_EXCL)) if (errno != EEXIST || (flags & O_EXCL))
{ {
......
...@@ -218,6 +218,8 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si ...@@ -218,6 +218,8 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si
owner = token_get_user( current->process->token ); owner = token_get_user( current->process->token );
mode = sd_to_mode( sd, owner ); mode = sd_to_mode( sd, owner );
} }
else if (options & FILE_DIRECTORY_FILE)
mode = (attrs & FILE_ATTRIBUTE_READONLY) ? 0555 : 0777;
else else
mode = (attrs & FILE_ATTRIBUTE_READONLY) ? 0444 : 0666; mode = (attrs & FILE_ATTRIBUTE_READONLY) ? 0444 : 0666;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment