Commit Graph

63 Commits

Author SHA1 Message Date
Roberto Bergantinos Corpas ff21f476f8 findmnt: add option to list all fs-independent flags
It might be useful for security auditing purposes list all possible
mount flags/options including default set which are normally not listed.

This patch adds "--vfs-all" option to list all fs-independent flags
on VFS-OPTIONS column, as well as libmount funcionality to accomplish
it.

i.e.:

$ findmnt -o VFS-OPTIONS
VFS-OPTIONS
rw,relatime
rw,nosuid,nodev,noexec,relatime
rw,nosuid,nodev,noexec,relatime
ro,nosuid,nodev,noexec
...

$ findmnt --vfs-all -o VFS-OPTIONS
VFS-OPTIONS
rw,exec,suid,dev,async,loud,nomand,atime,noiversion,diratime,relatime,nostrictatime,nolazytime,symfollow
rw,noexec,nosuid,nodev,async,loud,nomand,atime,noiversion,diratime,relatime,nostrictatime,nolazytime,symfollow
rw,noexec,nosuid,nodev,async,loud,nomand,atime,noiversion,diratime,relatime,nostrictatime,nolazytime,symfollow
ro,noexec,nosuid,nodev,async,loud,nomand,atime,noiversion,diratime,norelatime,nostrictatime,nolazytime,symfollow
...

[kzak@redhat.com: - cleanup coding style and comments]

Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-15 17:51:07 +01:00
Karel Zak 58b510e580 libsmartcols: sanitize variable names on export output
The shells are very restrictive about variable names, only [:alnum:]
chars are allowed (and alphabetic chars as the first char).  The
library will replace "bad" chars with "_". The char '%' at the end is
replaced by _PCT.

Addresses: https://github.com/karelzak/util-linux/issues/1201
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-12-03 12:14:10 +01:00
Bjarni Ingi Gislason ed554da252 docs: misc-utils: change "allows to <verb>" to "allows <verb>ing"
The web site "lintian.debian.org" shows some examples of "allows to",
which are changed to "allows one to".

  I chose here to use gerund.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-07-14 10:37:54 +02:00
Michael Kerrisk (man-pages) 67e63c1263 Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the NOTES, HISTORY, BUGS, and EXAMPLE
sections are always placed near the end of the page, just above
AUTHORS, COPYRIGHT, SEE ALSO, and AVAILABILITY.

One page is not fixed by this patch: term-utils/agetty.8. This page
is a mess of unusual section names, and probably requires an individual
edit.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-22 10:25:50 +02:00
Michael Kerrisk (man-pages) bc281b0991 Manual pages: Standardize on EXAMPLE as section title
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have EXAMPLE (10) or EXAMPLES (23).
Let's standardize on the EXAMPLE (which is also what is
suggested in man-pages(7)) and used consistently across
a large number of pages in the Linux man-pages project.

