summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-02-25 21:39:49 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2018-02-26 10:33:38 +0100
commite186bf3c3ee4d2eb91a22b6921726eac9b815130 (patch)
treeba9dca7165ff59c2df5a5797ece6f7bc0a098ebf /src
parent09c4d6239c0bd18fdeb15e99d6de43ea3c68fcef (diff)
downloadouroboros-0.10.4.tar.gz
ouroboros-0.10.4.zip
lib: Fix FUSE access for non-root users0.10.4
This fixes the access to the RIB for non-root users. Thanks to Sitri and Dagger from the ##fuse channel for their assistance. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src')
-rw-r--r--src/lib/rib.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/lib/rib.c b/src/lib/rib.c
index 947226a9..909d217f 100644
--- a/src/lib/rib.c
+++ b/src/lib/rib.c
@@ -260,20 +260,19 @@ static void * fuse_thr(void * o)
}
#endif /* HAVE_FUSE */
+
int rib_init(const char * prefix)
{
#ifdef HAVE_FUSE
struct stat st;
- char * argv[] = {"ignored",
- NULL,
- "-f",
+ char * argv[] = {"-f",
"-o",
- "ro,",
- "allow_other,",
- "default_permissions,",
+ "ro,"
+ "default_permissions,"
+ "allow_other,"
"fsname=rib",
NULL};
- struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
+ struct fuse_args args = FUSE_ARGS_INIT(3, argv);
if (stat(FUSE_PREFIX, &st) == -1)
return -1;
@@ -283,9 +282,7 @@ int rib_init(const char * prefix)
if (stat(rib.mnt, &st) == -1)
mkdir(rib.mnt, 0777);
- argv[1] = rib.mnt;
-
- fuse_opt_parse(&args, argv, NULL, NULL);
+ fuse_opt_parse(&args, NULL, NULL, NULL);
list_head_init(&rib.reg_comps);