aboutsummaryrefslogtreecommitdiffstats
path: root/lib/helper.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-07-07 12:35:37 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2005-07-07 12:35:37 +0000
commitc902a858d7a79e7da947e9a91d110ee8668db913 (patch)
tree3fe4ed8a2c8cf9c65e7b4a48c653a6c063d1745b /lib/helper.c
parente331c4b9371ccbdf2c1ff9da176c1beccb40e553 (diff)
downloadlibfuse-c902a858d7a79e7da947e9a91d110ee8668db913.tar.gz
fix
Diffstat (limited to 'lib/helper.c')
-rw-r--r--lib/helper.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/helper.c b/lib/helper.c
index 0d6e5b2..13f3ca2 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -136,6 +136,8 @@ static int add_options(char **lib_optp, char **kernel_optp, const char *opts)
char *xopts = strdup(opts);
char *s = xopts;
char *opt;
+ int has_allow_other = 0;
+ int has_allow_root = 0;
if (xopts == NULL) {
fprintf(stderr, "fuse: memory allocation failed\n");
@@ -147,16 +149,25 @@ static int add_options(char **lib_optp, char **kernel_optp, const char *opts)
if (fuse_is_lib_option(opt)) {
res = add_option_to(opt, lib_optp);
/* Compatibility hack */
- if (strcmp(opt, "allow_root") == 0 && res != -1)
+ if (strcmp(opt, "allow_root") == 0 && res != -1) {
+ has_allow_root = 1;
res = add_option_to("allow_other", kernel_optp);
+ }
}
- else
+ else {
res = add_option_to(opt, kernel_optp);
+ if (strcmp(opt, "allow_other") == 0)
+ has_allow_other = 1;
+ }
if (res == -1) {
fprintf(stderr, "fuse: memory allocation failed\n");
return -1;
}
}
+ if (has_allow_other && has_allow_root) {
+ fprintf(stderr, "fuse: 'allow_other' and 'allow_root' options are mutually exclusive\n");
+ return -1;
+ }
free(xopts);
return 0;
}