aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/fusermount.c14
-rw-r--r--util/meson.build2
2 files changed, 12 insertions, 4 deletions
diff --git a/util/fusermount.c b/util/fusermount.c
index 8528342..b87d8bb 100644
--- a/util/fusermount.c
+++ b/util/fusermount.c
@@ -10,6 +10,7 @@
#define _GNU_SOURCE /* for clone and strchrnul */
#include "fuse_config.h"
#include "mount_util.h"
+#include "util.h"
#include <stdio.h>
#include <stdlib.h>
@@ -1500,7 +1501,7 @@ int main(int argc, char *argv[])
static int lazy = 0;
static int quiet = 0;
char *commfd = NULL;
- int cfd;
+ long cfd;
const char *opts = "";
const char *type = NULL;
int setup_auto_unmount_only = 0;
@@ -1604,13 +1605,20 @@ int main(int argc, char *argv[])
goto err_out;
}
- cfd = atoi(commfd);
+ res = libfuse_strtol(commfd, &cfd);
+ if (res) {
+ fprintf(stderr,
+ "%s: invalid _FUSE_COMMFD: %s\n",
+ progname, commfd);
+ goto err_out;
+
+ }
{
struct stat statbuf;
fstat(cfd, &statbuf);
if(!S_ISSOCK(statbuf.st_mode)) {
fprintf(stderr,
- "%s: file descriptor %i is not a socket, can't send fuse fd\n",
+ "%s: file descriptor %li is not a socket, can't send fuse fd\n",
progname, cfd);
goto err_out;
}
diff --git a/util/meson.build b/util/meson.build
index 01c92f0..0e4b1cc 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -1,6 +1,6 @@
fuseconf_path = join_paths(get_option('prefix'), get_option('sysconfdir'), 'fuse.conf')
-executable('fusermount3', ['fusermount.c', '../lib/mount_util.c'],
+executable('fusermount3', ['fusermount.c', '../lib/mount_util.c', '../lib/util.c'],
include_directories: include_dirs,
install: true,
install_dir: get_option('bindir'),