server: Create directories with the specified security attributes.

This commit is contained in:
Erich E. Hoover 2013-11-08 12:04:56 -07:00 committed by Alexandre Julliard
parent 95c414fea7
commit d2e216f462
3 changed files with 5 additions and 4 deletions

View File

@ -3081,9 +3081,8 @@ static void test_CreateDirectoryA(void)
bret = pGetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation);
ok(bret, "GetAclInformation failed\n");
todo_wine ok(acl_size.AceCount == 2,
"GetAclInformation returned unexpected entry count (%d != 2).\n",
acl_size.AceCount);
ok(acl_size.AceCount == 2, "GetAclInformation returned unexpected entry count (%d != 2).\n",
acl_size.AceCount);
if (acl_size.AceCount > 0)
{
bret = pGetAce(pDacl, 0, (VOID **)&ace);

View File

@ -1768,7 +1768,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
/* create the directory if needed */
if ((options & FILE_DIRECTORY_FILE) && (flags & O_CREAT))
{
if (mkdir( name, 0777 ) == -1)
if (mkdir( name, *mode ) == -1)
{
if (errno != EEXIST || (flags & O_EXCL))
{

View File

@ -218,6 +218,8 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si
owner = token_get_user( current->process->token );
mode = sd_to_mode( sd, owner );
}
else if (options & FILE_DIRECTORY_FILE)
mode = (attrs & FILE_ATTRIBUTE_READONLY) ? 0555 : 0777;
else
mode = (attrs & FILE_ATTRIBUTE_READONLY) ? 0444 : 0666;