Commit Graph

11037 Commits

Author SHA1 Message Date
Karel Zak e213a8e5a3 libfdisk: (sun) use self_label()
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-05 12:36:08 +01:00
Karel Zak 1f408f0220 libsmartcols: unused parameter [-Wunused-parameter]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-05 12:31:26 +01:00
Karel Zak 59dee89d5b libuuid: unused parameter [-Wunused-parameter]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-05 12:04:22 +01:00
Karel Zak 5d74cf0092 lib/list: remove LIST_HEAD macro
* the variable definition with hidden type is always horrible, for
  example:

	  int func() {
	    LIST_HEAD(foo);
	    ...
	  }

  the more readable is:

          int func() {
            struct list_head foo;

            INIT_LIST_HEAD(&foo);
            ...
          }

* the name LIST_HEAD conflict with /usr/include/sys/queue.h

* we use it only on two places in sulogin

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-05 11:54:59 +01:00
Karel Zak 11e1097e6c sfdisk: unused parameter 'sf' [-Wunused-parameter]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-05 11:53:56 +01:00
Karel Zak 1459613e9a Merge branch 'fixMinixMkfs' of https://github.com/n3world/util-linux
* 'fixMinixMkfs' of https://github.com/n3world/util-linux:
  disk-utils/mkfs.minix: Set ninodes after checking max
2017-01-05 11:34:29 +01:00
Nate Clark b7b26945d1 disk-utils/mkfs.minix: Set ninodes after checking max
ninodes in the superblock needs to be set after inodes is checked
against MINIX_MAX_INODES otherwise a value larger than MINIX_MAX_INODES
can be attempted to be stored in the superblock.

Without this change the command "mkfs.minix -2 -i 65530 <dev>" would
write a minix superblock with ninodes set to 0.

Signed-off-by: Nate Clark <nate@neworld.us>
2017-01-04 14:42:59 -05:00
Karel Zak 63dc575be3 build-sys: test_linux_version is Linux only
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-04 15:44:51 +01:00
Karel Zak e33da967ef lib/linux_version: fix code indention
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-04 15:42:02 +01:00
Karel Zak 912885d012 Merge branch 'setterm' of git://github.com/kerolasa/lelux-utiliteetit
* 'setterm' of git://github.com/kerolasa/lelux-utiliteetit:
  setterm: add --resize option
2017-01-04 12:27:27 +01:00
Karel Zak e8f7acb0d3 lib: use unique ifdefs for tests
Let's use unique TEST_PROGRAM_<NAME> ifdefs to make build system more
robust.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-04 11:44:37 +01:00
Karel Zak b8ef01a895 Merge branch 'fixes' of https://github.com/rudimeier/util-linux
* 'fixes' of https://github.com/rudimeier/util-linux:
  agetty: fix ifdef typo
2017-01-03 12:16:43 +01:00
Karel Zak 5b9403a68f lib/linux_version: add test for manual testing
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-02 11:36:53 +01:00
Karel Zak 6b95593d79 lib/linux_version: fix stupid typo
... introduced by commit d404065a. Sorry.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-02 11:32:24 +01:00
Sami Kerola 5d79599951
setterm: add --resize option
Reset terminal size by assessing maximum row and column.  This is useful
when actual geometry and kernel terminal driver are not in sync.

Addresses: http://bugs.debian.org/835636
Based-on-work-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-12-29 10:56:15 +00:00
Karel Zak 963f7dfb82 Merge branch 'getrandom' of git://github.com/kerolasa/lelux-utiliteetit
* 'getrandom' of git://github.com/kerolasa/lelux-utiliteetit:
  lib/randutils: use getrandom(2) when it is available
