From c590e0ed62a6cccff4d4eb7101be7e751b4e9a4d Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 21 Apr 2009 10:32:08 +0200 Subject: [PATCH] Use the normalized path for unmounting, patch by Peter Daum In "unmount" it tries to make sure the path to umount is actually mounted by comparing the mounted path against the output of "/proc/mounts". Because paths reported by "/proc/mounts" are normalized, this will fail if there are any symlinks involved (leaving all mounts and an unbootable usb stick). --- debian/changelog | 4 +++- grml2usb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c32b81d..53c7adf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,10 @@ grml2usb (0.9.5) UNRELEASED; urgency=low * Fix dashes of options in manpage (thanks for the bugreport, Thorsten Glaser). * Display program version during execution. + * Apply fix by Peter Daum , making sure + to use the normalized path for unmounting. Thanks! - -- Michael Prokop Fri, 10 Apr 2009 01:08:01 +0200 + -- Michael Prokop Tue, 21 Apr 2009 10:31:18 +0200 grml2usb (0.9.4) unstable; urgency=low diff --git a/grml2usb b/grml2usb index 3bf80e8..b5338bd 100755 --- a/grml2usb +++ b/grml2usb @@ -869,7 +869,7 @@ def unmount(target, unmount_options): # make sure we unmount only already mounted targets target_unmount = False mounts = open('/proc/mounts').readlines() - mountstring = re.compile(".*%s.*" % re.escape(target)) + mountstring = re.compile(".*%s.*" % re.escape(os.path.realpath(target))) for line in mounts: if re.match(mountstring, line): target_unmount = True -- 2.1.4