summaryrefslogtreecommitdiffstats
path: root/sys-utils
Commit message (Collapse)AuthorAgeFilesLines
...
* lib/timer: add fallback if timer_create() not availableKarel Zak2018-12-031-3/+5
| | | | | | | | | | | | | * add struct ul_timer as API abstraction to hide differences between timer_create() and setitimer() * add setitimer() detection to ./configure.ac * add fallback code to use setitimer() if timer_create() not available (for example on OSX) Addresses: https://github.com/karelzak/util-linux/issues/584 Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'master' of https://github.com/nyantec/util-linuxKarel Zak2018-11-221-1/+1
|\ | | | | | | | | * 'master' of https://github.com/nyantec/util-linux: fix a bug where switch_root would erroneously try to parse initargs
| * Merge branch 'master' of github.com:karelzak/util-linuxPaul Asmuth2018-11-122-7/+68
| |\
| * | fix a bug where switch_root would erroneously try to parse initargsPaul Asmuth2018-11-121-1/+1
| | | | | | | | | | | | | | | | | | before this change, switch_root would try to parse all arguments, including 'initargs', using getopt, which would lead to an 'unrecognized option' error when trying to pass a flag to the init program
* | | fstrim: Add hardening settings to fstrim.serviceAndreas Henriksson2018-11-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This limits what the fstrim process has access to when it runs. PrivateUsers can't be enabled because of: "If this mode is enabled, all unit processes are run without privileges in the host user namespace[...]" Further improving this with additional option or making things even tighter is most likely possible. Signed-off-by: Andreas Henriksson <andreas@fatal.se> Signed-off-by: Karel Zak <kzak@redhat.com>
* | | setarch: fix obscure sparc32bash use-caseKarel Zak2018-11-221-10/+18
| | | | | | | | | | | | | | | Reported-by: Carlos Santos <casantos@datacom.com.br> Signed-off-by: Karel Zak <kzak@redhat.com>
* | | fstrim: Add Documentation key to fstrim.serviceAndreas Henriksson2018-11-211-0/+1
| | |
* | | fstrim: use long options in systemd service fileSami Kerola2018-11-211-1/+1
| |/ |/| | | | | | | | | Long options are more user friendly. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | unshare: allow to set user ID and group IDLaurent Vivier2018-11-122-3/+34
| | | | | | | | | | | | | | | | | | | | | | This patch introduces two new parameters to set the user ID and the group ID of the program to be executed. Setting group ID also drops supplementary groups. The option names used are the same as for nsenter, -S, --setuid and -G, --setgid. Signed-off-by: Laurent Vivier <laurent@vivier.eu>
* | unshare: allow to set a new rootLaurent Vivier2018-11-122-5/+35
|/ | | | | | | | | | | | | | | This patch instroduces two new parameters to set the new root and the new working directory in this new root. This allows to combine "unshare chroot" in one command, and doing like this the /proc filesystem is correctly mounted in the new root with "--mount-proc". The new parameters are -R, --root and -w, --wd. The names are the same as for nsenter, except for "-r" that is already used by "--map-root-user" and replaced by "-R". Signed-off-by: Laurent Vivier <laurent@vivier.eu>
* rtcwake: use poweroff if shutdown is not foundJustin Chen2018-11-061-12/+27
| | | | | | | Some systems do not have the shutdown command. Use poweroff as an alternative. Signed-off-by: Justin Chen <justinpopo6@gmail.com>
* eject: use err() rather than abort()Karel Zak2018-11-051-1/+1
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1645920 Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: fix report zones sector offset checkMasato Suzuki2018-10-231-2/+3
| | | | | | | To catch an offset error, an offset should be begger than or equal to a device size in the condition. Signed-off-by: Masato Suzuki <masato.suzuki@wdc.com>
* mount: add note about MS_BIND and _netdevKarel Zak2018-10-021-2/+5
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/697 Signed-off-by: Karel Zak <kzak@redhat.com>
* unshare: remove -s from --help outputKarel Zak2018-09-111-4/+7
| | | | | | | | | | | The code and man page do not assume -s to be short alias to --setgroups. This commit also a little bit change --help output formatting to make it more readable and structured. Addresses: https://github.com/karelzak/util-linux/pull/692 Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: add missing semicolonMatti Niemenmaa2018-09-101-1/+1
| | | | | | | | This broke compilation when HAVE_POSIX_FALLOCATE was undefined. The typo dates to the original posix_fallocate support added in commit 833f9a7aae713278eec5f85266597482f18c7370. Signed-off-by: Matti Niemenmaa <matti.niemenmaa+git@iki.fi>
* lscpu: use the first VM from /proc/sysinfoKarel Zak2018-09-041-0/+1
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/685 Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: make xasprintf call more robustKarel Zak2018-09-041-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setpriv: add --reset-envKarel Zak2018-08-222-1/+63
| | | | | | | | | | | Clear environment in way like su(1), but PATH is set to hard-coded defaults and /etc/login.defs is not used at all (I guess we want to keep setpriv(1) simple). If you need anything more advanced than use env(1). Addresses: https://github.com/karelzak/util-linux/issues/325 Signed-off-by: Karel Zak <kzak@redhat.com>
* setpriv: add user/group names to usage()Karel Zak2018-08-221-6/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setpriv: allow to use group name for --groupsKarel Zak2018-08-222-4/+5
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/325 Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: use -n shortcut for --dry-runKarel Zak2018-08-162-4/+4
| | | | | | | | It seems 'n' is more common than 'd'. The patch also cleanup getopt_long() options string. Addresses: https://github.com/karelzak/util-linux/commit/fda0e2cf043994c77c29a2d109c03ce8957b1d38#commitcomment-30097920 Signed-off-by: Karel Zak <kzak@redhat.com>
* Fix man page typosJakub Wilk2018-08-166-9/+9
| | | | Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
* build-sys: fix typo in man installKarel Zak2018-08-151-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: add adjtime_config(5) man pageKarel Zak2018-08-142-1/+67
| | | | | | The file is pretty common, but undocumented by individual man page. Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fixed part ID for ARM Cortex-M7Mark Sheppard2018-08-131-1/+1
|
* mount: add ext4 to some places to the man pageKarel Zak2018-08-101-4/+5
|
* losetup: add reference to suffixes for --{sizelimit,offset}Karel Zak2018-08-081-2/+4
| | | | | Reported-by: Milan Broz <gmazyland@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: update .service to follow /etc/fstabKarel Zak2018-08-081-2/+2
| | | | | | | | | | | Replace -a with -A to discard mounted filesystems from /etc/fstab. The original -a forces fstrim to try to discard all filesystems, including for example manually mounted removable media. It seems better for widely used .service unit to follow /etc/fstab. Addresses: https://github.com/karelzak/util-linux/issues/673 Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: make <arch> optionalKarel Zak2018-08-072-15/+39
| | | | | | | | | | | | | | Let's allow to change personality flags without execution domain modification. Old way: setarch `arch` --addr-no-randomize myprog New way: setarch --addr-no-randomize myprog Addresses: https://github.com/karelzak/util-linux/issues/668 Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: split set_arch() function to small functionsKarel Zak2018-08-061-35/+73
| | | | | | | It seems better to keep the code more flexibile by small one-purpose functions than by one huge monster. Signed-off-by: Karel Zak <kzak@redhat.com>
* man pages: Fix misuse of two-fonts-macros (BR, IR)Bjarni Ingi Gislason2018-08-065-10/+8Star
| | | | | | | | | | | Change a two-fonts-macro to the single font one, when there is only one genuine argument. Split a punctuation mark from the only argument to a two-fonts-marco. Remove an isolated two-fonts-macro. Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* man pages: Remove "left" (or change to "l") in the column formats of tablesBjarni Ingi Gislason2018-08-062-3/+3
| | | | | | | | | A developmental version of "groff" issued a warning, for example with "test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z": troff: <logger.1>:299: warning: can't find font 't' Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* hwclock: rely on kernel for RTC_UIE_ON on Aplha and SparcKarel Zak2018-08-031-11/+2Star
| | | | | | | | | | | It's kernel business to return EINVAL for unsupported RTC_UIE_ON. We (userspace) should not make decisions about things that we do not control. If kernel is wrong then fix the kernel, don't hide the problem by crazy ifdefs in userspace. Signed-off-by: Karel Zak <kzak@redhat.com>
* umount: add --quiet optionKarel Zak2018-08-012-3/+24
| | | | | | | | | | | | | | | The command umount supports things like --all-targets and --recursive to umount all nodes in specified tree. Sometimes it makes sense to aggressively use wildcards like /dev/sdb* and in this case --quiet seems like a good choice umount --quiet --all-targets /dev/sdb* to suppress 'not mounted' error messages. The new option suppress only these error messages and nothing else. Addresses: https://github.com/karelzak/util-linux/issues/672 Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: add 'Address sizes'Karel Zak2018-08-012-0/+6
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/674 Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: add -A|--fstab to trim according to /etc/fstabKarel Zak2018-07-312-14/+59
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/673 Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: add control structKarel Zak2018-07-311-19/+24
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: remove ntpd from man pageKarel Zak2018-07-311-7/+4Star
| | | | | | | | It seems better to use generic "NTP daemon" in the man page than points to specific ntpd(1) implementation as some distros use for example chronyd(1) rather than old ntpd(1). Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fix resource leak [coverity scan]Karel Zak2018-07-251-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: fix mem leak, improve code [coverity scan]Karel Zak2018-07-251-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: fix warningKarel Zak2018-07-201-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add details about mtab and --namespace to mount.8Karel Zak2018-07-192-6/+32
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: add --delay <seconds>Karel Zak2018-07-185-6/+102
| | | | | | | | | | | * add command line option --delay <seconds> * read RTC type from /sys/class/rtc/rtc<N>/name * default to 0.5 (500ms) for rtc_cmos or when RTC type is impossible determine; otherwise delay is 0. Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: remove unwanted debug messageKarel Zak2018-07-041-2/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'fixes' of https://github.com/rudimeier/util-linuxKarel Zak2018-07-032-7/+7
|\ | | | | | | | | | | | | * 'fixes' of https://github.com/rudimeier/util-linux: wipefs: add missing ifdef lib/path: remove unused expression ipcs,chmem: fix access() usage
| * ipcs,chmem: fix access() usageRuediger Meier2018-06-252-7/+7
| | | | | | | | | | | | | | | | | | | | | | Some mistakes happened lately when switching from path_exist() to ul_path_access(). See f09a98de and 8ca31279. This caused ipcs test failures when running i386 binaries on x86_64 hosts, because the syscall fallback was always used. That's why I reviewed all similar changes and found another one in chmem. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | fallocate: add man page note about --collapse-range granularityKarel Zak2018-07-032-0/+9
|/ | | | | Reported-by: Radka Skvarilova <rskvaril@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* choom: use new ul_path_* APIKarel Zak2018-06-211-17/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>