Fixed enabling permissions when no UserMapping file is found

PERMISSION_HANDLING_BRANCH
Jean-Pierre André 2010-02-17 11:47:14 +01:00
parent 7449af78ca
commit d9f8647ef9
2 changed files with 16 additions and 8 deletions

View File

@ -3732,9 +3732,7 @@ static char *parse_mount_options(const char *orig_opts)
goto err_exit;
sscanf(val, "%o", &ctx->fmask);
ctx->dmask = ctx->fmask;
#if !POSIXACLS
default_permissions = 1;
#endif
want_permissions = 1;
} else if (!strcmp(opt, "fmask")) {
if (missing_option_value(val, "fmask"))
goto err_exit;
@ -4387,8 +4385,14 @@ int main(int argc, char *argv[])
/* same ownership/permissions for all files */
ctx->security.mapping[MAPUSERS] = (struct MAPPING*)NULL;
ctx->security.mapping[MAPGROUPS] = (struct MAPPING*)NULL;
if (ctx->secure_flags & (1 << SECURITY_WANTED))
if ((ctx->secure_flags & (1 << SECURITY_WANTED))
&& !(ctx->secure_flags & (1 << SECURITY_DEFAULT))) {
ctx->secure_flags |= (1 << SECURITY_DEFAULT);
if (strappend(&parsed_options, ",default_permissions")) {
err = NTFS_VOLUME_SYNTAX_ERROR;
goto err_out;
}
}
if (ctx->secure_flags & (1 << SECURITY_DEFAULT)) {
ctx->secure_flags |= (1 << SECURITY_RAW);
permissions_mode = "Global ownership and permissions enforced";

View File

@ -3702,9 +3702,7 @@ static char *parse_mount_options(const char *orig_opts)
goto err_exit;
sscanf(val, "%o", &ctx->fmask);
ctx->dmask = ctx->fmask;
#if !POSIXACLS
default_permissions = 1;
#endif
want_permissions = 1;
} else if (!strcmp(opt, "fmask")) {
if (missing_option_value(val, "fmask"))
goto err_exit;
@ -4361,8 +4359,14 @@ int main(int argc, char *argv[])
/* same ownership/permissions for all files */
ctx->security.mapping[MAPUSERS] = (struct MAPPING*)NULL;
ctx->security.mapping[MAPGROUPS] = (struct MAPPING*)NULL;
if (ctx->secure_flags & (1 << SECURITY_WANTED))
if ((ctx->secure_flags & (1 << SECURITY_WANTED))
&& !(ctx->secure_flags & (1 << SECURITY_DEFAULT))) {
ctx->secure_flags |= (1 << SECURITY_DEFAULT);
if (strappend(&parsed_options, ",default_permissions")) {
err = NTFS_VOLUME_SYNTAX_ERROR;
goto err_out;
}
}
if (ctx->secure_flags & (1 << SECURITY_DEFAULT)) {
ctx->secure_flags |= (1 << SECURITY_RAW);
permissions_mode = "Global ownership and permissions enforced";