2.19.1-1.2: fix #709681

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2011-06-14 11:43:44 +02:00
commit d6ea7f6451
2 changed files with 40 additions and 2 deletions

View file

@ -0,0 +1,33 @@
From aab72640daa7ee2db3d42fc8278ab86e3aef2d71 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
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 <kzak@redhat.com>
---
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

View file

@ -2,7 +2,7 @@
Summary: A collection of basic system utilities
Name: util-linux
Version: 2.19.1
Release: 1.1%{?dist}
Release: 1.2%{?dist}
License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain
Group: System Environment/Base
URL: http://kernel.org/~kzak/util-linux/
@ -91,7 +91,8 @@ Patch9: util-linux-2.19-kernel-version.patch
# 709319 - 'mount -a' mounts already mounted directories
Patch10: util-linux-2.19-libmount-mounted.patch
Patch11: util-linux-2.19-mount-a-bind.patch
# 709681 - failure to mount if a mount point ends with a slash in /etc/fstab
Patch12: util-linux-2.19-mount-fsname.patch
%description
The util-linux package contains a large variety of low-level system
@ -209,6 +210,7 @@ cp %{SOURCE8} %{SOURCE9} .
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%build
@ -755,6 +757,9 @@ fi
%changelog
* Tue Jun 14 2011 Karel Zak <kzak@redhat.com> 2.19.1-1.2
- fix #709681 - failure to mount if a mount point ends with a slash in /etc/fstab
* Tue Jun 14 2011 Karel Zak <kzak@redhat.com> 2.19.1-1.1
- fix #709319 - 'mount -a' mounts already mounted directories
- fix kernel version parsing