diff options
author | Karel Zak | 2013-05-30 13:29:34 +0200 |
---|---|---|
committer | Karel Zak | 2013-05-30 13:29:34 +0200 |
commit | 8225bb78a631d032121f9d7eed19481220933c88 (patch) | |
tree | 38b2f12002f57bac819e61c7b7c7415d22ad2734 /sys-utils/mount.c | |
parent | su: ignore --preserve-environment, it's mutually exclusive to --login (diff) | |
download | kernel-qcow2-util-linux-8225bb78a631d032121f9d7eed19481220933c88.tar.gz kernel-qcow2-util-linux-8225bb78a631d032121f9d7eed19481220933c88.tar.xz kernel-qcow2-util-linux-8225bb78a631d032121f9d7eed19481220933c88.zip |
libmount: more robust options string parsing
# mount -o=rw /dev/sdb /mnt/test
mount: libmount/src/optmap.c:212: mnt_optmap_get_entry: Assertion `namelen' failed.
Aborted (core dumped)
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=968786
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/mount.c')
-rw-r--r-- | sys-utils/mount.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 8ff94611c..0998b0110 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -682,6 +682,8 @@ static void sanitize_paths(struct libmnt_context *cxt) static void append_option(struct libmnt_context *cxt, const char *opt) { + if (opt && (*opt == '=' || *opt == '\'' || *opt == '\"' || isblank(*opt))) + errx(MOUNT_EX_USAGE, _("unsupported option format: %s"), opt); if (mnt_context_append_options(cxt, opt)) err(MOUNT_EX_SYSERR, _("failed to append option '%s'"), opt); } |