summaryrefslogtreecommitdiffstats
path: root/libmount
Commit message (Collapse)AuthorAgeFilesLines
* libmount: special treatment for auto in fstype patternKarel Zak2014-06-233-28/+61
| | | | | | | | | | Let's support mount -t ext2,auto /dev/sde /media/stick Reported-by: Andreas Henriksson <andreas@fatal.se> Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506695 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't touch mtab when mount -n specifiedKarel Zak2014-06-174-16/+73
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1109367 Signed-off-by: Karel Zak <kzak@redhat.com>
* Only move shared libraries to /lib if they existsThomas Petazzoni2014-06-161-1/+1
| | | | | | | | | | | | | | | | | | In several Makemodule.am, there is a install-exec-hook-<library> target whose role is to move the shared library from /usr/lib to /lib, while keeping a symbolic link /usr/lib/libuuid.so -> ../../lib/<library>.so.<version>. However, when util-linux is built with --enable-static --disable-shared (as is needed on noMMU platforms that don't support shared libraries), no <library>.so is built, but the install-exec-hook-libuuid creates an invalid /usr/lib/<library>.so symbolic link, pointing to ../../lib (yes, the directory). This causes troubles later one when other libraries/programs are compiled with -l<library>, as gcc thinks a shared library is available because there's a file named /usr/lib/<library>.so. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* lib/fileutils: add stripoff_last_component() from libmountKarel Zak2014-06-093-16/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/fileutils: add mkdir_p() from libmountKarel Zak2014-06-092-37/+2Star
|
* docs: fix "behaviour" vs. "behavior"Karel Zak2014-06-061-2/+2
| | | | | | | | Sometimes we use "behaviour" and "behavior" in the same text, let's use "behavior" only everywhere. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1011068 Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: fix python tests for dist and out-of-tree buildsRuediger Meier2014-06-041-0/+4
| | | | | | | | | - add python helper scripts to the dist - helper scripts are always in srcdir - python libs are in builddir - abort tests if helpers are missing Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: use automake's PYTHON primary for __init__.pyRuediger Meier2014-06-031-3/+1Star
| | | | | | | | | | Actually the initial reason for this commit was to remove execute permission from installed __init__.py. Now after discovering automake's _PYTHON suffix we slightly cleanup Makemodule.am and we will install byte compiled .pyc and .pyo files. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* docs: rename libs xml/version.xml to xml/version-utils.xmlKarel Zak2014-06-033-3/+3
| | | | | | | It seems that gtk-docs stuff is confused when we use version.xml (package version) and xml/version.xml (library version functions). Signed-off-by: Karel Zak <kzak@redhat.com>
* 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>