From f0ea07fdf3c3e80a6befcc112e35404c5857402c Mon Sep 17 00:00:00 2001 From: jpandre Date: Fri, 18 Sep 2009 19:53:38 +0000 Subject: [PATCH] Fixed ownership of mount point on non-Linux --- src/ntfs-3g.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index b6e6f970..12b3726c 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -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())