summaryrefslogtreecommitdiffstats
path: root/sys-utils
Commit message (Collapse)AuthorAgeFilesLines
* lscpu: avoid double freeSami Kerola2014-07-131-1/+1
| | | | | | The double free was possible for architectures other than x86_64 or i386. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setpriv: avoid alloca() use xmalloc() insteadSami Kerola2014-07-131-1/+3
| | | | | | | | | | | | The getgroups() can return up to NGROUPS_MAX supplementary groups, that is (since kernel 2.6.3) 65536 in total. The git_t is 4 bytes, so maximum request is 256 kilobytes. When a system happen to have memory preasure alloca() may not be able to allocate enough memory, making debugging unnecessarily difficult. IMHO 64 pages is significant enough amount of memory to be properly error checked at a time of allocation. Reference: http://www.gnu.org/software/libc/manual/html_node/Disadvantages-of-Alloca.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* dmesg: avoid unnecessary variable assignmentSami Kerola2014-07-131-1/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lscpu: avoid use of bzero() in favor of memset()Sami Kerola2014-07-131-1/+1
| | | | | | The bzero() is marked as LEGACY in POSIX.1-2001. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: fix some typosSami Kerola2014-07-131-1/+1
| | | | | | | Found with misspell-check version 2.0d. Reference: https://github.com/lyda/misspell-check Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* swapon: mark --sumarry as deprecatedKarel Zak2014-06-302-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: align --summary fieldsSami Kerola2014-06-301-1/+1
| | | | | | | | | | | | This commit makes partitions and files to have remaining three columns aligned. Below print out demonstrates earlier misalignment. $ swapon -s Filename Type Size Used Priority /dev/sda2 partition 4194300 0 3 /home/src/util-linux/newswap file 496 0 -1 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* umount: slightly improve the man pageBenno Schulenberg2014-06-301-13/+13
| | | | | | Remove some stray words from option arguments. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fallocate: use O_CREAT only for the default behaviorKarel Zak2014-06-261-1/+3
| | | | | Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: fix check of number of argumentsBernhard Voelker2014-06-261-9/+9
| | | | Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* fallocate: clarify usage()Pádraig Brady2014-06-261-7/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: use err_exclusive_options(), cleanup getopt_long() stuffKarel Zak2014-06-262-23/+31
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: make man page readable for humansKarel Zak2014-06-261-28/+41
| | | | | | | | Well, let's copy & past from fallocate(2) syscall man page rather than try to be creative with another description for the flags. Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: fix FALLOC_FL_ZERO_RANGE flag checkKarel Zak2014-06-261-3/+7
| | | | | Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: sometimes one day lasts 23 hours.peppe2014-06-231-1/+1
| | | | | | | | | | | If less than 23 hours have passed since the last calibration, hwclock says "Not adjusting drift factor because it has been less than a day since the last calibration.", but in fact compares to 23 hours, not 24. This was originally reported at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689534 Signed-off-by: Andreas Henriksson <andreas@fatal.se>
* build-sys: support ./configure ADJTIME_PATH=Karel Zak2014-06-194-7/+13
| | | | | | | .. to override the default /etc/adjtime path. Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix man page [checkmans]Karel Zak2014-06-181-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fix ifdef HAVE_sys_io_h [checkconfig]Karel Zak2014-06-181-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: more hints about default mount options to man pageKarel Zak2014-06-121-1/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* flock: document exit status of flock in man pagePhillip Susi2014-06-091-0/+3
| | | | | The man page did not indicate that the exit status of flock is actually that of the child command, when one is run.
* umount: Make sure exit code does not overflowNicolas Boichat2014-06-071-1/+1
| | | | | | | | | | | | | | | | POSIX exit code is only 8-bit, and since umount sums up error codes, it can sometimes report success (exit code 0) even though a number of operations failed. For example, running, in an empty directory: umount `seq 1 7` returns 224 (7*32), since none of the 7 mount point exists but umount `seq 1 8` returns 0 (8*32=256) This patch clips the return value to 255. Signed-off-by: Nicolas Boichat <nicolas@boichat.ch>
* libsmartcols: add debug messagesKarel Zak2014-06-065-1/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add btrfs to mount.8Gui Hecheng2014-06-061-0/+186
| | | | | | Based on Documentation/filesystems/btrfs.txt Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
* docs: fix "behaviour" vs. "behavior"Karel Zak2014-06-062-15/+15
| | | | | | | | 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>
* Merge branch 'lscpu-detect-v3' of https://github.com/rudimeier/util-linuxKarel Zak2014-05-302-4/+174
|\ | | | | | | | | | | | | | | | | * 'lscpu-detect-v3' of https://github.com/rudimeier/util-linux: lscpu: improve vmware detection tests: add lscpu IBM pSeries test data lscpu: detect OS/400 and pHyp hypervisors tests: add vbox lscpu dump lscpu: minor cleanup and improve hypervisor detection
| * lscpu: improve vmware detectionRuediger Meier2014-05-291-1/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch comes from openSUSE / SLE. Original author was probably Petr Uzel. Internal SUSE references: fate310255, sr226509 VMmware backdoor assembler code has been fixed for old clang compiler (travis), see see http://llvm.org/bugs/show_bug.cgi?id=9379 CC: Stanislav Brabec <sbrabec@suse.cz> CC: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * lscpu: detect OS/400 and pHyp hypervisorsRuediger Meier2014-05-292-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch comes originally from openSUSE / SLE. Author was probably Petr Uzel. Internal SUSE references: fate310255, sr226509 In comparison to the original patch we have slightly corrected iSeries and pSeries detection according to Alexander Graf's comments on util-linux@vger.kernel.org. Maybe we would need to add some more code to detect pSeries emulated by Qemu/KVM. CC: Stanislav Brabec <sbrabec@suse.cz> CC: Petr Uzel <petr.uzel@suse.cz> CC: Alexander Graf <agraf@suse.de> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * lscpu: minor cleanup and improve hypervisor detectionRuediger Meier2014-05-292-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | - add HYPER_VBOX - improve HYPER_VMWARE This patch comes from openSUSE / SLE. Original author was probably Petr Uzel. Internal SUSE references: fate310255, sr226509 CC: Stanislav Brabec <sbrabec@suse.cz> CC: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | build: fix some compiler warningsRuediger Meier2014-05-303-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Most of them catched on 32bit gcc and icc. disk-utils/fsck.cramfs.c: printf format type lib/boottime.c: unused variables misc-utils/cal.c: set but never used sys-utils/losetup.c: set but never used sys-utils/lscpu-dmi.c: defined but not used sys-utils/switch_root.c: comparison between signed and unsigned tests/helpers/test_sysinfo.c: printf format type
* | build-sys: add sys-utils/uname26.8 to gitignoreKarel Zak2014-05-291-5/+6
| | | | | | | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* | setarch: add generic support for setarch $(uname -m) ...Ruediger Meier2014-05-291-0/+16
| | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl> Signed-off-by: Karel Zak <kzak@redhat.com>
* | losetup: don't ignore EBUSY in losetup when the loop device is givenStanislav Brabec2014-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | losetup ignores the EBUSY error. In the loop fo A_CREATE action, it skips the error handling when errno = EBUSY. It's OK for the case where no loop device is specified, but the error has to be handled when the device is given explicitly. Author: Takashi Iwai <tiwai@suse.de> Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* | Merge branch 'setarch' of https://github.com/rudimeier/util-linuxKarel Zak2014-05-262-1/+5
|\ \ | | | | | | | | | | | | | | | * 'setarch' of https://github.com/rudimeier/util-linux: setarch: add shortcut binary uname26 setarch: flush output streams before exec
| * | setarch: add shortcut binary uname26Ruediger Meier2014-05-222-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some uname26 binaries flying around. Let's make it available everywhere. Internal SUSE references: fate313476, sr226509 CC: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | setarch: flush output streams before execRuediger Meier2014-05-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following (non-deterministic) discrepancy: $ setarch x86_64 -RFZLvXBIST3 --uname-2.6 echo success Switching on READ_IMPLIES_EXEC. Switching on ADDR_LIMIT_32BIT. Switching on SHORT_INODE. Switching on WHOLE_SECONDS. Switching on STICKY_TIMEOUTS. Switching on ADDR_LIMIT_3GB. Switching on UNAME26. success $ setarch x86_64 -RFZLvXBIST3 --uname-2.6 echo success &> /tmp/bla; cat /tmp/bla success Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | | mount: add note about order for -a to the man pageKarel Zak2014-05-261-1/+1
| | | | | | | | | | | | | | | Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | | umount: add info that --all-targets works with mtab symlink onlyKarel Zak2014-05-262-2/+6
|/ / | | | | | | | | Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* / build-sys: add BUILD_ vars for all Linux-only utilsKarel Zak2014-05-211-8/+28
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix tiny typo in man pageStephan Müller2014-05-191-1/+1
| | | | | | adjust command to use /dev/loop3 as described in text Signed-off-by: Stephan Mueller <fruktopus@gmail.com>
* lslogins: move to login-utilsOndrej Oprala2014-05-153-511/+0Star
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins(1): skeleton and argparsing for a new utilityOndrej Oprala2014-05-153-0/+511
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* dmesg: support colors customizationKarel Zak2014-05-132-34/+81
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: return EXIT_FAILURE on unsuccessful -fKarel Zak2014-05-131-1/+2
| | | | | Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* cytune: remove from util-linuxSami Kerola2014-05-124-678/+0Star
| | | | | | | | | | | Assumption is there are not many who need this tool. Whom ever they might be the recommendation is to use the command from old util-linux release. Second reason to removal is difficulty to test hardware specific command when none of the active project members does not seem to have such. Basically the command has reached dead end what comes to maintainability of it. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/timeutils: remove get_boot_time from libcommonKarel Zak2014-05-062-1/+2
| | | | | | | | clock_gettime() needs -lrt, so let's keep this stuff outside libcommon.la Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: fix typoKarel Zak2014-05-061-5/+4Star
| | | | | Reported-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: Check drift value in /etc/adjtimeStanislav Brabec2014-05-061-0/+4
| | | | | | | | Due to bug in older versions of hwclock, /etc/adjtime can contain excessive drift value (up to many years per day). Prevent it from applying. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* hwclock: Prevent excessive drift valuesStanislav Brabec2014-05-061-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Failure of CMOS battery can cause writing of excessive drift values (up to many years per day). This causes excessive hwclock adjustment next time, which may lead to overflow in calculate_adjustment() (and hang before 4a44a54b). Prevent this situation, check drift for limits and reset drift to zero instead. Steps to reproduce: mv /etc/adjtime /etc/adjtime.backup rm /etc/adjtime hwclock --set --date 2001-01-01\ 01:00:00 changing of /etc/adjtime. mv /etc/adjtime /etc/adjtime.saved hwclock --set --date 2001-01-02\ 01:00:01 mv /etc/adjtime.saved /etc/adjtime echo "======= The /etc/adjtime has a \"correct\" look:" cat /etc/adjtime hwclock --debug --systohc --utc echo "======= The /etc/adjtime now has deeply failed drift value:" cat /etc/adjtime mv /etc/adjtime /etc/adjtime.saved hwclock --set --date 2015-01-01\ 01:00:00 mv /etc/adjtime.saved /etc/adjtime hwclock --debug --adjust echo "======= And the last /etc/adjtime:" cat /etc/adjtime mv /etc/adjtime.backup /etc/adjtime hwclock --systohc --utc Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* setpriv: Fix --selinux-labelAndy Lutomirski2014-05-061-2/+2
| | | | | | | | | | | | | | | | | This commit: commit 05cef8eafbf169a8da1d2831f5ed3d5b1b81aaad Author: Sami Kerola <kerolasa@iki.fi> Date: Sat Apr 13 20:54:59 2013 +0100 setpriv: check writing to a file descriptor was successful broke --selinux-label. It checks whether fsyncing /proc/self/attr/exec succeeds, and it doesn't, because fsync isn't supported on that file. I have stealthily improved the error message as part of this fix. Signed-off-by: Andy Lutomirski <luto@amacapital.net>
* textual: remove square brackets from around three dotsBenno Schulenberg2014-05-064-19/+19
| | | | | | Also improve some option descriptions here and there. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>