summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | include: update pathnames.hJ William Piggott2017-06-211-24/+12Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * use /dev/rtc0 (/dev/rtc was for the 'old' driver) * remove hwclock Award workaround and alpha cmos paths * relocate _PATH_BTMP from hwclock to login-utils * add a comment for _PATH_BTMP and fix other login-utils comments * add a comment for proc/cpuinfo * remove empty shutdown.c comment from 4d43977f Review changes * remove 'used in' comments * white space fixes Reviewed-by: Karel Zak <kzak@redhat.com> Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | hwclock: add usage() functions headingJ William Piggott2017-06-213-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make a functions heading, similar to the existing options heading. * include/c.h: define USAGE_FUNCTIONS * Documentation/boilerplate.c: add USAGE_FUNCTIONS * sys-utils/hwclock.c add functions header to usage() Reviewed-by: Karel Zak <kzak@redhat.com> Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | hwclock: update usage() FILE nameJ William Piggott2017-06-211-22/+22
| | | | | | | | | | | | | | | | | | Use the util-linux standard file name instead of 'usageto'. Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | hwclock: update usage() to util-linux styleJ William Piggott2017-06-211-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | Update usage() according to: Documentation/howto-usage-function.txt Documentation/boilerplate.c Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | hwclock: remove dead code in usage()J William Piggott2017-06-211-25/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | Commit 677ec86 caused usage() to be called only by --help. So remove the now dead code from usage(). Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | | build-sys: make chown usage more robustKarel Zak2017-06-213-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | * add --disable-makeinstall-chown to travis non-root mode * use "if MAKEINSTALL_DO_SETUID" for chown root:root Signed-off-by: Karel Zak <kzak@redhat.com>
* | | wipefs: exit on failed eraseKarel Zak2017-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current behavior is to report error and continue, it seems strange: # blockdev --setro /dev/sdc # wipefs -a /dev/sdc wipefs: /dev/sdc: failed to erase xfs magic string at offset 0x00000000: Operation not permitted /dev/sdc: 4 bytes were erased at offset 0x00000000 (xfs): 58 46 53 42 ^^^^^^^^^^^ not true The patch calls err() to exit. Reported-by: Vratislav Podzimek <vpodzime@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | | build-sys: chown before chmod for SUIDsKarel Zak2017-06-202-0/+3
| | | | | | | | | | | | | | | | | | | | | Make sure SUIDs are really owned by root. Reported-by: L A Walsh <lkml@tlinx.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* | | libmount: ignore "bind" from fstab on command line "remount"Karel Zak2017-06-202-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code always apply all flags from /etc/fstab on remount. Unfortunately remount+bind has special semantic and it's impossible from command line to avoid interaction with the "bind" from fstab. Example, fstab: /dev/sda1 /bar ext4 defaults 0 1 /bar /foo none bind 0 0 Command line: # mount /foo -o remount,rw produces: mount(... MS_REMOUNT|MS_BIND ) syscall This changes the per-mountpoint (VFS) ro flag to rw, but doesn't change the filesystem itself. This patch forces libmount to ignore "bind" from fstab when "-o remount" specified on command line. If you need remount+bind semantic you have to specify the "bind" flag on command line. This allow to differentiate between # mount /foo -o remount,bind,rw --> mount(MS_REMOUNT|MS_BIND) and # mount /foo -o remount,rw --> mount(MS_REMOUNT) Suggested-by: NeilBrown <neilb@suse.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | | dmesg: fragment concatenationVinnie Magro2017-06-201-7/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When extended console is enabled, the kernel doesn't internally concatenate message fragments, this change adds log fragment concatenation to dmesg: instead of being printed as separate messages, fragments are combined onto one line and printed with the timestamp of the first line. This doesn't work in all cases - such as if another message is logged in between two fragment lines, but in this case the behavior matches the previous output format (printed on the separate lines). [kzak@redhat.com: - rename kmsg_read_buf to kmsg_saved_size, - minor coding style fixes] Signed-off-by: Vinnie Magro <vmagro@fb.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | | Merge branch '170424' of github.com:jwpi/util-linuxKarel Zak2017-06-201-103/+77Star
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '170424' of github.com:jwpi/util-linux: parse-date: time_zone_hhmm() bug fixes parse-date: remove unused ordinal_day_seen parse-date: remove unused year_seen parse-date: refactor tm_diff() parse-date: use to_uchar() instead of assignment. parse-date: use uintmax_t where appropriate parse-date: use int where appropriate parse-date: use intmax_t where appropriate parse-date: remove unused EPOCH_YEAR parse-date: replace ISDIGIT with c_isdigit
| * | parse-date: time_zone_hhmm() bug fixesJ William Piggott2017-06-151-35/+33Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix incorrect arg type used for abs(). * prevent integer arithmetic overflow by limiting offset to 4 digits. * don't accept malformed offset values like: -4:3 +12:719 +0000001:23 -9:00000001 +0000001123 Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Influenced-by: gnulib 30784c4 Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | parse-date: remove unused ordinal_day_seenJ William Piggott2017-06-151-6/+0Star
| | | | | | | | | | | | Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | parse-date: remove unused year_seenJ William Piggott2017-06-151-3/+0Star
| | | | | | | | | | | | Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | parse-date: refactor tm_diff()J William Piggott2017-06-151-3/+2Star
| | | | | | | | | | | | | | | | | | Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Influenced-by: gnulib 30784c4 Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | parse-date: use to_uchar() instead of assignment.J William Piggott2017-06-151-4/+2Star
| | | | | | | | | | | | | | | | | | Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Influenced-by: gnulib 30784c4 Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | parse-date: use uintmax_t where appropriateJ William Piggott2017-06-151-4/+4
| | | | | | | | | | | | | | | | | | Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Influenced-by: gnulib 30784c4 Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | parse-date: use int where appropriateJ William Piggott2017-06-151-6/+6
| | | | | | | | | | | | | | | | | | Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Influenced-by: gnulib 30784c4 Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | parse-date: use intmax_t where appropriateJ William Piggott2017-06-151-28/+28
| | | | | | | | | | | | | | | | | | Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Influenced-by: gnulib 30784c4 Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | parse-date: remove unused EPOCH_YEARJ William Piggott2017-06-151-1/+0Star
| | | | | | | | | | | | | | | | | | Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Influenced-by: gnulib 30784c4 Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * | parse-date: replace ISDIGIT with c_isdigitJ William Piggott2017-06-151-18/+7Star
| | | | | | | | | | | | | | | | | | Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Influenced-by: gnulib 30784c4 Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | | tests: add MBR resize testsKarel Zak2017-06-195-0/+183
| | | | | | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | libfdisk: support logical partition resizeKarel Zak2017-06-191-1/+11
| | | | | | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | libfdisk: allow to resize containerKarel Zak2017-06-191-1/+8
| | | | | | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | libfdisk: add more debug messages to get-last-possible resize spaceKarel Zak2017-06-191-6/+21
| | | | | | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | libfdisk: (dos) be more verbose on partno -ERANGE errorKarel Zak2017-06-192-4/+10
| | | | | | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | mount: fix man page typo (--bind,ro)Karel Zak2017-06-191-1/+1
| | | | | | | | | | | | | | | Addresses: https://github.com/karelzak/util-linux/issues/464 Signed-off-by: Karel Zak <kzak@redhat.com>
* | | libfdisk: (dos) fix primary/logical logic when follow templateKarel Zak2017-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | This stupid bug has been introduced by e1cfb304 (v2.30) and it disables to create extended partition by cfdisk :-( Signed-off-by: Karel Zak <kzak@redhat.com>
* | | Merge branch 'some-fixes' of https://github.com/rudimeier/util-linuxKarel Zak2017-06-1613-67/+144
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | * 'some-fixes' of https://github.com/rudimeier/util-linux: travis: minor cosmetics lib: style cosmetics plymouth-ctrl.c libmount: fix warning "set but not used" more: remove unused variable tests: split partx in root and non-root tests: fix and refactor partx
| * | travis: minor cosmeticsRuediger Meier2017-06-152-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is just to make the diff to my private travis script a bit smaller. Now we always use $CC _after_ the install script which makes it possible to install/update the compiler in the install section. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | lib: style cosmetics plymouth-ctrl.cRuediger Meier2017-06-151-11/+7Star
| | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | libmount: fix warning "set but not used"Ruediger Meier2017-06-151-4/+2Star
| | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | more: remove unused variableRuediger Meier2017-06-151-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | slow_tty is at least unused since util-linux 2.2. FYI here is another derived more.c where slow_tty is still used: https://github.com/sergev/LiteBSD/blob/master/old/more/more.c Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | tests: split partx in root and non-rootRuediger Meier2017-06-157-16/+43
| | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | tests: fix and refactor partxRuediger Meier2017-06-152-34/+87
| |/ | | | | | | | | | | | | | | Subtest delete-non-existent was broken because since 2d47fa39 option --nr was missing. It wasn't noticed because we did not check stderr. Now we check all return values and output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | fstrim: remove obsolete commentKarel Zak2017-06-151-1/+1
| | | | | | | | | | | | We do not de-duplicate by FS root (since afa382f2e087b71c9e626144f2f313abc42ad594). Signed-off-by: Karel Zak <kzak@redhat.com>
* | fstrim: prefer earlier mounted filesystemsAlex Ivanov2017-06-151-1/+1
|/ | | | | | | | | | | | | | | | | | | fstrim --all is broken in a way that if there is a bind mount for some filesystem, that filesystem will not be trimmed. This is especially critical for e.g. NixOS distribution, which needs bind mount within root fs: https://github.com/NixOS/nixos/blob/master/modules/system/boot/stage-2-init.sh#L55 Currently for a given filesystem during "de-duplication by source and root" phase, an early mounted fs path is filtered (e.g. "/"), while later mounted fs path is kept (e.g. "/nix/store") though anyway discarded later (since it's an overlaying mount). This leads to skipped trimming. So flip this behaviour. Should also help for other types of overlaying mounts. Reference: https://github.com/karelzak/util-linux/blob/stable/v2.29/libmount/src/tab.c#L715 Signed-off-by: Alex Ivanov <yourbestfriend@openmailbox.org>
* wall: don't use gid_t when allocate grounps arrayKarel Zak2017-06-141-1/+1
| | | | | Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: remove _RLD_ from forbid environment variable listSami Kerola2017-06-141-1/+0Star
| | | | | | | | | | | The RLD environment variables are related to runtime linker vulnerability in TELNET on systems running Silicon Graphics IRIX. It is extremely unlikely current util-linux would be compiled on such system. Reference: http://www.cert.org/historical/advisories/CA-1995-14.cfm Reference: http://signatures.juniper.net/documentation/signatures/TELNET%3AEXPLOIT%3ASGI-RLD.html Refefence: http://www.polarhome.com/service/man/?qf=rld&tf=2&of=IRIX&sf=1 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib: simplify cpuset if clauses that returnSami Kerola2017-06-141-7/+5Star
| | | | | | | | There is no need for 'else' when 'if' will return. In same go move call of tolower() to last possible moment in char_to_val(), a lot of time hex values should hit 0-9 range, and it can be omitted. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: remove stray semicolonsSami Kerola2017-06-1410-11/+11
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* losetup: add missing initializer [clang]Sami Kerola2017-06-141-1/+1
| | | | | | | | | | | sys-utils/losetup.c:290:12: warning: variable 'rc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] sys-utils/losetup.c:293:7: note: uninitialized use occurs here sys-utils/losetup.c:290:8: note: remove the 'if' if its condition is always true sys-utils/losetup.c:228:9: note: initialize the variable 'rc' to silence this warning Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: fix reassigned values before old ones has been used [cppcheck]Sami Kerola2017-06-1417-23/+23
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* isosize: avoid reading more data than what is neededSami Kerola2017-06-141-47/+10Star
| | | | | | | | | | | In same go fix error reporting when input file is not long enough. $ touch empty $ isosize empty isosize: empty: might not be an ISO filesystem isosize: read error on empty: Success Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* uuidgen: slice up the usage textSami Kerola2017-06-141-5/+5
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* rename: notice when expression and replacement are the same stringSami Kerola2017-06-141-0/+3
| | | | | | | | The rename(1) can exit early when replace expression and replacement are identical string. It is also appropriate to change return value in this case to 'nothing was renamed'. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Merge branch 'master' of ra.kernel.org:/pub/scm/utils/util-linux/util-linuxKarel Zak2017-06-140-0/+0
|\
| * Merge branch 'sami-fallthrough' of https://github.com/rudimeier/util-linuxKarel Zak2017-06-1316-22/+26
| |\ | | | | | | | | | | | | * 'sami-fallthrough' of https://github.com/rudimeier/util-linux: misc: fix ggc-7 fallthrough warnings
| | * misc: fix ggc-7 fallthrough warningsSami Kerola2017-06-1316-22/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Original patch and commit message edited by Rudi.) gcc-7 adds -Wimplicit-fallthrough=3 to our default flag -Wextra. This warning can be silenced by using comment /* fallthrough */ which is also recognized by other tools like coverity. There are also other valid comments (see man gcc-7) but we consolidate this style now. We could have also used __attribute__((fallthrough)) but the comment looks nice and does not need to be ifdef'ed for compatibility. Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652 Reference: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ Reviewed-by: Ruediger Meier <ruediger.meier@ga-group.nl> Suggested-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | | wall: fix OSX getgrouplist, gid_t* vs int*Karel Zak2017-06-141-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was the compiler warning: term-utils/wall.c:156:39: warning: passing 'gid_t *const' (aka 'unsigned int *const') to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign] rc = getgrouplist(login, pw->pw_gid, buf->groups, &ngroups); ^~~~~~~~~~~ /usr/include/unistd.h:653:43: note: passing argument to parameter here int getgrouplist(const char *, int, int *, int *); ^ Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl> Signed-off-by: Karel Zak <kzak@redhat.com>