From aab72640daa7ee2db3d42fc8278ab86e3aef2d71 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 2 Jun 2011 14:53:42 +0200 Subject: [PATCH] mount: canonicalize fstab mnt_dir Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=709681 Signed-off-by: Karel Zak --- mount/fstab.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/mount/fstab.c b/mount/fstab.c index 8ce733b..4fa26b4 100644 --- a/mount/fstab.c +++ b/mount/fstab.c @@ -455,7 +455,13 @@ getfs_by_dir (const char *dir) { cdir = canonicalize(dir); for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) { - if (streq(mc->m.mnt_dir, cdir)) { + int ok = streq(mc->m.mnt_dir, cdir); + if (!ok) { + char *dr = canonicalize(mc->m.mnt_dir); + ok = dr ? streq(dr, cdir) : 0; + free(dr); + } + if (ok) { free(cdir); return mc; } -- 1.7.5.2