* utils/mount.c (main): realpath mountpoint. * utils/umount.c (do_umount): Likewise. --- utils/mount.c | 7 +++++++ utils/umount.c | 7 +++++++ 2 files changed, 14 insertions(+)
diff --git a/utils/mount.c b/utils/mount.c index df77c66..c14e073 100644 --- a/utils/mount.c +++ b/utils/mount.c @@ -598,6 +598,13 @@ main (int argc, char **argv) if (err) error (3, ENOMEM, "collecting mount options"); + if (mountpoint) + { + mountpoint = realpath (mountpoint, NULL); + if (! mountpoint) + error (3, errno, "Error while canonicalizing path"); + } + if (device) /* two-argument form */ { struct mntent m = diff --git a/utils/umount.c b/utils/umount.c index 7901da6..4a568cd 100644 --- a/utils/umount.c +++ b/utils/umount.c @@ -192,6 +192,13 @@ do_umount (struct fs *fs) { error_t err = 0; + if (fs->mntent.mnt_dir) + { + fs->mntent.mnt_dir = realpath (fs->mntent.mnt_dir, NULL); + if (! fs->mntent.mnt_dir) + error (3, errno, "Error while canonicalizing path"); + } + file_t node = file_name_lookup (fs->mntent.mnt_dir, O_NOTRANS, 0666); if (node == MACH_PORT_NULL) { -- 2.0.0