summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* lib/loopdev: set blocksize when create a new deviceKarel Zak2019-01-222-0/+25
| | | | | | | | | | | The partition scanner in kernel depends on blocksize. We need to set the blocksize before we call LOOP_SET_STATUS64 (this ioctl triggers the scanner). This patch extends the internal API to save blocksize into loopdev context to be usable later for loopcxt_setup_device(). Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/loopdev: differentiate between setter()s and ioctl callsKarel Zak2019-01-223-13/+14
| | | | | | | | Now the internal API uses loopcxt_set_...() to set context variables as well as to call ioctls. This patch introduces loopcxt_ioctl_...() to makes things more obvious to readers. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: be more explicit about BTRFSKarel Zak2019-01-221-3/+4
| | | | | | | | It seems nocow and nodatasum attributes are required. See btrfs_swap_activate() in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ed46ff3d423780fa5173b38a844bf0fdb210a2a7 Addresses: https://github.com/karelzak/util-linux/issues/633 Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: rewrite section about swapfilesKarel Zak2019-01-222-36/+24Star
| | | | | | | | | | | | * don't duplicate info on two places -- let's keep only small note in mkswap(8) man page, suggest to read swapon(8) man page * add info about kernel versions for XFS and Btrfs swapfiles support * use subsection in the NOTES Addresses: https://github.com/karelzak/util-linux/issues/633 Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: (man) iomap for swapfile is already supported by kernelKarel Zak2019-01-211-1/+1
| | | | | | | ... since commit 67482129cdabf7cede1301d2415ef4f0156d35cd (Linus' tree). Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: (man) cleanup note about holesKarel Zak2019-01-212-19/+18Star
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/633 Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: (man) add note about --all to remount descKarel Zak2019-01-211-0/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: use offset in warn_size() calculationKarel Zak2019-01-181-2/+5
| | | | | | | | | | | | | | | | | | # dd if=/dev/urandom of=dummy bs=513 count=1 2>/dev/null # losetup -f --show --offset 1 dummy /dev/loop0 losetup: dummy: Warning: file does not fit into a 512-byte sector; the end of the file will be ignore The warning is bogus as with offset the size of the file fits into 512-byte sector. Simple test that all is right: # dd if=dummy bs=1 skip=1 2>/dev/null | sha256sum - /dev/loop0 da2ed0ade6ea518a802cd8a7a3c01c408ad8699ef6856b0b01f92b867d4ba9b5 - da2ed0ade6ea518a802cd8a7a3c01c408ad8699ef6856b0b01f92b867d4ba9b5 /dev/loop0 Addresses: https://github.com/karelzak/util-linux/issues/722 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add comment to fdisk_set_first_lba()Karel Zak2019-01-181-0/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update TODOKarel Zak2019-01-181-4/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* whereis: search in /(s)bin before /usr/libKarel Zak2019-01-171-2/+2
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/741 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add support for MS_REMOUNT on --allKarel Zak2019-01-169-6/+217
| | | | | | | | | | | | | This patch add to support for remount-all operation to libmount and mount(8). For example: mount --all -o remount,ro -t vfat to remount read-only all VFAT filesystems. Addresses: https://github.com/karelzak/util-linux/issues/589 Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: fix utimes() usageKarel Zak2019-01-151-3/+3
| | | | | | The bug has been introduced by untested commit ad7ac3d598e2d541d9eba70975e68dff7e52c7d9 ;-( Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use REALTIME_LIBS for hwclock due to monotonic.cKarel Zak2019-01-141-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'time-fixes' of https://github.com/kerolasa/util-linuxKarel Zak2019-01-147-27/+32
|\ | | | | | | | | | | | | | | * 'time-fixes' of https://github.com/kerolasa/util-linux: fsck.cramfs: use utimes() instead of utime() that is obsolete hwclock: use monotonic time to measure how long setting time takes include: add indirect monotonic clock id specifier timeutils: match today day and this year correctly
| * fsck.cramfs: use utimes() instead of utime() that is obsoleteSami Kerola2019-01-121-4/+4
| | | | | | | | | | Reference: http://man7.org/linux/man-pages/man3/utime.3p.html#APPLICATION_USAGE Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * hwclock: use monotonic time to measure how long setting time takesSami Kerola2019-01-122-3/+6
| | | | | | | | | | | | | | | | | | Earlier gettimeofday() was affected by discontinuous jumps. Measuring how long time it takes to set time using function that effected by the very thing being measured makes head spin. Lets make this less confusing with monotonic clock that ticks on without jumps. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * include: add indirect monotonic clock id specifierSami Kerola2019-01-122-5/+7
| | | | | | | | | | | | | | Avoid repeated ifdef checks in code by adding a project specific preprocessor definition. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * timeutils: match today day and this year correctlySami Kerola2019-01-122-15/+15
| | | | | | | | | | | | | | | | | | Assumption all years since 1970 have been exactly 365 days long has it's problems when leap years happen. Lets use struct tm fields that are provided by localtime_r(), making year and day to be correctly compared even when it's late new years eve somewhere else than UTC-0. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | Merge branch 'asan-fixes' of https://github.com/kerolasa/util-linuxKarel Zak2019-01-142-0/+3
|\ \
| * | readprofile: check input file is not empty [asan]Sami Kerola2019-01-131-0/+2
| | | | | | | | | | | | | | | Addresses: https://github.com/karelzak/util-linux/issues/717 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | last: fix wtmp user name buffer overflow [asan]Sami Kerola2019-01-131-0/+1
| |/ | | | | | | | | | | | | | | Ensure utmp user name field is null terminated. Without that getpwnam() can buffer overflow, when wtmp file is malformed. Addresses: https://github.com/karelzak/util-linux/issues/715 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* / bash-completion: umount support relative path and ~ as home shorthandsSami Kerola2019-01-121-1/+19
|/ | | | | Addresses: https://github.com/karelzak/util-linux/issues/703 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* login: add support for login.defs(5) LASTLOG_UID_MAXKarel Zak2019-01-112-0/+14
| | | | | | | | | | This new variable allows to keep lastlog file small and filter out things like huge nfsnobody UIDs. The variable is also supported by shadow-utils (adduser, etc.). Addresses: https://github.com/shadow-maint/shadow/pull/142/ Signed-off-by: Karel Zak <kzak@redhat.com>
* login-utils/logindefs: clenaup APIKarel Zak2019-01-112-2/+2
| | | | | | The default value should be unsigned if the result is also unsigned... Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim: check for read-only devices on -a/-AKarel Zak2019-01-111-2/+4
| | | | | | | to avoid "FITRIM ioctl failed: Remote I/O error" Addresses: https://github.com/karelzak/util-linux/issues/738 Signed-off-by: Karel Zak <kzak@redhat.com>
* su-common.c: prefer ENV_SUPATH over ENV_ROOTPATHStanislav Brabec2019-01-104-5/+5
| | | | | | | | ENV_SUPATH and ENV_ROOTPATH are equivalent and ENV_ROOTPATH takes precedence in both login and su. It makes no sense. More logical would be precedence of ENV_SUPATH in su and ENV_ROOTPATH in login. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* su-common.c: prefer /etc/default/su over login.defsStanislav Brabec2019-01-101-1/+1
| | | | | | | | | | | | | | | | su(1) documentation says: /etc/default/su command specific logindef config file /etc/login.defs global logindef config file It indirectly indicates that /etc/default/su should take precedence over /etc/login.defs. But the reverse is true. It is not possible to define ENV_PATH in /etc/login.defs and then make su specific customization in /etc/default/su. We need to change read order to match the documented behavior. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* fdisk: make partition types uses more robustKarel Zak2019-01-102-4/+13
| | | | | | | | * report failed partition type parsing * make sure partition types code (from user reply) for MBR is hex Reported-by: Jonny Grant <jg@jguk.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: support CTRL+C on change-partition-type dialogKarel Zak2019-01-101-4/+11
| | | | | Reported-by: Jonny Grant <jg@jguk.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* utmpdump: fix word swapping in manual pageCarlos Santos2019-01-081-1/+1
| | | | | | | | | | From The only binary version of the utmp(5) is standardised. To Only the binary version of the utmp(5) is standardised. Change-Id: I0033f6cf055d569c7dfca5e05e918f735ea72582 Signed-off-by: Carlos Santos <casantos@datacom.com.br>
* libblkid: improve whole-disk detection when read /proc/partitionsKarel Zak2019-01-082-12/+15
| | | | | | | | | | | | | | | | | | blkid(8) in high-level mode checks partitions and unpartitioned whole-disk devices from the file /proc/partitions. The current heuristic assumes that partition name ends with a digit. Unfortunately, this is not correct -- for example md0 or nvme0n1 are whole-disk devices. This commit uses sysfs_devno_is_wholedisk() to make sure the device is a partition (according to kernel or DM). It's probably more expensive, because this way requires more syscalls (to read stuff from /sys etc.). The patch also adds more information to the blkid(8) man page. Addresses: https://github.com/karelzak/util-linux/issues/728 Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: Check for value of _HAVE_STRUCT_TERMIOS_C_ISPEEDKhem Raj2019-01-051-1/+1
| | | | | | | | | | in glibc 2.29+ checking for just existence of _HAVE_STRUCT_TERMIOS_C_ISPEED won't be enough, the value has to be checked see https://sourceware.org/git/?p=glibc.git;a=commit;h=e5a50db36eaa6e8c6427b3a971563240b633ca85 Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libblkid: (ntfs) fix compiler warning [-Wpedantic]Karel Zak2019-01-021-6/+4Star
| | | | | | | | libblkid/src/superblocks/ntfs.c:80:2: warning: ISO C restricts enumerator values to range of 'int' (4294967295 is too large) [-Wpedantic] Addressed: https://github.com/karelzak/util-linux/pull/732 Signed-off-by: Karel Zak <kzak@redhat.com>
* chmem: add initilizer [clang]Sami Kerola2019-01-021-1/+1
| | | | | | warning: use of GNU empty initializer extension [-Wgnu-empty-initializer] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libsmartcols: remove extra ';' outside of a function [-Wextra-semi]Sami Kerola2019-01-021-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Merge branch 'master' of https://github.com/kvanals/util-linuxKarel Zak2019-01-023-2/+2
|\ | | | | | | | | | | | | * 'master' of https://github.com/kvanals/util-linux: Removed BlueStore VERSION information as it is gibberish Updated BlueStore expected result Added BlueStore test image
| * Removed BlueStore VERSION information as it is gibberishKenneth Van Alstyne2018-12-182-3/+0Star
| |
| * Updated BlueStore expected resultKenneth Van Alstyne2018-12-171-0/+1
| |
| * Added BlueStore test imageKenneth Van Alstyne2018-12-172-0/+2
| |
* | Remove duplicate entry for reset-env from usageJohn W Higgins2018-12-181-1/+0Star
| | | | | | I assume the second entry was not desired in the original commit. Line 153-154 would appear to be a duplicate
* | libblkid: (bluestore) terminate magic strings arrayKarel Zak2018-12-171-1/+2
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | Merge branch 'master' of https://github.com/kvanals/util-linuxKarel Zak2018-12-174-0/+57
|\| | | | | | | | | | | * 'master' of https://github.com/kvanals/util-linux: Finished up BlueStore support Added support for detecting Ceph BlueStore Block Devices
| * Finished up BlueStore supportKenneth Van Alstyne2018-12-143-0/+3
| |
| * Added support for detecting Ceph BlueStore Block DevicesKenneth Van Alstyne2018-12-141-0/+54
| |
* | dmesg: correct "-n, --console-level level" example in manual pageJean-Philippe ROMAIN2018-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | When providing an abbreviation of the level name with the option "-n, --console-level level", it corresponds to the level (included) up to which messages are displayed on the console. If a level number is given, this level is excluded. So in the given example, "-n 1" is equivalent to "-n emerg". Signed-off-by: Jean-Philippe Romain <jean-philippe.romain@st.com>
* | docs: add link to mail list archiveSami Kerola2018-12-171-2/+3
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | libblkid: stratis: correct byte orderTony Asleson2018-12-171-2/+2
|/ | | | | | | Stratis superblock is little endian, ensure we retrieve the number of sectors and initialization time correctly. Signed-off-by: Tony Asleson <tasleson@redhat.com>
* Merge branch 'aarch32_on_aarch64' of https://github.com/jlinton/util-linuxKarel Zak2018-12-121-0/+14
|\ | | | | | | | | * 'aarch32_on_aarch64' of https://github.com/jlinton/util-linux: lscpu: Add aarch32 detection on aarch64
| * lscpu: Add aarch32 detection on aarch64Jeremy Linton2018-12-111-0/+14
| | | | | | | | | | | | | | | | | | aarch32 support is an optional feature of ARMv8, as CPUs which don't support aarch32 become more common, lets make sure that lscpu can tell a user quickly if they are on a machine that only supports 64-bit. Signed-off-by: Jeremy Linton <lintonrjeremy@gmail.com>