aboutsummaryrefslogtreecommitdiffstats
path: root/lib/helper.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-06-06 09:48:30 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2006-06-06 09:48:30 +0000
commit9dedb707f43ea1d2e989c41e91e348b1982f06ce (patch)
tree1ec43b3ad2e3dc26c35a4757b4c38271a19416ec /lib/helper.c
parentd021ce48ab5e32a1bf783b007cf656565d7eb6d8 (diff)
downloadlibfuse-9dedb707f43ea1d2e989c41e91e348b1982f06ce.tar.gz
fix
Diffstat (limited to 'lib/helper.c')
-rw-r--r--lib/helper.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/helper.c b/lib/helper.c
index 7f8ffa5..b6925d4 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -18,6 +18,7 @@
#include <unistd.h>
#include <string.h>
#include <limits.h>
+#include <errno.h>
enum {
KEY_HELP,
@@ -99,9 +100,14 @@ static int fuse_helper_opt_proc(void *data, const char *arg, int key,
return 1;
case FUSE_OPT_KEY_NONOPT:
- if (!hopts->mountpoint)
- return fuse_opt_add_opt(&hopts->mountpoint, arg);
- else {
+ if (!hopts->mountpoint) {
+ char mountpoint[PATH_MAX];
+ if (realpath(arg, mountpoint) == NULL) {
+ fprintf(stderr, "fuse: bad mount point `%s': %s\n", arg, strerror(errno));
+ return -1;
+ }
+ return fuse_opt_add_opt(&hopts->mountpoint, mountpoint);
+ } else {
fprintf(stderr, "fuse: invalid argument `%s'\n", arg);
return -1;
}