mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 10:04:00 +08:00
Fixed ownership of mount point on non-Linux
This commit is contained in:
parent
61f7084020
commit
f0ea07fdf3
@ -3851,6 +3851,15 @@ int main(int argc, char *argv[])
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
ctx->security.uid = 0;
|
||||
ctx->security.gid = 0;
|
||||
if ((opts.mnt_point[0] == '/')
|
||||
&& !stat(opts.mnt_point,&sbuf)) {
|
||||
/* collect owner of mount point, useful for default mapping */
|
||||
ctx->security.uid = sbuf.st_uid;
|
||||
ctx->security.gid = sbuf.st_gid;
|
||||
}
|
||||
|
||||
#if defined(linux) || defined(__uClinux__)
|
||||
fstype = get_fuse_fstype();
|
||||
|
||||
@ -3861,14 +3870,6 @@ int main(int argc, char *argv[])
|
||||
if (fstype == FSTYPE_NONE || fstype == FSTYPE_UNKNOWN)
|
||||
fstype = load_fuse_module();
|
||||
|
||||
ctx->security.uid = 0;
|
||||
ctx->security.gid = 0;
|
||||
if ((opts.mnt_point[0] == '/')
|
||||
&& !stat(opts.mnt_point,&sbuf)) {
|
||||
/* collect owner of mount point, useful for default mapping */
|
||||
ctx->security.uid = sbuf.st_uid;
|
||||
ctx->security.gid = sbuf.st_gid;
|
||||
}
|
||||
create_dev_fuse();
|
||||
|
||||
if (drop_privs())
|
||||
|
Loading…
Reference in New Issue
Block a user