1
0
forked from pool/util-linux
util-linux/util-linux-2.19-rc1-loop-offset.diff

43 lines
1.3 KiB
Diff

From e31694761ca0165bda8a4b8f4b3bdbac548ba464 Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Fri, 21 Jan 2011 11:56:52 +0100
Subject: [PATCH] fix parsing offset= followed by more options
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
---
mount/mount.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
Index: util-linux-2.19-rc1/mount/mount.c
===================================================================
--- util-linux-2.19-rc1.orig/mount/mount.c
+++ util-linux-2.19-rc1/mount/mount.c
@@ -2044,12 +2044,21 @@ is_fstab_entry_mounted(struct mntentchn
char *p = strstr(mc->m.mnt_opts, "offset=");
uintmax_t offset = 0;
- if (p && strtosize(p + 7, &offset) != 0) {
- if (verbose)
- printf(_("mount: ignore %s "
- "(unparsable offset= option)\n"),
- mc->m.mnt_fsname);
- return -1;
+ if (p) {
+ char buf[128];
+ buf[0] = 0;
+ strncat(buf, p+7, sizeof(buf)-1);
+
+ if (p = strchr(buf, ','))
+ *p = '\0';
+
+ if (strtosize(buf, &offset) != 0) {
+ if (verbose)
+ printf(_("mount: ignore %s "
+ "(unparsable offset= option)\n"),
+ mc->m.mnt_fsname);
+ return -1;
+ }
}
if (is_mounted_same_loopfile(mc->m.mnt_dir, mc->m.mnt_fsname, offset))
goto yes;