This function was never implemented, but the proto has existed since the
inception of the library. As the libmnt_table struct doesn't include a
member necessary to carry the name of the table, simply discard this
prototype. If ever a need to break ABI comes up, perhaps this could be
revisited.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This patch add a new flag MNT_NOHLPS for mount options map, options
with this flag will not be passed to /sbin/mount.<type> helpers.
Signed-off-by: Karel Zak <kzak@redhat.com>
Why?
* read-only root
* /etc is pretty bad place for caches
* all is usually cached by udev in /dev/disk/by-* and libblkid
is able to use these symlinks
* boot persistent cache is attractive for very small subset of
Linux machines (and they already need extra udev tunning otherwise
udev will probe all block devices during boot)
* the default is possible to override in /etc/blkid.conf
The systems without /run directory will not be affected by this
change.
Signed-off-by: Karel Zak <kzak@redhat.com>
If you really need to store your configuration to a alternative files
then you have to explicitly specify the files or directories on
mount(8) command line by --fstab option.
Signed-off-by: Karel Zak <kzak@redhat.com>
mnt_table_parse_dir in libmount/src/tab_parse.c calls
scandir, and then opendir. When the latter one, opendir is failed,
buffers allocated in scandir are not released.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
This patch is based on my last patch:
[PATCH 1/2] scandirat based mnt_table_parse_dir implementation
scandir* used in `mnt_table_parse_dir in libmount/src/tab_parse.c
can take filter function as an argument.
`mnt_table_parse_dir' picks up fstab files from namelist returned from
scandir* for itself. However, some parts of picking-up job can be done
in the filter function.
This patch introduces a new function `mnt_table_parse_dir_filter' to
share the code for picking-up job between two implementations of
`mnt_table_parse_dir_filter', scandir based and scandirat based.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
In comment of `mnt_table_parse_dir' of libmount/src/tab_parse.c:
/* TODO: it would be nice to have a scandir() implementation that
* is able to use already opened directory */
Nowadays glibc provides `scandirat'. This patch implements `scandirat'
based `mnt_table_parse_dir'.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Now we have three versions of the mount(8) utility
* old mount(8)
--enable-mount [default]
* old mount(8) linked with libmount
This is this is necessary for systems without mtab file.
--enable-libmount-mount
- new mount(8)
This is completely new pure-libmount based mount(8).
--enable-new-mount
Signed-off-by: Karel Zak <kzak@redhat.com>
Similar to the previous commit, when mounting a pseudofs, trust the
source of the fs, as it cannot be matched to backing device on the
filesystem.
Similar situation, but slightly different bug:
# mkdir /foo /root/foo
# echo 'foo /foo tmpfs defaults 0 0' >> /etc/fstab
# cd /root
# mount -a
# mount | grep /foo
/root/foo on /foo type tmpfs (rw,relatime)
This fixes the pure libmount based mount utility, but the legacy mount
tool will still fail to handle this properly.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
Since nodev FSs have no backing block device, it's unreasonable to try
and resolve the source back to a path on the filesystem. Always trust
the source of the FS given in /etc/fstab to avoid remounting the device
when a directory of the same name exists in the current working
directory.
Example reproduction:
# mkdir /foo
# echo 'foo /foo tmpfs defaults 0 0' >> /etc/fstab
# mount -a
# cd /root; mkdir foo
# mount -a
# mount | grep /foo
foo on /foo type tmpfs (rw,relatime)
/root/foo on /foo type tmpfs (rw,relatime)
[kzak@redhat.com: - use fs->flags to detect pseudo FS]
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
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>
Without the check libmount builds on systems that has older than 2.7
glibc are silently unsuccessful. The missing %ms modifier will, at
least, result on such system missing output of findmnt and lsblk
commands. If either %ms or %as modifiers are present the libmount
build is disabled.
Based on patch from: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'docs-dir' of https://github.com/kerolasa/lelux-utiliteetit:
docs: remove duplicated text
docs: require kernel support before accepting use of it
docs: note about independent super block structs
docs: add libmount & libblkid debug instructions
Documentation: add debugging doc
arch: start using arch as a usage() example
docs: new file Documentation/release-schedule.txt
docs: move setuid information from reame to hwclock.8
docs: clean up old readme files
docs: copy contributors from legacy files to AUTHORS
docs: new file Documentation/howto-man-page.txt
docs: new file Documentation/source-code-management.txt
docs: new file Documentation/howto-contribute.txt
docs: new file Documentation/howto-compilation.txt
docs: tell what the Documentation/ is about
docs: add usage() howto for contributors
docs: Documentation directory added
docs: remove README.clear
Duplicate text is dealt by referring to license files. The `pg'
command does not need separated license file because the source
file has same text at top of it.
http://www.spinics.net/lists/util-linux-ng/msg05069.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Move readme, licence, change log, relese notes and other
supplementary files to a Documentation directory. This commit
does not change contents of any other but few Makefile.am files.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The path resolving function breaks when handling undefined sources
("none") used by pseudo-filesystems. The assertion is causing the
samples/mount program to abort:
dave@offbook:~/projects/util-linux-good/libmount/samples$ ./mount
/dev/sda3 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
lt-mount: cache.c:464: mnt_resolve_path: Assertion `path' failed.
Aborted
/etc/mtab:
/dev/sda3 / ext4 rw,errors=remount-ro,commit=0 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
none /sys sysfs rw,noexec,nosuid,nodev 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
...
Instead of this assert on NULL we can simply return NULL and let mnt_pretty_path do the work.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
tab_parse.c:mnt_parse_mountinfo_line parses "none" in src as NULL,
tab_update.c:fprintf_mtab_fs sets m1 to NULL instead of "none" and
returns -ENOMEM
tab_update.c:update_table says "write entry failed: Success", as errno
hasn't been set, and gotos to leave, leaving mtab not updated.
Addresses-debian-bug: 634871
Reported-by: Tomas Janousek <tomi@nomi.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
This is libmount based re-implementation of the mountpoint(1) command.
The original implementation is maintained in sysvinit suite.
The mountpoint(1) in util-linux is not enabled by default (for now) --
use --enable-mountpoint to enable the util.
Signed-off-by: Karel Zak <kzak@redhat.com>