aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-27 20:54:45 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-27 20:57:17 -0700
commit4fade0c616a9227e42043ac3332f0fc59a6df327 (patch)
treefda381e816e35a517834f71614e50bd6000c7067 /util
parent97685957d7bb45fd78beda5b175585d69ad04814 (diff)
Removed obsolete FUSE_DEV_OLD
Diffstat (limited to 'util')
-rw-r--r--util/fusermount.c62
1 files changed, 8 insertions, 54 deletions
diff --git a/util/fusermount.c b/util/fusermount.c
index 8ba4ebf..41061bb 100644
--- a/util/fusermount.c
+++ b/util/fusermount.c
@@ -32,9 +32,7 @@
#define FUSE_COMMFD_ENV "_FUSE_COMMFD"
-#define FUSE_DEV_OLD "/proc/fs/fuse/dev"
-#define FUSE_DEV_NEW "/dev/fuse"
-#define FUSE_VERSION_FILE_OLD "/proc/fs/fuse/version"
+#define FUSE_DEV "/dev/fuse"
#define FUSE_CONF "/etc/fuse.conf"
#ifndef MS_DIRSYNC
@@ -876,37 +874,6 @@ err:
return -1;
}
-static int check_version(const char *dev)
-{
- int res;
- int majorver;
- int minorver;
- const char *version_file;
- FILE *vf;
-
- if (strcmp(dev, FUSE_DEV_OLD) != 0)
- return 0;
-
- version_file = FUSE_VERSION_FILE_OLD;
- vf = fopen(version_file, "r");
- if (vf == NULL) {
- fprintf(stderr, "%s: kernel interface too old\n", progname);
- return -1;
- }
- res = fscanf(vf, "%i.%i", &majorver, &minorver);
- fclose(vf);
- if (res != 2) {
- fprintf(stderr, "%s: error reading %s\n", progname,
- version_file);
- return -1;
- }
- if (majorver < 3) {
- fprintf(stderr, "%s: kernel interface too old\n", progname);
- return -1;
- }
- return 0;
-}
-
static int check_perm(const char **mntp, struct stat *stbuf, int *mountpoint_fd)
{
int res;
@@ -1012,20 +979,11 @@ static int try_open(const char *dev, char **devp, int silent)
static int try_open_fuse_device(char **devp)
{
int fd;
- int err;
drop_privs();
- fd = try_open(FUSE_DEV_NEW, devp, 0);
+ fd = try_open(FUSE_DEV, devp, 0);
restore_privs();
- if (fd >= 0)
- return fd;
-
- err = fd;
- fd = try_open(FUSE_DEV_OLD, devp, 1);
- if (fd >= 0)
- return fd;
-
- return err;
+ return fd;
}
static int open_fuse_device(char **devp)
@@ -1069,15 +1027,11 @@ static int mount_fuse(const char *mnt, const char *opts)
}
}
- res = check_version(dev);
- if (res != -1) {
- res = check_perm(&real_mnt, &stbuf, &mountpoint_fd);
- restore_privs();
- if (res != -1)
- res = do_mount(real_mnt, &type, stbuf.st_mode & S_IFMT,
- fd, opts, dev, &source, &mnt_opts);
- } else
- restore_privs();
+ res = check_perm(&real_mnt, &stbuf, &mountpoint_fd);
+ restore_privs();
+ if (res != -1)
+ res = do_mount(real_mnt, &type, stbuf.st_mode & S_IFMT,
+ fd, opts, dev, &source, &mnt_opts);
if (mountpoint_fd != -1)
close(mountpoint_fd);