summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mount/Makefile.am2
-rw-r--r--mount/umount.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/mount/Makefile.am b/mount/Makefile.am
index 83e1fcdd8..235cceb06 100644
--- a/mount/Makefile.am
+++ b/mount/Makefile.am
@@ -33,7 +33,7 @@ mount_CFLAGS = $(SUID_CFLAGS) $(cflags_common)
mount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
mount_LDADD = $(ldadd_common)
-umount_SOURCES = umount.c $(srcs_mount)
+umount_SOURCES = umount.c $(srcs_mount) $(top_srcdir)/lib/strtosize.c
umount_CFLAGS = $(SUID_CFLAGS) $(cflags_common)
umount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
umount_LDADD = $(ldadd_common)
diff --git a/mount/umount.c b/mount/umount.c
index 0ad7c5f98..49741a519 100644
--- a/mount/umount.c
+++ b/mount/umount.c
@@ -20,6 +20,7 @@
#include "fstab.h"
#include "env.h"
#include "nls.h"
+#include "strtosize.h"
#if defined(MNT_FORCE)
/* Interesting ... it seems libc knows about MNT_FORCE and presumably
@@ -463,7 +464,7 @@ get_value(const char *list, const char *s) {
static int
is_valid_loop(struct mntentchn *mc, struct mntentchn *fs)
{
- unsigned long long offset = 0;
+ uintmax_t offset = 0;
char *p;
/* check if it begins with /dev/loop */
@@ -477,8 +478,11 @@ is_valid_loop(struct mntentchn *mc, struct mntentchn *fs)
/* check for offset option in fstab */
p = get_value(fs->m.mnt_opts, "offset=");
- if (p)
- offset = strtoull(p, NULL, 10);
+ if (p && strtosize(p, &offset)) {
+ if (verbose > 1)
+ printf(_("failed to parse 'offset=%s' options\n"), p);
+ return 0;
+ }
/* check association */
if (loopfile_used_with((char *) mc->m.mnt_fsname,