From 7b17f7daf495a995afa20d10f68e41b989263ad1 Mon Sep 17 00:00:00 2001 From: szaka Date: Sat, 9 Feb 2008 14:46:48 +0000 Subject: [PATCH] remove user= option handling because fuse-lite will take care about it --- src/ntfs-3g.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index d40a22ca..c0439bdf 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -69,7 +69,6 @@ #include #include #include -#include #ifdef HAVE_SETXATTR #include @@ -1682,7 +1681,6 @@ static char *parse_mount_options(const char *orig_opts) * +1 null-terminator * +21 ,blkdev,blksize=65536 * +20 ,default_permissions - * +70 ,user= * +PATH_MAX resolved realpath() device name */ ret = ntfs_malloc(strlen(def_opts) + strlen(orig_opts) + 256 + PATH_MAX); @@ -2188,27 +2186,6 @@ static void set_fuseblk_options(char *parsed_options) strcat(parsed_options, options); } -static void set_user_mount_option(char *parsed_options, uid_t uid) -{ - struct passwd *pw; - char option[64]; - - if (!uid) - return; - - errno = 0; - pw = getpwuid(uid); - if (!pw || !pw->pw_name) { - ntfs_log_perror("WARNING: could not get username for uid %lld, " - "unprivileged unmount may fail", (long long)uid); - return; - } - - /* parsed_options already allocated enough space. */ - snprintf(option, sizeof(option), ",user=%s", pw->pw_name); - strcat(parsed_options, option); -} - #ifndef FUSE_INTERNAL static int set_uid(uid_t uid) { @@ -2349,11 +2326,9 @@ int main(int argc, char *argv[]) if (err) goto err_out; - if (ctx->blkdev) { - /* Must do after ntfs_open() to set the right blksize. */ + /* We must do this after ntfs_open() to be able to set the blksize */ + if (ctx->blkdev) set_fuseblk_options(parsed_options); - set_user_mount_option(parsed_options, getuid()); - } fh = mount_fuse(parsed_options); if (!fh) {