diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c index e015a355..bebe0b79 100644 --- a/src/lowntfs-3g.c +++ b/src/lowntfs-3g.c @@ -3745,6 +3745,7 @@ static char *parse_mount_options(const char *orig_opts) char *options, *s, *opt, *val, *ret = NULL; BOOL no_def_opts = FALSE; int default_permissions = 0; + int permissions = 0; int want_permissions = 0; ctx->secure_flags = 0; @@ -3796,6 +3797,8 @@ static char *parse_mount_options(const char *orig_opts) no_def_opts = TRUE; /* Don't add default options. */ } else if (!strcmp(opt, "default_permissions")) { default_permissions = 1; + } else if (!strcmp(opt, "permissions")) { + permissions = 1; } else if (!strcmp(opt, "umask")) { if (missing_option_value(val, "umask")) goto err_exit; @@ -3976,7 +3979,8 @@ static char *parse_mount_options(const char *orig_opts) if (!no_def_opts && strappend(&ret, def_opts)) goto err_exit; #if KERNELPERMS - if (default_permissions && strappend(&ret, "default_permissions,")) + if ((default_permissions || permissions) + && strappend(&ret, "default_permissions,")) goto err_exit; #endif @@ -3991,7 +3995,7 @@ static char *parse_mount_options(const char *orig_opts) goto err_exit; if (strappend(&ret, opts.device)) goto err_exit; - if (default_permissions) + if (permissions) ctx->secure_flags |= (1 << SECURITY_DEFAULT); if (want_permissions) ctx->secure_flags |= (1 << SECURITY_WANTED); diff --git a/src/ntfs-3g.8.in b/src/ntfs-3g.8.in index fc0fe25c..66a38f7d 100644 --- a/src/ntfs-3g.8.in +++ b/src/ntfs-3g.8.in @@ -55,7 +55,7 @@ options. Doing so, Windows users have full access to the files created by .B ntfs-3g. .PP -But, by setting the default_permissions option, you can benefit from the full +But, by setting the permissions option, you can benefit from the full ownership and permissions features as defined by POSIX. By defining a Windows-to-Linux user mapping, the ownership and permissions will even be applied to Windows users and conversely. @@ -124,10 +124,9 @@ When a user mapping file is defined, the options \fBuid=\fP, \fBgid=\fP, \fBumask=\fP, \fBfmask=\fP, \fBdmask=\fP and \fBdsilent=\fP are ignored. .RE .TP -.B default_permissions +.B permissions Set standard permissions on created files and use standard access control. -This option is set by default when a user mapping file or an ownership related -option is present. +This option is set by default when a user mapping file is present. .TP .B inherit When creating a new file, set its initial ownership and protections @@ -283,7 +282,7 @@ NTFS and recognized. .P By default, this mapping is fetched from the file \fB.NTFS-3G/UserMapping\fP located in the NTFS partition. The option \fBusermapping=\fP may be used -to define another location. When the option default_permissions is set and +to define another location. When the option permissions is set and no mapping file is found, a default mapping is used. .P Each line in the user mapping file defines a mapping. It is organized @@ -298,7 +297,7 @@ with no uid and gid can be used. Files created on Linux will appear to Windows as owned by a foreign user, and files created on Windows will appear to Linux as owned by root. Just copy the example below and replace the 9 and 10-digit numbers by any number not greater than 4294967295. The resulting -behavior is the same as the one with the option default_permission set with +behavior is the same as the one with the option permission set with no ownership option and no user mapping file available. .RS .sp diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 5a529a7f..080bfac6 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -3695,6 +3695,7 @@ static char *parse_mount_options(const char *orig_opts) char *options, *s, *opt, *val, *ret = NULL; BOOL no_def_opts = FALSE; int default_permissions = 0; + int permissions = 0; int want_permissions = 0; ctx->secure_flags = 0; @@ -3746,6 +3747,8 @@ static char *parse_mount_options(const char *orig_opts) no_def_opts = TRUE; /* Don't add default options. */ } else if (!strcmp(opt, "default_permissions")) { default_permissions = 1; + } else if (!strcmp(opt, "permissions")) { + permissions = 1; } else if (!strcmp(opt, "umask")) { if (missing_option_value(val, "umask")) goto err_exit; @@ -3923,7 +3926,8 @@ static char *parse_mount_options(const char *orig_opts) } if (!no_def_opts && strappend(&ret, def_opts)) goto err_exit; - if (default_permissions && strappend(&ret, "default_permissions,")) + if ((default_permissions || permissions) + && strappend(&ret, "default_permissions,")) goto err_exit; if (ctx->atime == ATIME_RELATIVE && strappend(&ret, "relatime,")) @@ -3937,7 +3941,7 @@ static char *parse_mount_options(const char *orig_opts) goto err_exit; if (strappend(&ret, opts.device)) goto err_exit; - if (default_permissions) + if (permissions) ctx->secure_flags |= (1 << SECURITY_DEFAULT); if (want_permissions) ctx->secure_flags |= (1 << SECURITY_WANTED);