+2005-07-07 Miklos Szeredi <miklos@szeredi.hu>
+
+ * lib: don't allow both 'allow_other' and 'allow_root' options to
+ be given
+
2005-07-06 Miklos Szeredi <miklos@szeredi.hu>
* fusermount: check if mountpoint is empty (only '.' and '..' for
allow_other
This option overrides the security measure restricting file access
- to the user mounting the filesystem. This option is by default only
- allowed to root, but this restriction can be removed with a
- configuration option described in the previous section.
+ to the user mounting the filesystem. So all users (including root)
+ can access the files. This option is by default only allowed to
+ root, but this restriction can be removed with a configuration
+ option described in the previous section.
allow_root
This option is similar to 'allow_other' but file access is limited
- to the user mounting the filesystem and root.
+ to the user mounting the filesystem and root. This option and
+ 'allow_other' are mutually exclusive.
kernel_cache
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");
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;
}