summaryrefslogtreecommitdiffstats
path: root/libmount/src/context_mount.c
diff options
context:
space:
mode:
authorKarel Zak2012-02-28 00:02:30 +0100
committerKarel Zak2012-02-28 00:02:30 +0100
commit772cce373f693096c2ae6f156306acf9e20c09e8 (patch)
tree10717529b89a18bcafa4f9b6ea64ad21a7d11393 /libmount/src/context_mount.c
parentlibmount: use mount.<type> -s for NFS only (diff)
downloadkernel-qcow2-util-linux-772cce373f693096c2ae6f156306acf9e20c09e8.tar.gz
kernel-qcow2-util-linux-772cce373f693096c2ae6f156306acf9e20c09e8.tar.xz
kernel-qcow2-util-linux-772cce373f693096c2ae6f156306acf9e20c09e8.zip
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>
Diffstat (limited to 'libmount/src/context_mount.c')
-rw-r--r--libmount/src/context_mount.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index a0c5951c1..098243b72 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);