2016-12-22 15:27:25 +01:00
Sami Kerola 8d42631e31 fsfreeze: move filesystem support info to manual page
Include btrfs, f2fs, and nilfs to list of supported filesystems, with note
the list can be incomplete.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-12-22 12:18:45 +01:00
Sami Kerola 6690ceed64 fsfreeze: remove unnecessary functions
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-12-22 12:18:45 +01:00
Karel Zak eac414038e tests: add findmnt output tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-22 11:52:22 +01:00
Ruediger Meier c43cd8f513 agetty: fix ifdef typo
introduced in 77835be2

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-21 22:47:36 +01:00
Karel Zak 131af5109f tests: add new findmnt --options tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-20 16:05:29 +01:00
Karel Zak 7d395c75d1 libmount: support name=value for mnt_match_options()
$ findmnt --options mode=755
TARGET         SOURCE FSTYPE   OPTIONS
/sys/fs/cgroup tmpfs  tmpfs    rw,nosuid,nodev,noexec,relatime,mode=755
/dev           udev   devtmpfs rw,relatime,size=1983516k,nr_inodes=495879,mode=755

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-20 16:01:22 +01:00
Karel Zak db17f201b8 libmount: reimplement mnt_match_options()
Let's use optstr.c functions to parse pattern and options strings.
It's more robust that the old original mount(8) code and it supports
quotes in the options strings.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-20 15:35:50 +01:00
Karel Zak 421cfd3565 tests: add findmnt tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-20 12:14:17 +01:00
Karel Zak 193b3239c1 lsblk: use errtryhelp()
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 13:30:56 +01:00
Karel Zak 677ec86cef Use --help suggestion on invalid option
The current default is to print all usage() output. This is overkill
in many case.

Addresses: https://github.com/karelzak/util-linux/issues/338
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 13:13:34 +01:00
Karel Zak 3077b37101 include/c.h: add errtryhelp()
Add code to print:

	Try '<progname> --help' for more information.

and exit.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 11:33:40 +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 80c31a0b59 findmnt: error on --target /non-exist
The original --target implementation (< v2.27) has been based on
stat(), so it was usable for valid paths only.

The new implementation is based on search in the mountinfo file, so it
works for arbitrary crazy path. This is not backwardly compatible and
if the path does not exist then it still returns at least root
directory mount entry.

This patch forces mnt_table_find_mountpoint() to check if the path is
valid before we search in the mountinfo file.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-16 13:00:45 +01:00
Karel Zak 0ed2a95471 more: avoid double free() on exit
On 'q' command more(1) calls end_it() function with _exit(). The
_exit() may suspend program execution due to pending I/O on very
loaded server. In this time SIGINT may be delivered due to impatient
user who will press ^C.

And then end_it() cleanup function may be executed by signal handler
too. The result is double free()...

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1403971
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-15 14:40:26 +01:00
Karel Zak 06e204889f tests: add missing file
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-13 15:00:51 +01:00
Karel Zak 974cc006f1 nsenter: add --all option
Let's make it easy for users to enter target process namespaces.

Addresses: https://github.com/karelzak/util-linux/issues/382
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-13 14:56:48 +01:00
Karel Zak 8623264511 build-sys: cleanup UL_NCURSES_CHECK
* use SUFFIX for upper-case suffix
* use AC_CHECK_TOOL() to search for ncurses-config (thanks to Mike Frysinger)
* separate checks by AS_IF()

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-13 12:41:18 +01:00
Karel Zak 8fdd483c53 fdisk: don't be silent when list non-existing device
Addresses: https://github.com/karelzak/util-linux/issues/376
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-13 12:11:32 +01:00
Karel Zak 3f7429fd2d build-sys: prefer pkg-config for ncurses
and use ncurses{5,6}-config as fallback only.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-12 15:23:53 +01:00
Sami Kerola cc01c2dca4
lib/randutils: use getrandom(2) when it is available
System call getrandom(2) is relatively new, available since kernel 3.17 but
not supported by glibc 2.24.  That in mind autotools is made to check
availability of this function and keep old code as fallback.  It is
reasonable assume it will take years before the syscall(2) and fallback are
unproblematic to remove.

One might ask why bother using getrandom(2).  Main reason is to avoid
unnecessary system calls to achieve exactly same end result.  That
demonstrated with 'strace -c ./mcookie' showing 36 calls before, and 32
after this change.  Secondly the getrandom(2) function got to kernel with
promise it can be used to avoid file descriptor run down, and since uuidd
uses random_get_bytes() it should fulfill it's promise here.

