aboutsummaryrefslogtreecommitdiff
path: root/lib/mount_util.c
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2010-02-01 14:52:30 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2010-02-01 14:52:30 +0000
commit0197ce4041f6777394efda8350bf9b29dfb8274b (patch)
treeff04a23dc754c6a6021d1b1b97c4684a99701c05 /lib/mount_util.c
parent054635595a6dae38c56a2592d9ecc5987e841afd (diff)
* Released 2.8.3
* Using --no-canonicalize with umount(8) conflicts with the race fix, sinceit assumes the supplied path is absolute, while the race fix relies on the path being relative to the current directory
Diffstat (limited to 'lib/mount_util.c')
-rw-r--r--lib/mount_util.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/lib/mount_util.c b/lib/mount_util.c
index e18e7a4..33e6697 100644
--- a/lib/mount_util.c
+++ b/lib/mount_util.c
@@ -190,7 +190,6 @@ static int exec_umount(const char *progname, const char *rel_mnt, int lazy)
int status;
sigset_t blockmask;
sigset_t oldmask;
- int legacy = 0;
sigemptyset(&blockmask);
sigaddset(&blockmask, SIGCHLD);
@@ -200,32 +199,16 @@ static int exec_umount(const char *progname, const char *rel_mnt, int lazy)
return -1;
}
-retry_umount:
res = fork();
if (res == -1) {
fprintf(stderr, "%s: fork: %s\n", progname, strerror(errno));
goto out_restore;
}
if (res == 0) {
- /*
- * Hide output, because old versions don't support
- * --no-canonicalize
- */
- if (!legacy) {
- int fd = open("/dev/null", O_RDONLY);
- dup2(fd, 1);
- dup2(fd, 2);
- }
-
sigprocmask(SIG_SETMASK, &oldmask, NULL);
setuid(geteuid());
- if (legacy) {
- execl("/bin/umount", "/bin/umount", "-i", rel_mnt,
- lazy ? "-l" : NULL, NULL);
- } else {
- execl("/bin/umount", "/bin/umount", "--no-canonicalize",
- "-i", rel_mnt, lazy ? "-l" : NULL, NULL);
- }
+ execl("/bin/umount", "/bin/umount", "-i", rel_mnt,
+ lazy ? "-l" : NULL, NULL);
fprintf(stderr, "%s: failed to execute /bin/umount: %s\n",
progname, strerror(errno));
exit(1);
@@ -235,10 +218,6 @@ retry_umount:
fprintf(stderr, "%s: waitpid: %s\n", progname, strerror(errno));
if (status != 0) {
- if (!legacy) {
- legacy = 1;
- goto retry_umount;
- }
res = -1;
}