* Fix revalidate time setting for newly created inodes
+ * Remove uid==0 check for '-x' option in fusermount (kernel checks
+ this)
+
+ * fuse_main() only installs handlers for signals (out of INT, HUP,
+ TERM, PIPE), for which no handler has yet been installed
+
+ * Add module option 'user_allow_other' which if set to non-zero
+ will allow non root user to specify the 'allow_other' mount option
+ ('-x' option of fusermount)
+
2004-07-01 Miklos Szeredi <mszeredi@inf.bme.hu>
* Change passing fuse include dir to 2.6 kernel make system more
- robust (hopefully fixes problems seen on SuSE 9.1)
+ robust (fixes compile problems seen on SuSE 9.1 with updated 2.6
+ kernel)
2004-06-30 Miklos Szeredi <mszeredi@inf.bme.hu>
#include "compat/parser.h"
#endif
+
+static int user_allow_other;
+
+#ifdef KERNEL_2_6
+#include <linux/moduleparam.h>
+module_param(user_allow_other, int, 0);
+#else
+MODULE_PARM(user_allow_other, "i");
+#endif
+
+MODULE_PARM_DESC(user_allow_other, "Allow non root user to specify the \"allow_other\" mount option");
+
+
#define FUSE_SUPER_MAGIC 0x65735546
#ifndef KERNEL_2_6
if (!parse_fuse_opt((char *) data, &d))
return -EINVAL;
- if ((d.flags & FUSE_ALLOW_OTHER) && !capable(CAP_SYS_ADMIN))
+ if (!user_allow_other && (d.flags & FUSE_ALLOW_OTHER) &&
+ current->uid != 0)
return -EPERM;
sb->s_blocksize = PAGE_CACHE_SIZE;
fuse_exit(fuse);
}
-static void set_signal_handlers()
+static void set_one_signal_handler(int signal, void (*handler)(int))
{
struct sigaction sa;
+ struct sigaction old_sa;
- sa.sa_handler = exit_handler;
+ sa.sa_handler = handler;
sigemptyset(&(sa.sa_mask));
sa.sa_flags = 0;
- if (sigaction(SIGHUP, &sa, NULL) == -1 ||
- sigaction(SIGINT, &sa, NULL) == -1 ||
- sigaction(SIGTERM, &sa, NULL) == -1) {
-
- perror("Cannot set exit signal handlers");
+ if (sigaction(signal, NULL, &old_sa) == -1) {
+ perror("FUSE: cannot get old signal handler");
exit(1);
}
-
- sa.sa_handler = SIG_IGN;
-
- if (sigaction(SIGPIPE, &sa, NULL) == -1) {
- perror("Cannot set ignored signals");
+
+ if (old_sa.sa_handler == SIG_DFL &&
+ sigaction(signal, &sa, NULL) == -1) {
+ perror("Cannot set signal handler");
exit(1);
}
}
+static void set_signal_handlers()
+{
+ set_one_signal_handler(SIGHUP, exit_handler);
+ set_one_signal_handler(SIGINT, exit_handler);
+ set_one_signal_handler(SIGTERM, exit_handler);
+ set_one_signal_handler(SIGPIPE, SIG_IGN);
+}
+
static int fuse_start(int fuse_fd, int flags, int multithreaded,
int background, const struct fuse_operations *op)
{