diff options
author | root <root@rshg054.dnsready.net> | 2012-03-02 00:01:28 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-03-02 00:01:28 +0000 |
commit | 9ff97db6951550a28a70b27491a446da9d736176 (patch) | |
tree | 482d46078cf0367200908e8e26bb335e54429b5b /testing/util-linux/libmount-allow-empty-source-for-mount-2-syscall.patch | |
parent | 6f297b1cf462a11227d811a87124006c55911d63 (diff) |
Fri Mar 2 00:01:27 UTC 2012
Diffstat (limited to 'testing/util-linux/libmount-allow-empty-source-for-mount-2-syscall.patch')
-rw-r--r-- | testing/util-linux/libmount-allow-empty-source-for-mount-2-syscall.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/util-linux/libmount-allow-empty-source-for-mount-2-syscall.patch b/testing/util-linux/libmount-allow-empty-source-for-mount-2-syscall.patch new file mode 100644 index 000000000..97f5dc925 --- /dev/null +++ b/testing/util-linux/libmount-allow-empty-source-for-mount-2-syscall.patch @@ -0,0 +1,48 @@ +From 772cce373f693096c2ae6f156306acf9e20c09e8 Mon Sep 17 00:00:00 2001 +From: Karel Zak <kzak@redhat.com> +Date: Tue, 28 Feb 2012 00:02:30 +0100 +Subject: [PATCH] libmount: allow empty source for mount(2) syscall + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797438 +Signed-off-by: Karel Zak <kzak@redhat.com> +--- + libmount/src/context_mount.c | 4 +++- + sys-utils/mount.c | 6 +++++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c +index a0c5951..098243b 100644 +--- a/libmount/src/context_mount.c ++++ b/libmount/src/context_mount.c +@@ -451,8 +451,10 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type) + src = mnt_fs_get_srcpath(cxt->fs); + target = mnt_fs_get_target(cxt->fs); + +- if (!src || !target) ++ if (!target) + return -EINVAL; ++ if (!src) ++ src = "none"; + + type = try_type ? : mnt_fs_get_fstype(cxt->fs); + +diff --git a/sys-utils/mount.c b/sys-utils/mount.c +index 3fbac04..23abc91 100644 +--- a/sys-utils/mount.c ++++ b/sys-utils/mount.c +@@ -347,7 +347,11 @@ try_readonly: + return MOUNT_EX_USAGE; + } + +- if (src == NULL || tgt == NULL) { ++ /* ++ * TODO: add mnt_context_fstab_applied() to check if we found ++ * target/source in the file. ++ */ ++ if (!tgt) { + if (mflags & MS_REMOUNT) + warnx(_("%s not mounted"), src ? src : tgt); + else +-- +1.7.9.2 + |