diff options
author | Karel Zak | 2013-07-02 10:46:10 +0200 |
---|---|---|
committer | Karel Zak | 2013-07-02 10:46:10 +0200 |
commit | 2c6b25f01802808b142d450af3352605720899da (patch) | |
tree | 560ff39da7ebe2bd9d97549d175960f2ea33e9dc /libmount/src/fs.c | |
parent | lib/canonical: use realpath() from libc (diff) | |
download | kernel-qcow2-util-linux-2c6b25f01802808b142d450af3352605720899da.tar.gz kernel-qcow2-util-linux-2c6b25f01802808b142d450af3352605720899da.tar.xz kernel-qcow2-util-linux-2c6b25f01802808b142d450af3352605720899da.zip |
libmount: be more restrictive about valid tag names
# mount DUMMY=filename.img /mnt
The 'DUMMY=filename.img' is a filename and should not be
interpreted as tag name. The valid tag names are LABEL, UUID,
PARTLABEL and PARTUUID only.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/fs.c')
-rw-r--r-- | libmount/src/fs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libmount/src/fs.c b/libmount/src/fs.c index c95cdc7e7..75e3bbb26 100644 --- a/libmount/src/fs.c +++ b/libmount/src/fs.c @@ -318,9 +318,12 @@ int __mnt_fs_set_source_ptr(struct libmnt_fs *fs, char *source) assert(fs); - if (source && *source != '/' && strchr(source, '=')) { - if (blkid_parse_tag_string(source, &t, &v) != 0) - return -1; + if (source && blkid_parse_tag_string(source, &t, &v) == 0 && + !mnt_valid_tagname(t)) { + /* parsable but unknown tag -- ignore */ + free(t); + free(v); + t = v = NULL; } if (fs->source != source) |