nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/configure.ac b/configure.ac
2index 9aa25bd5..c7c0437b 100644
3--- a/configure.ac
4+++ b/configure.ac
5@@ -185,6 +185,30 @@ AC_ARG_ENABLE(
6 ]
7 )
8
9+AC_ARG_WITH(
10+ [mount-helper],
11+ [AS_HELP_STRING([--with-mount-helper=BIN],[use the specified binary as mount helper @<:@default=/sbin/mount@:>@])],
12+ [mount_helper="$withval"],
13+ [mount_helper="/sbin/mount"]
14+)
15+AC_DEFINE_UNQUOTED([MOUNT_HELPER], ["$mount_helper"], [Binary used as mount helper.])
16+
17+AC_ARG_WITH(
18+ [umount-helper],
19+ [AS_HELP_STRING([--with-umount-helper=BIN],[use the specified binary as umount helper @<:@default=/sbin/umount@:>@])],
20+ [umount_helper="$withval"],
21+ [umount_helper="/sbin/umount"]
22+)
23+AC_DEFINE_UNQUOTED([UMOUNT_HELPER], ["$umount_helper"], [Binary used as umount helper.])
24+
25+AC_ARG_WITH(
26+ [modprobe-helper],
27+ [AS_HELP_STRING([--with-modprobe-helper=BIN],[use the specified binary as modprobe helper @<:@default=/sbin/modprobe@:>@])],
28+ [modprobe_helper="$withval"],
29+ [modprobe_helper="/sbin/modprobe"]
30+)
31+AC_DEFINE_UNQUOTED([MODPROBE_HELPER], ["$modprobe_helper"], [Binary used as modprobe helper.])
32+
33 # pthread_rwlock_t requires _GNU_SOURCE
34 AC_GNU_SOURCE
35
36diff --git a/libfuse-lite/mount_util.c b/libfuse-lite/mount_util.c
37index 8b317224..ee75ace6 100644
38--- a/libfuse-lite/mount_util.c
39+++ b/libfuse-lite/mount_util.c
40@@ -89,10 +89,10 @@ int fuse_mnt_add_mount(const char *progname, const char *fsname,
41 exit(1);
42 }
43 rmdir(tmp);
44- execle("/sbin/mount", "/sbin/mount", "-F", type, "-o", opts,
45+ execle(MOUNT_HELPER, MOUNT_HELPER, "-F", type, "-o", opts,
46 fsname, mnt, NULL, &env);
47- fprintf(stderr, "%s: failed to execute /sbin/mount: %s\n", progname,
48- strerror(errno));
49+ fprintf(stderr, "%s: failed to execute %s: %s\n", progname,
50+ MOUNT_HELPER, strerror(errno));
51 exit(1);
52 }
53 res = waitpid(res, &status, 0);
54@@ -126,14 +126,14 @@ int fuse_mnt_umount(const char *progname, const char *mnt, int lazy)
55
56 setuid(geteuid());
57 if (lazy) {
58- execle("/sbin/umount", "/sbin/umount", mnt,
59+ execle(UMOUNT_HELPER, UMOUNT_HELPER, mnt,
60 NULL, &env);
61 } else {
62- execle("/sbin/umount", "/sbin/umount", "-f", mnt,
63+ execle(UMOUNT_HELPER, UMOUNT_HELPER, "-f", mnt,
64 NULL, &env);
65 }
66- fprintf(stderr, "%s: failed to execute /sbin/umount: %s\n", progname,
67- strerror(errno));
68+ fprintf(stderr, "%s: failed to execute %s: %s\n", progname,
69+ UMOUNT_HELPER, strerror(errno));
70 exit(1);
71 }
72 res = waitpid(res, &status, 0);
73diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c
74index 9330500c..dd18a93f 100644
75--- a/src/lowntfs-3g.c
76+++ b/src/lowntfs-3g.c
77@@ -4463,7 +4463,7 @@ static fuse_fstype load_fuse_module(void)
78 int i;
79 struct stat st;
80 pid_t pid;
81- const char *cmd = "/sbin/modprobe";
82+ const char *cmd = MODPROBE_HELPER;
83 char *env = (char*)NULL;
84 struct timespec req = { 0, 100000000 }; /* 100 msec */
85 fuse_fstype fstype;
86diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c
87index d8227e71..f5d77252 100644
88--- a/src/ntfs-3g.c
89+++ b/src/ntfs-3g.c
90@@ -4171,7 +4171,7 @@ static fuse_fstype load_fuse_module(void)
91 int i;
92 struct stat st;
93 pid_t pid;
94- const char *cmd = "/sbin/modprobe";
95+ const char *cmd = MODPROBE_HELPER;
96 char *env = (char*)NULL;
97 struct timespec req = { 0, 100000000 }; /* 100 msec */
98 fuse_fstype fstype;