diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c index d248902e..92b91604 100644 --- a/src/lowntfs-3g.c +++ b/src/lowntfs-3g.c @@ -4432,19 +4432,19 @@ 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)) - && !(ctx->secure_flags & (1 << SECURITY_DEFAULT))) { - ctx->secure_flags |= (1 << SECURITY_DEFAULT); + if ((ctx->vol->secure_flags & (1 << SECURITY_WANTED)) + && !(ctx->vol->secure_flags & (1 << SECURITY_DEFAULT))) { + ctx->vol->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); + if (ctx->vol->secure_flags & (1 << SECURITY_DEFAULT)) { + ctx->vol->secure_flags |= (1 << SECURITY_RAW); permissions_mode = "Global ownership and permissions enforced"; } else { - ctx->secure_flags &= ~(1 << SECURITY_RAW); + ctx->vol->secure_flags &= ~(1 << SECURITY_RAW); permissions_mode = "Ownership and permissions disabled"; } } diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 84ac8513..34b1634f 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -4395,19 +4395,19 @@ 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)) - && !(ctx->secure_flags & (1 << SECURITY_DEFAULT))) { - ctx->secure_flags |= (1 << SECURITY_DEFAULT); + if ((ctx->vol->secure_flags & (1 << SECURITY_WANTED)) + && !(ctx->vol->secure_flags & (1 << SECURITY_DEFAULT))) { + ctx->vol->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); + if (ctx->vol->secure_flags & (1 << SECURITY_DEFAULT)) { + ctx->vol->secure_flags |= (1 << SECURITY_RAW); permissions_mode = "Global ownership and permissions enforced"; } else { - ctx->secure_flags &= ~(1 << SECURITY_RAW); + ctx->vol->secure_flags &= ~(1 << SECURITY_RAW); permissions_mode = "Ownership and permissions disabled"; } } @@ -4432,7 +4432,7 @@ int main(int argc, char *argv[]) if (permissions_mode) ntfs_log_info("%s, configuration type %d\n",permissions_mode, 4 + POSIXACLS*6 - KERNELPERMS*3 + CACHEING); - if ((ctx->secure_flags & (1 << SECURITY_RAW)) + if ((ctx->vol->secure_flags & (1 << SECURITY_RAW)) && !ctx->uid && ctx->gid) ntfs_log_error("Warning : using problematic uid==0 and gid!=0\n");