(I realize the choice to go EXAMPLE, rather than EXAMPLES,
may be debatable. If necessary, I'd write a patch that instead
goes the other way, but I'd prefer to follow man-pages(7).)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:12 +02:00
Bjarni Ingi Gislason eb02489380 man pages: Add a comma after "e.g." and "i.e."
Add a comma (,) after "e.g." and "i.e.", or use English words
(man-pages(7) [package "manpages"]).

  Abbreviation points should be protected (usually with the
non-printing, zero width character '\&') from being interpreted as an
end of sentence, if they are not, and that independent of their current
place on the line.

  This is important when typing, as one does not usually know in
advance when the editor jumps to a new line.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2019-12-17 12:32:43 +01:00
Bjarni Ingi Gislason 0bb7e904d7 man: Use the correct macro for a font change of one argument
Use the correct macro (I, B) for the font change of one argument, not
those that are used for alternating two fonts, like "BR", "IR", "RB",
or "RI".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-05-23 10:43:27 +02:00
sluidfoe 0bff4e134e misc-utils/findmnt.8: add --pseudo and --real options 2018-05-10 11:58:31 -05:00
Sami Kerola 00147883de
findmnt: add --output-all option
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-05-03 19:56:20 +01:00
Jakub Wilk f04c77f0a3 findmnt.8: remove spurious spaces before "--tree" and "--verbose"
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2018-02-04 19:31:17 +01:00
Sébastien Helleu d673b74e9d docs: replace FTP by HTTPS in kernel.org URLs
The links to ftp://ftp.kernel.org/ are replaced by
https://www.kernel.org/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 11:22:26 +01:00
Karel Zak 3ebe5477db findmnt: add --tree to allow to enable tree output for --mtab
The --mtab output is merge from kernel and utab on all modern systems
(without classic /etc/mtab). It means we have all necessary information
to generate tree output.

For the backward compatibility --mtab is the list by default, the new
option --tree allows to override the default and enable tree always
when the table contains child-parent relations.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-08 14:24:41 +01:00
Karel Zak de22cb2b12 findmnt: add note about mount options
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-08 14:11:02 +01:00
Michael Kerrisk (man-pages) b2cc2a7fc6 Fix formatting errors in page cross references
These pages had errors such as

    .BR page (x) .

which should be

    .BR page (x).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) f053ff1e3a Place SEE ALSO entries in order
This patch does only the following:

* Order SEE ALSO entries first by section name, then alphabetically
  within section
* Adds one or two missing commas in SEE ALSO lists
* Removes one or two periods that were (inconsistently) used
  at the end of SEE ALSO lists.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Karel Zak 302419e8da findmnt: (verify) add docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 13:21:02 +02:00
Karel Zak 37948503c9 libsmartcols: support LIBSMARTCOLS_DEBUG_PADDING=on
This env.variable forces libsmartcols to use visible padding chars.
The standard debug has to be enabled (to minimize overhead for
non-debug execution).

For example:

 $ LIBSMARTCOLS_DEBUG=all LIBSMARTCOLS_DEBUG_PADDING=on findmnt 2> ~/log

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-07 12:25:06 +02:00
Sebastian Rasmussen d35df4db5b docs: Fix various typos
Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
2016-05-31 23:40:21 +02:00
Benno Schulenberg c00043e542 findmnt: improve formatting and wording of the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-09 12:09:27 +01:00
Frederick Grose 8fef799d8b Fix typos in --target 2015-08-14 09:37:07 -04:00
Karel Zak 8449f2cb59 findmnt: add --json
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-05 09:47:59 +02:00
Karel Zak 0009f510cb findmnt: add --mountpoint command line option
The current --target <path> implementation check the <path> elements in
reverse order to get the mountpoint. The feature may be inwanted in
some cases when we really want to check for mountpoint specified by
the <path>. The new option "--mountpoint <path>" allows to be strict.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-19 12:12:21 +01:00
Karel Zak cd41b385a0 findmnt: don't rely on st_dev for --target
The overlay filesystem does not provide usable st_dev (in traditional
UNIX way). It's necessary to search in /proc/self/mountinfo to detect
which path element is mountpoint.

