summaryrefslogtreecommitdiffstats
path: root/libmount/src/fs.c
diff options
context:
space:
mode:
authorDave Reisner2012-03-02 04:47:00 +0100
committerKarel Zak2012-03-02 09:48:23 +0100
commitd0ce7c07e66f4e458d290083fdcf62218d151883 (patch)
tree2e3fc835ccd1edb0e218f27e6dcf839f9981b6e0 /libmount/src/fs.c
parentmountpoint: account for error from in mnt_fs_get_target (diff)
downloadkernel-qcow2-util-linux-d0ce7c07e66f4e458d290083fdcf62218d151883.tar.gz
kernel-qcow2-util-linux-d0ce7c07e66f4e458d290083fdcf62218d151883.tar.xz
kernel-qcow2-util-linux-d0ce7c07e66f4e458d290083fdcf62218d151883.zip
libmount: don't treat "none" differently
This causes more problems than it solves. In the latest edition: # mount -t proc none foo mount: foo: mount failed: Invalid argument A check for source and target fails in mnt_context_apply_fstab() because, even though they were indeed specified on the cmdline, __mnt_fs_set_source_ptr() altered this and NULL'd out the source. If you're able to mount this device via other means, other tools start reporting oddities, such as mount's output: (null) on /foo type proc (rw,relatime) or findmnt: TARGET SOURCE FSTYPE OPTIONS /foo proc rw,relatime Simply treat "none" like any other source when passed in. [kzak@redhat.com: - don't translate NULL to "none" in mnt_fs_set_source()] Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/fs.c')
-rw-r--r--libmount/src/fs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libmount/src/fs.c b/libmount/src/fs.c
index a28e66c71..5e4139c6a 100644
--- a/libmount/src/fs.c
+++ b/libmount/src/fs.c
@@ -304,11 +304,7 @@ int __mnt_fs_set_source_ptr(struct libmnt_fs *fs, char *source)
assert(fs);
- if (source && !strcmp(source, "none")) {
- free(source);
- source = NULL;
-
- } else if (source && strchr(source, '=')) {
+ if (source && strchr(source, '=')) {
if (blkid_parse_tag_string(source, &t, &v) != 0)
return -1;
}
@@ -341,6 +337,7 @@ int mnt_fs_set_source(struct libmnt_fs *fs, const char *source)
if (!fs)
return -EINVAL;
+
if (source) {
p = strdup(source);
if (!p)