From 0afd8ce18b556c4e6a80b1ea5c2007a2941f7bd1 Mon Sep 17 00:00:00 2001 From: szaka Date: Sun, 20 Jan 2008 18:37:15 +0000 Subject: [PATCH] fix signal handling for integrated fuse user mounts --- src/ntfs-3g.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 07f0e4f0..d2e08792 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -2191,6 +2191,7 @@ static void set_user_mount_option(char *parsed_options, uid_t uid) strcat(parsed_options, option); } +#ifndef FUSE_INTERNAL static int set_uid(uid_t uid) { if (setuid(uid)) { @@ -2199,16 +2200,15 @@ static int set_uid(uid_t uid) } return NTFS_VOLUME_OK; } +#endif static struct fuse *mount_fuse(char *parsed_options) { - uid_t uid, euid; struct fuse *fh = NULL; struct fuse_args args = FUSE_ARGS_INIT(0, NULL); +#ifndef FUSE_INTERNAL + uid_t uid, euid; - /* Libfuse can't always find fusermount, so let's help it. */ - if (setenv("PATH", ":/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin", 0)) - ntfs_log_perror("WARNING: Failed to set $PATH\n"); /* * We must raise privilege if possible, otherwise the user[s] fstab * option doesn't work because mount(8) always drops privilege what @@ -2219,6 +2219,10 @@ static struct fuse *mount_fuse(char *parsed_options) if (set_uid(euid)) return NULL; +#endif + /* Libfuse can't always find fusermount, so let's help it. */ + if (setenv("PATH", ":/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin", 0)) + ntfs_log_perror("WARNING: Failed to set $PATH\n"); ctx->fc = try_fuse_mount(parsed_options); if (!ctx->fc)