summaryrefslogtreecommitdiffstats
path: root/libmount
Commit message (Collapse)AuthorAgeFilesLines
* build-sys: fix .h.in usage in libblkid and libmountKarel Zak2014-04-071-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: apply "nofail" to MNT_ERR_NOSOURCE libmount errorKarel Zak2014-04-071-0/+5
| | | | | | | | | | | | | fstab: UUID=nonexist /mnt/nonexist1 ext4 nofail 0 1 # mount -av mount: can't find UUID=nonexist .. this is bug of course. Reported-by: Patrick McLean <chutzpah@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: silence some docs warningsOndrej Oprala2014-03-282-2/+2
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* Merge branch 'master' of https://github.com/rudimeier/util-linuxKarel Zak2014-03-211-2/+1Star
|\ | | | | | | | | | | | | | | * 'master' of https://github.com/rudimeier/util-linux: tests: try hard to create swaplabel's test image build-sys: libmount/python/__init__.py is always a dist file tests: return error if failures file not usable tests: write tests/failures to build- instead of srcdir
| * build-sys: libmount/python/__init__.py is always a dist fileRuediger Meier2014-03-131-2/+1Star
| | | | | | | | | | | | | | "make dist" and "make distcheck" should work after a bare ./configure to give us a full featured tar ball. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | libmount: use new debug functionsKarel Zak2014-03-2116-348/+291Star
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | clean up redundant macros and definesOndrej Oprala2014-03-133-12/+2Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | libmount: further debug.h integrationOndrej Oprala2014-03-132-15/+6Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | libmount: use macros from include/debug.hOndrej Oprala2014-03-122-8/+5Star
|/ | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* build-sys: sort gitignore filesSami Kerola2014-03-121-8/+8
| | | | | | Use 'LC_ALL=C sort -fu' order for all lists. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount: add statfs_magic.hKarel Zak2014-03-061-74/+74
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: define BTRFS_TEST_MAGIC if missingBernhard Voelker2014-03-051-0/+3
| | | | | | | * libmount/src/utils.c (BTRFS_TEST_MAGIC): Conditionally add define which is used since commit v2.24-243-g6a52473. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* build-sys: don't connect _DEPENDENCIES and _LIBADDKarel Zak2014-03-051-1/+2
| | | | | | | | | The _DEPENDENCIES has to be used for dependencies on another in-tree files, but _LIBADD is to specify additional libs (including external libs). Reported-by: oleid <notifications@github.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cgroup magic already definedKarel Zak2014-03-031-3/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: don't use mountinfo if possibleKarel Zak2014-03-035-31/+242
| | | | | | | | | | | | | | | | | | | | | | | | The umount(8) always parses /proc/self/mountinfo to get fstype and to merge kernel mount options with userspace mount options from /run/mount/utab. This behavior is overkill in many cases and it's pretty expensive as kernel has to always compose *whole* mountinfo. This performance disadvantage is visible for crazy use-cases with huge number of mountpoints and frequently called umount(8). It seems that we can bypass /proc/self/mountinfo by statfs() to get filesystem type (statfs.f_type magic) and analyze /run/mount/utab before we parse mountinfo. This optimization is not used when: * umount(8) executed by non-root (as user= in utab is expected) * umount --lazy / --force (target is probably unreachable NFS, then use statfs() is pretty bad idea) * target is not a directory (e.g. umount /dev/sda1) * there is (deprecated) writeable mtab Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: FS id and parent ID could be zeroKarel Zak2014-02-201-8/+4Star
| | | | | | | | | | It seems that linux 3.14 is able to produce things like: 19 0 8:3 / / rw,relatime - ext4 /dev/sda3 rw,data=ordered ^ Reported-by: Mantas Mikulėnas <grawity@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: initialize *root to NULL in mnt_table_get_root_fsThomas Bächler2014-02-171-0/+2
| | | | | | | | mnt_table_get_root_fs only works when *root is set to NULL. This is not only undocumented, but also unintuitive. Fix it by initializing *root inside mnt_table_get_root_fs. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: make the mountinfo parser more robustKarel Zak2014-02-171-10/+11
| | | | | | ... sorry, the previous change to the parser was too stupid. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: accept (deleted) path suffix in mountinfo fileKarel Zak2014-02-171-0/+10
| | | | | Addresses: debian bug #711183 Signed-off-by: Karel Zak <kzak@redhat.com>
* include/c.h: prefer nanosleep() over usleep()Karel Zak2014-01-241-2/+2
| | | | | | | | | | | | | | Let's use nanosleep() although if usleep() exists. The nanosleep function does no interact with signals and other timers. The patch introduces xusleep() as replacement to libc (or our fallback) usleep(). Yes, we don't want to use struct timespec + nanosleep() everywhere in code as nano-time resolution is useless for us. The patch also enlarges delays in some busy wait loops. It seems enough to try read/write 4x per second. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix scanf format string [coverity scan]Karel Zak2014-01-141-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: import directly from pylibmount in testsKarel Zak2014-01-143-3/+9
| | | | | | | This change does not have any impact to in a standard way installed libmount impact. It's simplification for in-tree tests. Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: remove unncessary subdirectoryKarel Zak2014-01-142-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_table_uniq_fs()Karel Zak2013-12-114-14/+158
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add efivarfs to the list of pseudo filesystemsKarel Zak2013-12-101-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: correctly import from pylibmount.soDave Reisner2013-12-021-1/+1
| | | | | | | | | | | | | Without this, python is unable to find the module: $ python -c 'import libmount' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.3/site-packages/libmount/__init__.py", line 1, in <module> from pylibmount import * ImportError: No module named 'pylibmount' Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* libmount: add mnt_tag_is_valid()Karel Zak2013-11-194-0/+23
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup fix_optstr() regards to selinux and smackKarel Zak2013-11-121-19/+47
| | | | | | | It's better (more robust) to make the code based on datetypes rather than on if(strcmp(...)). Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix typo in smack pathKarel Zak2013-11-121-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove smackfs* option when SMACK not enabledKarel Zak2013-11-121-0/+22
| | | | | | | | | | If there is no /sys/fs/smackfs then libmount removes smackfs*= mount options when compiled --with-smack. Note that we do the same for SELinux. References: http://www.mail-archive.com/systemd-devel@lists.freedesktop.org/msg13740.html Signed-off-by: Karel Zak <kzak@redhat.com>
* strutils: add skip_space() functionOndrej Oprala2013-11-081-13/+4Star
| | | | | | | | [kzak@redhat.com: - add also skip_blank(), - remove duplicate implementation from libmount] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: update utab after successful extern helper mountKarel Zak2013-11-043-10/+84
| | | | | | | | | | | | | | | This patch allows to maintain private utab libmount file also for external mount/umount helpers that are not linked with libmount. The libmount check if utab has been updated after successful extern helper execution (status=0). If not then the file is updated. This patch affects only 'user' fstab mount option. So, for example with suid mount.cifs you can use: //server/foo /mnt cifs username=foo,noauto,user Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: allow to use -s (sloppy) for all external helpersKarel Zak2013-11-041-6/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix mnt_context_is_child() commentKarel Zak2013-10-111-1/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: Fix typo in commentNamhyung Kim2013-10-111-2/+2
| | | | | | s/MNT_OMASK_/MNT_OMODE_/ Signed-off-by: Namhyung Kim <namhyung@gmail.com>
* various: fix mixing declarations and code compiler warnings [smatch]Sami Kerola2013-10-082-2/+4
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* COPYING: fix grammar of referring phrase, and indicate location betterBenno Schulenberg2013-10-081-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libmount: remove dead code [coverity scan]Karel Zak2013-10-011-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: check for mnt_fs_get_tag() return value [coverity scan]Karel Zak2013-10-011-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: make tab parsers more robust [coverity scan]Karel Zak2013-10-011-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: make mnt_table_replace_file() more robust [coverity scan]Karel Zak2013-10-011-1/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: Save errno if mkostemp() failedNamhyung Kim2013-09-301-1/+3
| | | | | | | | After mkostemp() failed, umask() and free() might alter the errno to another value. Not sure those calls really changes the errno or not. But let's be more conservative. Signed-off-by: Namhyung Kim <namhyung@gmail.com>
* build-sys: one install dir for all pylibmount stuffKarel Zak2013-09-271-4/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: update docsKarel Zak2013-09-274-7/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: small cleanup in umount codeKarel Zak2013-09-272-3/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: compose mount.<type> helpers paths more carefullyKarel Zak2013-09-261-0/+1
| | | | | | | | | | | | | | | | | | | | The [u]mount helper path is "/sbin/mount.<type>", the <type> should not be possible to interpret like a path, for example: # mkdir /sbin/mount.fake # mount -t fake/../../../home/user/foo.sh Anyway, this is *not mount(8) security issue*, because: - non-root users don't have permissions to specify -t on mount(8) command line - /sbin is not writable for regular users This patch makes libmount more robust for situations when the library is used by incompetent developers who don't sanitize user's input. Reported-by: "Horsfall, Matthew" <mhorsfal@akamai.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add pylibmount __init__.py EXTRA_DISTKarel Zak2013-09-261-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: install to the correct python dirsKarel Zak2013-09-261-1/+3
| | | | | | | It seems we have to call AM_PATH_PYTHON() monster to get pyexec (shared libs) and python (scripts) directories. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: make mnt_fs_{ap,pre}pend_options() more robustKarel Zak2013-09-261-0/+6
| | | | | | | We should not use the results from mnt_split_optstr() if the function failed. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: Remove stale comment on mnt_context_mount()Namhyung Kim2013-09-261-5/+0Star
| | | | | | | The commit f9906424 ("libmount: add post-mount checks to detect ro/rw") added necessary check so the comment is not valid anymore. Signed-off-by: Namhyung Kim <namhyung@gmail.com>