summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* include/debug: don't print pointer address for SUID programsKarel Zak2018-01-1211-16/+57
| | | | | | | | | | | | | | | | * introduce new flag __UL_DEBUG_FL_NOADDR to suppress pointer address printing * use __UL_DEBUG_FL_NOADDR when SUID * move ul_debugobj() to debugobj.h, and require UL_DEBUG_CURRENT_MASK to provide access to the current mask from ul_debugobj(). It's better than modify all ul_debugobj() calls and use the global mask as argument. * remove never used UL_DEBUG_DEFINE_FLAG Reported-by: halfdog <me@halfdog.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: allow to start freespace for zeroKarel Zak2018-01-113-1/+8
| | | | | | | This is necessary for disk labels like SUN where whole disk is possible to address by partitions. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (sun) fix n-1 bug and whole-diskKarel Zak2018-01-111-1/+5
| | | | | | | | * set whole_disk variable if SUN_TAG_WHOLEDISK specified * fix N-1 bug in add new partition according to template (script) Addresses: https://github.com/karelzak/util-linux/issues/555 Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'fixes' of https://github.com/rudimeier/util-linuxKarel Zak2018-01-111-1/+1
|\
| * misc: fix printf i386 compiler warningsRuediger Meier2018-01-091-1/+1
| | | | | | | | | | | | sys-utils/lsns.c:683:2: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘ino_t’ [-Werror=format=] Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | libblkid: Add support for stratisTony Asleson2018-01-114-0/+108
| | | | | | | | | | | | | | | | | | | | Initial support for stratis, ref. https://github.com/stratis-storage [kzak@redhat.com: - remove C++ comment] Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | libfdisk: (script) support R (RAID) and V (LVM) shortcutsKarel Zak2018-01-093-2/+21
| | | | | | | | | | Addresses: https://github.com/karelzak/util-linux/issues/560 Signed-off-by: Karel Zak <kzak@redhat.com>
* | libfdisk: (gpt) add VMware specific UUIDsKarel Zak2018-01-081-0/+7
| | | | | | | | | | Addresses: https://github.com/karelzak/util-linux/issues/559 Signed-off-by: Karel Zak <kzak@redhat.com>
* | libmount: fix mnt_table_is_fs_mounted() for rbindKarel Zak2018-01-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no difference between "bind" and "rbind" if we want to FS root to search for the FS in mountinfo file. fstab: /dev/sdc1 /mnt/foo xfs defaults 0 0 /mnt/foo /mnt/test none rw,rbind 0 0 use -a more than once: mount -a mount -a /proc/mounts (the current result): /dev/sdc1 /mnt/foo xfs rw,relatime,attr2,inode64,noquota 0 0 /dev/sdc1 /mnt/test xfs rw,relatime,attr2,inode64,noquota 0 0 /dev/sdc1 /mnt/test xfs rw,relatime,attr2,inode64,noquota 0 0 /dev/sdc1 /mnt/foo xfs rw,relatime,attr2,inode64,noquota 0 0 expected (fixed version) result: /dev/sdc1 /mnt/foo xfs rw,relatime,attr2,inode64,noquota 0 0 /dev/sdc1 /mnt/test xfs rw,relatime,attr2,inode64,noquota 0 0 Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1528959 Signed-off-by: Karel Zak <kzak@redhat.com>
* | libfdisk: (dos) fix max headsKarel Zak2018-01-021-1/+1
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | libfdisk: extend API to provide label specific geometry rangesKarel Zak2018-01-027-11/+138
| | | | | | | | | | | | | | Now fdisk provides DOS specific geometry ranges in expert menu. Addresses: https://github.com/karelzak/util-linux/issues/556 Signed-off-by: Karel Zak <kzak@redhat.com>
* | rtcwake: wait stdin to settle down before entering a system sleepSami Kerola2018-01-022-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | This can delay entering to system sleep up to 0.28 seconds while discarding input, when stdin is interactive device. [kzak@redhat.com: - add note to the man page] Reference: https://github.com/karelzak/util-linux/issues/527 See-also: a85c39013491713ac0d9e24fd0f07b4fabdcfc17 Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* | sfdisk: wait before re-readKarel Zak2018-01-021-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | The original old (v2.13) fdisk had sleep(2) beany ideafore re-read ioctl. It seems overkill, but short sleep is probably a good idea as we call re-read on sfdisk start and at the end. It's possible that sfdisk is too fast and the initial re-read is not gone yet. It would be nice to have something more elegant than sleep, any idea? Addresses: https://github.com/karelzak/util-linux/issues/557 Signed-off-by: Karel Zak <kzak@redhat.com>
* | Merge branch 'patch-1' of https://github.com/kenyon/util-linuxKarel Zak2018-01-021-1/+1
|\ \
| * | rename.1: fix typo, where -> wereKenyon Ralph2017-12-231-1/+1
| | |
* | | Merge branch 'master' of https://github.com/yurchor/util-linuxKarel Zak2018-01-021-1/+1
|\ \ \
| * | | Fix minor typo: priorty -> priorityYuri Chornoivan2017-12-311-1/+1
| |/ /
* / / lib/sha1: use proper WORDS_BIGENDIAN macroKarel Zak2018-01-021-6/+3Star
|/ / | | | | | | | | | | | | | | The original code uses BYTE_ORDER, but we use WORDS_BIGENDIAN in utl-linux. Reported-by: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* | lib/mbsalign: encode \x to \xecxKarel Zak2017-12-201-2/+8
| | | | | | | | | | | | | | Don't encode stand alone '\', our encoding is about \x<hex>, so we need to care about \x prefix only. Signed-off-by: Karel Zak <kzak@redhat.com>
* | libfdisk: (gpt) use fdisk_warn() for failed name settingKarel Zak2017-12-201-1/+1
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | Merge branch 'gpt-part-name' of https://github.com/yontalcar/util-linuxKarel Zak2017-12-202-23/+51
|\ \ | | | | | | | | | | | | | | | | | | | | | * 'gpt-part-name' of https://github.com/yontalcar/util-linux: libfdisk: return bytes processed from gpt_entry_set_name(), process rc libfdisk: allocate enough bytes for ucs2 to utf8 encoding libfdisk: gpt: properly encode string on rename lib/mbsalign: encode backslash to prevent ambiguity
| * | libfdisk: return bytes processed from gpt_entry_set_name(), process rcVaclav Dolezal2017-12-191-5/+8
| | | | | | | | | | | | | | | | | | | | | Made gpt_entry_set_name() return number of utf8 bytes processed on success, so info message about change can be accurate. Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
| * | libfdisk: allocate enough bytes for ucs2 to utf8 encodingVaclav Dolezal2017-12-181-7/+6Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allocate 3*number_of_ucs2_characters bytes for utf8 output. Also as we are using calloc there's no need to write terminating null byte. Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
| * | libfdisk: gpt: properly encode string on renameVaclav Dolezal2017-12-181-10/+36
| | | | | | | | | | | | | | | | | | | | | GPT partition name entry should be recorded as little endian UCS2, so I have written proper conversion (assuming UTF8 input). Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
| * | lib/mbsalign: encode backslash to prevent ambiguityVaclav Dolezal2017-11-291-2/+2
| |/ | | | | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* | tests: don't use mount.<type> helpers in mount-by-pattern testsKarel Zak2017-12-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The test behavior is fragile if depends on external helpers. Let's keep it based on mount(2) only. The test will be faster too. Note that "mount -t <pattern>" does not behaviour as expected with helpers. We need to try another helper if the current one ends with status=1 (waitpid()). Now it returns status from the first helper. Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* | build-sys: don't check for swapon() number of argumentsKarel Zak2017-12-183-18/+6Star
| | | | | | | | | | | | | | | | The syscall swapon() with two arguments is supported since Linux 1.3.2 and it's really long time ago... Let's assume that all libc header files have been already fixed. Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid: (bcache) cleanup magic string definitionKarel Zak2017-12-181-12/+8Star
| | | | | | | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* | cal: fix multi-byte comment, explain in better wayKarel Zak2017-12-181-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | On Sun, Dec 17, 2017 at 07:47:49PM -0500, J William Piggott wrote > * it contains multi-byte characters (which is what drew me to reading it). > * it truncates one very important piece of the formula: ". . . (mod 7)." > * it explains the values for 'e', but there is no 'e' in the code. > * it doesn't include a row resolving 'e' in the table, so it is not > obvious what it relates to in the code. > * without citing it as an external reference, the comment language is confusing. Co-Author: J William Piggott <elseifthen@gmx.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | whereis: fix typo in debug messageKarel Zak2017-12-141-1/+1
| | | | | | | | | | Reported-by: Matthew White <mehw.is.me@inventati.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* | Revert "cal: simplify leap year rule"Karel Zak2017-12-141-1/+5
| | | | | | | | | | | | | | It was mistake, we use extra rule for date < 1752 from the beginning and another calculations depends on this. This reverts commit b9bd8dc267a71611859496bff29e329868273714.
* | cal: explain magic values for day of week calculationKarel Zak2017-12-131-8/+16
| | | | | | | | | | | | Based on BERNDT E.SCHWERDTFEGER papers. Signed-off-by: Karel Zak <kzak@redhat.com>
* | fincore: fix a typo in fincore.1Masatake YAMATO2017-12-131-1/+1
| | | | | | | | Signed-off-by: Masatake YAMATO <yamato@redhat.com>
* | tests: update libsmartcols/titleKarel Zak2017-12-131-0/+4
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | libsmartcols: don't add blank padding after left aligned titleKarel Zak2017-12-121-4/+12
| | | | | | | | | | | | | | | | | | Let's use the same semantic for the title as for the last column in the table. If aligned on left, table is not "maxout" and title padding symbol is undefined (or blank) then keep title as short as possible. Addresses: https://github.com/karelzak/util-linux/issues/549 Signed-off-by: Karel Zak <kzak@redhat.com>
* | sample-scols-title: add left title without paddingKarel Zak2017-12-121-2/+14
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | mcookie: properly initialize hashKarel Zak2017-12-121-0/+1
| | | | | | | | | | | | This stupid mistake has been introduced by commit 46ae163a8e5dc8457f8e2828eb53db8e610af275. Signed-off-by: Karel Zak <kzak@redhat.com>
* | lib/md5: use ul_/UL_ prefixKarel Zak2017-12-127-60/+58Star
| | | | | | | | | | | | | | The symbols names are too generic. Addresses: https://github.com/karelzak/util-linux/issues/548 Signed-off-by: Karel Zak <kzak@redhat.com>
* | lib/sha1: fix indentionKarel Zak2017-12-121-232/+195Star
| | | | | | | | | | | | | | * indent -linux -psl -blf lib/sha1.c * manually fix comments Signed-off-by: Karel Zak <kzak@redhat.com>
* | test_sha1: update helperKarel Zak2017-12-121-6/+6
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | lib/sha1: use ul_/UL_prefix for symbolsKarel Zak2017-12-123-57/+38Star
| | | | | | | | | | | | | | | | Unfortunately, the symbols are visible in statically compiled libuuid and the names are too generic. Addresses: https://github.com/karelzak/util-linux/issues/548 Signed-off-by: Karel Zak <kzak@redhat.com>
* | Merge branch '2017wk48' of https://github.com/kerolasa/lelux-utiliteetitKarel Zak2017-12-111-11/+46
|\ \
| * | docs: improve setarch(8) manual pageSami Kerola2017-12-101-11/+46
| | | | | | | | | | | | | | | | | | | | | Add more information when and why one might want to use various options. Reviewed-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | | lib/timeutils.c: warn format_iso_time() overflowJ William Piggott2017-12-102-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Print a message when the format_iso_time() buffer is exceeded, because there is more than one type of failure that returns -1. Also remove the corresponding message from hwclock.c. Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | | lib/timeutils.c:strxxx_iso: do not wrap tm_yearJ William Piggott2017-12-091-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Year can wrap when adding the tm struct epoch during iso formatting: hwclock --utc --noadjfile --predict --date '67768034678844900 seconds' -2147481749-12-31 23:59:59.000000-05:00 Patched: hwclock --utc --noadjfile --predict --date '67768034678844900 seconds' 2147485547-12-31 23:59:59.000000-05:00 Comparable to date(1): date -Ins --date '67768034678844900 seconds' 2147485547-12-31T23:59:59,547886165-0500 Note: the 'seconds' argument is relative to the current time, so reaching this max year output is a moving target. The values shown above were invalid one second later. They then overflow tm_year upon conversion with localtime(3) and friends, which causes them to return NULL indicating that an error occurred. Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | | lib/timeutils.c:strxxx_iso: test conversion errorsJ William Piggott2017-12-091-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test for libc time conversion errors in ISO time format functions. hwclock --utc --noadjfile --predict --date '67768034678846520 seconds' Segmentation fault Patched: hwclock --utc --noadjfile --predict --date '67768034678846520 seconds' hwclock: time 67768036191695381 is out of range. Comparable to date(1): date --date '67768034678846520 seconds' date: time 67768036191695384 is out of range Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | | lib/timeutils.c: bug fix Segmentation faultJ William Piggott2017-12-091-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use reentrant time functions to avoid sending a NULL pointer to format_iso_time() (and to be reentrant ;). Followup commits test for errors and tm_year wrapping (illustrated below). hwclock --utc --noadjfile --predict --date '67768034678849400 seconds' Segmentation fault Patched hwclock --utc --noadjfile --predict --date '67768034678849400 seconds' -2147481748-01-00 00:10:46.000000-05:00 Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | tests: unlocks on failed ts_scsi_debug_initKarel Zak2017-12-071-5/+8
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: don't call tests with races in --parallelKarel Zak2017-12-072-50/+75
| | | | | | | | | | | | Some of the tests have a race by design (=wanted). Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: support multiple locksKarel Zak2017-12-071-6/+47
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>