Reference: http://man7.org/linux/man-pages/man2/getrandom.2.html
Reference: https://lwn.net/Articles/606141/
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-12-11 11:46:54 +00:00
Karel Zak 8048a826cc Merge branch 'build-fixes' of https://github.com/rudimeier/util-linux
* 'build-fixes' of https://github.com/rudimeier/util-linux:
  build-sys: don't clean *.img files
2016-12-09 15:37:09 +01:00
Karel Zak 0a14cc8bcc libmount: revert X-* and x-* meaning
Let's hope this is last change necessary to cleanup x-* usage:

  x-*  persistent option, stored in utab, available for umount, etc.
  X-*  fstab comment only

mount(8) supports x-mount.mkdir= as well as newly recommended X-mount.mkdir=

Advantages:

 * less invasive
 * does not require exception for x-systemd
 * does not require rename x-initrd to X-initrd

The systemd and dracut users will get the new (=fixed) functionality without a
change in fstab configuration. This is the primary goal.

Disadvantages:

 * not 100% compatible libmount behavior, x-* options have not been
   previously stored in utab. The API is the same, options will be still
   available, but on x-* libmount will write to /run/mount/utab. For now
   it seems only systemd uses x-*, and they like this behavior, so...

Addresses: https://github.com/systemd/systemd/pull/4515
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-09 15:36:14 +01:00
Ruediger Meier 38f75ebe1e build-sys: don't clean *.img files
Don't know why this was added in d78df0ac but it can't be right that
libmount/python removes these files in the toplevel builddir. Moreover
I've never seen such *.img files appearing during build at all.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-09 14:27:48 +01:00
Karel Zak 08595712f3 Merge branch doc_fixes
Rebase from
  http://git.kernel.org/pub/scm/linux/kernel/git/mtk/util-linux.git doc_fixes

  docs: renice(1): Add credentials(7) to SEE ALSO
  docs: renice(1): Add SEE ALSO entry for sched(7)
  docs: mount(8): Wording fix
  docs: ionice(1): SEE ALSO: add ioprio_set(2)
  docs: lsns(8): SEE ALSO: add namespaces(7)
  docs: last(1): Eliminate oddball formatting
  docs: last(1): SEE ALSO: add reference to wtmp(5)
  docs: taskset(1): Wording fix
  docs: namei(1): SEE ALSO: add symlink(7)
  docs: kill(1): Wording fix
  docs: various pages: Use 'UID" and "GID", not "uid" and "gid" in man pages
  docs: various pages: Use "PID" not "pid" in man-pages
  docs: various pages: Use "ID" not "id" in man pages
  docs: various pages: Use consistent terminology (set-user-ID and set-group-ID)
  docs: various pages: Format pathnames as italic (.I)
2016-12-09 13:48:34 +01:00
Michael Kerrisk c0cf01b5e8 docs: renice(1): Add credentials(7) to SEE ALSO
credentials(7) explains concepts such as "process group".

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:46:15 +01:00
Michael Kerrisk 248874b1ac docs: renice(1): Add SEE ALSO entry for sched(7)
The sched(7) page as of the most recent release contains detailed
information on the 'nice' value, including a discussion of
autogrouping, which has surprising interactions with the process
nice value.

Signed-off-by: <mtk.man-pages@gmail.com>
2016-12-09 13:46:15 +01:00
Michael Kerrisk f3af8329ba docs: mount(8): Wording fix
The correct word here is "practice"; "manner" would not be well
understood by most English speakers.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 82b3c4c291 docs: ionice(1): SEE ALSO: add ioprio_set(2)
ioprio_set(2) is the system call that underlies this command.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk d628c0d7a0 docs: lsns(8): SEE ALSO: add namespaces(7)
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk fd17733fcb docs: last(1): Eliminate oddball formatting
\s-2...\s0 is unused anywhere else. Remove it.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 22a1c10ba1 docs: last(1): SEE ALSO: add reference to wtmp(5)
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk cef04ac8da docs: taskset(1): Wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 9a1f476c7c docs: namei(1): SEE ALSO: add symlink(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk 8419465d2d docs: kill(1): Wording fix
Fix a wording error introduced in one of my recent commits.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-09 13:45:09 +01:00