diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2007-11-12 13:57:12 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2007-11-12 13:57:12 +0000 |
commit | 0b47f6bc8bfe939f12266ef41cba31a2eb2c5f30 (patch) | |
tree | 626656abfdb98b52dc0f3e992ace6f96c35a66af | |
parent | f6fc1280f9ef5a2833abca56c976cf5fb046dfa5 (diff) | |
download | libfuse-0b47f6bc8bfe939f12266ef41cba31a2eb2c5f30.tar.gz |
'fusermount -u' did not umount the filesystem if /etc/mtab was a symlink
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/mount_util.c | 10 |
2 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2007-11-12 Miklos Szeredi <miklos@szeredi.hu> + + * 'fusermount -u' did not umount the filesystem if /etc/mtab was a + symlink. This bug was introduced in 2.7.1 by "Don't call + /bin/[u]mount if /etc/mtab is a symlink". Found by robertsong. + 2007-10-16 Miklos Szeredi <miklos@szeredi.hu> * Released 2.7.1 diff --git a/lib/mount_util.c b/lib/mount_util.c index c7b2123..9ce431a 100644 --- a/lib/mount_util.c +++ b/lib/mount_util.c @@ -17,6 +17,7 @@ #include <mntent.h> #include <sys/stat.h> #include <sys/wait.h> +#include <sys/mount.h> static int mtab_needs_update(const char *mnt) { @@ -91,8 +92,13 @@ int fuse_mnt_umount(const char *progname, const char *mnt, int lazy) int res; int status; - if (!mtab_needs_update(mnt)) - return 0; + if (!mtab_needs_update(mnt)) { + res = umount2(mnt, lazy ? 2 : 0); + if (res == -1) + fprintf(stderr, "%s: failed to unmount %s: %s\n", progname, + mnt, strerror(errno)); + return res; + } res = fork(); if (res == -1) { |