transfused: use an absolute path for fusermount

Gets rid of non-portable execvpe for execve and prevents diversion.
Explicit diversion will be introduced as a command-line option later.
This commit is contained in:
David Sheets 2016-02-11 12:03:46 +00:00
parent 7ab2f3816c
commit c8b9013ed3

View File

@ -19,9 +19,6 @@ int debug = 0;
int save_trace; int save_trace;
// execvpe is in unistd.h on Linux.
int execvpe(const char *path, char *const argv[], char *const envp[]);
typedef struct { typedef struct {
char * socket9p_root; char * socket9p_root;
} parameters; } parameters;
@ -39,7 +36,7 @@ typedef struct {
int to; int to;
} copy_thread_state; } copy_thread_state;
char * fusermount = "fusermount"; char * fusermount = "/bin/fusermount";
void die(int exit_code, const char * perror_arg, const char * fmt, ...) { void die(int exit_code, const char * perror_arg, const char * fmt, ...) {
va_list argp; va_list argp;
@ -237,7 +234,7 @@ int get_fuse_sock(char *const optv[]) {
// fork and exec fusermount // fork and exec fusermount
fusermount_pid = fork(); fusermount_pid = fork();
if (!fusermount_pid) // child if (!fusermount_pid) // child
if (execvpe(fusermount, argv, envp)) if (execve(fusermount, argv, envp))
die(1, "Failed to execute fusermount", ""); die(1, "Failed to execute fusermount", "");
// parent // parent