summaryrefslogtreecommitdiffstats
path: root/libmount/src/utils.c
Commit message (Collapse)AuthorAgeFilesLines
...
* libmount: add a generic append_string() functionKarel Zak2013-07-021-0/+38
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: be more restrictive about valid tag namesKarel Zak2013-07-021-0/+12
| | | | | | | | | | # 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>
* libmount: fix mount.nfs segfault, rely on assert() rather than on nonnullKarel Zak2013-04-121-1/+8
| | | | | | | | | | | | | | | | | We use mnt_optstr_append_option(&o, mnt_fs_get_vfs_options(fs), NULL); in mount.nfs, unfortunately mnt_optstr_append_option() has been marked ass nonnull(1, 2). That's wrong because append and prepend should robust enough to accept NULL as option name. The patch also removes almost all __attribute__((nonnull). It seems better to rely on assert() to have usable feedback. In many cases (nonnull) is premature optimization for the library. This attribute makes sense for things like strlen() or so... Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=948274 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: use O_CLOEXECKarel Zak2013-04-031-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_table_find_mountpoint()Karel Zak2013-03-251-1/+1
| | | | | | | | This is more robust implementation of mnt_get_mountpoint() that does not ignore bind mountpoints (mount --bind /mnt /mnt) as it does not depend on st_dev numbers. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: optimize tab files parsingKarel Zak2013-02-261-0/+11
| | | | | | | - ignore empty files - ignore empty tables Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: fix two misencodings in commentsBenno Schulenberg2013-02-061-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libmount; add recursive mkdirKarel Zak2013-01-091-0/+51
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix typosKarel Zak2012-12-121-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: make mkstemp() more robust [coverity scan]Karel Zak2012-12-121-0/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't use safe_getenv() for testKarel Zak2012-12-101-1/+1
| | | | | Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: avoid endless loop in mnt_get_kernel_cmdline_optionBernhard Voelker2012-12-101-3/+1Star
| | | | | | | | | | | The above function infloops when the name to search for can only be found at the beginning of /proc/cmdline but doesn't match, e.g. when searching for "ro" in "root=/dev/sda1 quiet vga=0x31a". * libmount/src/utils.c (mnt_get_kernel_cmdline_option): Replace while by for loop to ensure the pointer p is incremented. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* libmount: clean nonnull attribute usageKarel Zak2012-12-041-11/+11
| | | | | | | | | | - use __attribute__((nonnull) for functions where we not able to return an return code ("is", "has" and some "get" functions). - use __attribute__((nonnull) for small functions where we always modify any of the function argument (some mnt_optstr_* functions) Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add function attributes to private APIOndrej Oprala2012-11-301-1/+1
| | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: correctly interpret '*' from /etc/filesystemsKarel Zak2012-11-261-5/+24
| | | | | | | | | | | - single line with '*' in /etc/filesystems means that libmount has to read /proc/filesystems, otherwise /proc/filesystems has to be ignored - mount(2) ENODEV is no reason to break the do_mount_by_pattern() loop when trying to mount by /{etc,proc}/filesystems Reported-by: NeilBrown <neilb@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add private mnt_get_kernel_cmdline_option()Karel Zak2012-11-081-0/+91
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: segfaults if neither /etc/filesystems nor/proc/filesystems existsKarel Zak2012-09-121-0/+4
| | | | | Reported-by: Juergen Daubert <jue@jue.li> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: use O_CLOEXEC everywhereKarel Zak2012-09-041-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: make some string operations more robustKarel Zak2012-06-151-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add MNT_ERR_MOUNTOPTKarel Zak2012-05-281-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: Use binary search to compare pseudofsDave Reisner2012-05-231-25/+44
| | | | | | | | | It's the responsibility of anyone adding to this list in the future to ensure that the list remains sorted. While we're at it, expand this list of known pseudofs types. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* libmount: expose mnt_get_mountpoint as external APIDave Reisner2012-04-261-0/+9
|
* libmount: add support to parse /proc/swapsKarel Zak2012-04-031-0/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add configfs to pseudofs listKarel Zak2012-03-201-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: consolidate sysconf() usageKarel Zak2012-01-311-16/+13Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix resource leak [coverity scan]Karel Zak2012-01-301-3/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix negative returns [coverity scan]Karel Zak2012-01-301-6/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix bugs detected by [smatch scan]Karel Zak2012-01-171-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add post-mount checks to detect ro/rwKarel Zak2012-01-161-0/+35
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add "+" prefix for options pattern (e.g findmnt -O)Karel Zak2011-12-011-1/+14
| | | | | | | | | | | | | | Examples: * findmnt --fstab -O noauto Returns all entries where is not "auto" option (including entries with "noauto" option. * findmnt --fstab -O +noauto Returns all entries where is literally "noauto" option. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=758457 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix compiler warning [-Wimplicit-function-declaration]Karel Zak2011-11-281-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib,match: split match_fstype() from libmountKarel Zak2011-11-151-29/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix chdir to parent for restricted (user) umountsKarel Zak2011-11-081-16/+25
| | | | | Reported-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add function to parse offsets/sizesKarel Zak2011-09-291-0/+18
|
* libmount: update list of pseudo-filesystemsKarel Zak2011-08-081-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix compiler warnings [-Wunused-parameter -Wsign-compare]Karel Zak2011-08-021-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove unnecessary includes, mask API as stableKarel Zak2011-07-251-6/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use top-level directory for libmount rather than shlibs/mountKarel Zak2011-06-091-0/+899
Signed-off-by: Karel Zak <kzak@redhat.com>