$ findmnt --target /mnt/merged/dir-a/foo
TARGET      SOURCE  FSTYPE  OPTIONS
/mnt/merged overlay overlay rw,relatime,lowerdir=/mnt/low,upperdir=/mnt/high/data,workdir=/mnt/high/work

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-10 12:51:44 +01:00
J William Piggott b06c1ca6f8 docs: restore minus symbols in long opts
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-20 18:15:30 -05:00
Benno Schulenberg 3a60b1c26b docs: remove obsolete and unneeded comments from man-page files
Transform some of them into copyright lines.
Also fix three header lines and snip some trailing whitespace.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-12 11:03:26 +01:00
Benno Schulenberg f49ccec212 docs: don't use bold or italics for "[option]" in synopsis of man pages
As per the convention shown in Documentation/howto-man-page.txt.
Also make a few other tiny adjustments along the way.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:23 +01:00
Karel Zak 68e422ecae docs: update info about env debug variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:13:54 +01:00
Bernhard Voelker 169b85c9f2 findmnt: document --uniq option in man page
* misc-utils/findmnt.8: Add an entry for the -U, --uniq option
added in commit v2.24-132-gbebdda3.
2014-10-31 10:39:21 +01:00
Benno Schulenberg 9421a1a3b3 findmnt: slightly improve wording and formatting in man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-30 10:22:07 +02:00
Karel Zak 097e7f2ff4 findmnt: add --nocanonicalize to avoid realpath()
* in some cases is realpath() overkill
 * sometimes you want to search for explicitly specified paths (e.g.
   "findmnt --fstab /mnt/symlink") rather than for real paths
 * you want to avoid readlink() and stat() on NFS

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-16 15:47:50 +02:00
Karel Zak 2b6759df0c findmnt: add --bytes to print sizes in bytes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-02-21 12:27:58 +01:00
Benno Schulenberg b4362b6f84 docs: standardize the phrases for --help and --version in all man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-15 10:28:30 +02:00
Benno Schulenberg 4b44c245dd docs: normalize formatting of findmnt man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-20 14:08:03 +01:00
Benno Schulenberg 469202cdc3 docs: sort the options in findmnt man page alphabetically
Also improve wording and formatting a bit.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-20 14:08:03 +01:00
Benno Schulenberg 3768420374 docs: improve grammar and formatting of explanation of "-o +list"
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-03-04 12:33:25 +01:00
Karel Zak 36fb10074c docs: add missing information about -o +<list>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-18 13:30:00 +01:00
Bernhard Voelker c370688f62 findmnt: fix typo in manpage
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-07-09 17:10:05 +02:00
Karel Zak c7fcc8307d findmnt: add --task <tid> option
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-28 13:51:34 +02:00
Karel Zak aca72ac2f9 findmnt: don't use tree-like output if more -F options specified
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-28 13:20:31 +02:00
Karel Zak 4644638fe8 findmnt: add note about \x<hex> to man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-26 09:19:07 +02:00
Karel Zak cd49218679 findmnt: add support for maj:min source
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-25 09:51:26 +02:00
Karel Zak 090b5e84b2 findmnt: add support for PARTUUID= and PARTLABEL=
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-19 14:38:53 +02:00
Karel Zak cd4ed46f98 findmnt: improve --df output
* don't print pseudo-filesystems (except tmpfs)
 * add --all to disable built-in filters
 * don't overwrite --df --output=<list> with default columns

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 10:52:13 +01:00
Dave Reisner eda399b995 findmnt: add -D, --df option to imitate df(1)
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-20 09:53:47 +01:00
Dave Reisner a85ef33b16 findmnt: add FS size, avail, used, and use% columns
Provide display of filesystem attributes from statvfs(3). These are all
displayed in human readable format.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-20 09:53:41 +01:00
Bill Pemberton 27b35a6d55 findmnt: add -P, --pairs to the man page
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
2012-03-20 09:30:21 +01:00
Karel Zak 9354fea342 libmount: remove fstab.d support
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>
2012-01-24 11:16:53 +01:00
Karel Zak c0d2c6e11c findmnt: add note about LIBMOUNT_* env.variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-20 12:47:15 +01:00
Karel Zak 2f1ac44b4b findmnt: revert --fstab behavior, add --tab-file option
The optional argument for -s, --fstab options (--fstab=file) is not
backwardly compatible, because command line with short options (e.g.
findmnt -snr) will be interpreted incorrectly.

This patch removes support for the optional --fstab argument and
introduces a new option --tab-file, for example:

	findmnt --fstab --tab-file=/etc/fstab.foo

Reported-by: Juergen Daubert <jue@jue.li>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-20 12:15:37 +01:00
Dave Reisner d466c6a1fe findmnt: support alternative location of fstab
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-12-16 11:29:39 +01:00