disk-utils/cfdisk.c:1066:29: error: cannot size expression
One should use sizeof() only when variable size can be known at time of
compilation. That is not the case with variable length arrays.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
[kzak@redhat.com: - rename --dry-run to --no-act]
Signed-off-by: Alexander F Rødseth <xyproto@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
Tell in manual page what ZAC and ZBC acronyms mean. Include explanation to
blkreport output, so that users do not need to search source code to
understand what the tool informed. And fix couple dot double space issues.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Set variables read-only where possible. Fix few code style issues, mostly
with spacing. Avoid initializing variables if they are never read before
next update. Remove "ERR: %d -> %s" message that repeated system error
three times, twice in that message and once at end of main that is the only
of these three left in place.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The pid 0 is technically correct, but very confusing for end users. Use
getpid() in the messages.
Addresses: https://github.com/karelzak/util-linux/issues/413
Signed-off-by: Karel Zak <kzak@redhat.com>
* "LBA" sounds confusing
* alignment check is unnecessary for report ioctl
Reported-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Each option plus its description should be a separate translatable
string. And, if all is well, blkreport should not discard anything
-- that is: fix the cut-and-paste error from blkdiscard.
Additionally, tweak some wordings.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
This patch adds:
- blkreset to issue Reset (Write Pointer) zone commands
- blkreport to retrieve drive zone information
[kzak@redhat.com: - cleanup man page and usage()
- remove command line options aliases,
- use strtosize_or_err()
- remove unnecessary -ludev
- use blkdev.h stuff]
Signed-off-by: Shaun Tancheff <shaun@tancheff.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'hwclock-jwp-reviewed' of git://github.com/kerolasa/lelux-utiliteetit: (25 commits)
hwclock: remove --compare option
hwclock: remove trailing dot from messages that include system error message
hwclock: make --date=argument less prone to injection
hwclock: fix rtc atexit registration
hwclock: clarify cmos inb and outb preprocessor directives
hwclock: try RTCGET and RTCSET only when normal rtc fails
hwclock: stream line synchronize_to_clock_tick_rtc()
hwclock: improve coding style
hwclock: remove division by zero [asan]
hwclock: add debugging to open_rtc()
hwclock: remove magic constants from interpret_date_string()
hwclock: use symbolic magic values passed in between functions
hwclock: initialize struct adjtime members
hwclock: alloate date_resp parsing buffer in interpret_date_string()
hwclock: simplify save_adjtime() execution flow
hwclock: remove dead code and other minor fixes
hwclock: move error messages to determine_clock_access_method()
hwclock: clarify set_cmos_epoch() code
hwclock: move command-line options to control structure
hwclock: remove unnecessary type casts
...
Compare functionality was printing nonsense values. There is no knowledge
of anyone using this broken functionality. Instead of deprecating the code
for months, and removing it after few release, it is removed immediately.
Needless to say this is unusual removal.
Reference: http://marc.info/?l=util-linux-ng&m=148396210506652&w=2
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This change should not improve security much. One hopes hwclock --set is
restricted for root only. Where hwclock is allowed to run via sudo, or has
setuid setup, there is a pretty easy privilege escalation via subshell.
$ sudo ./hwclock --set --date='2000-10-20$(touch /tmp/hwclock.inject)'
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Commit 27f9db17bd missed a minus sign from
comparison.
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The cmos only works when architecture is i386, x86_64, or alpha.
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Make string constants to be symbolical declarations. Use longer variable
name for rtc and cmos function pointer values. Exclude code that is
architecture specific with preprocessor directives. And remove message
duplication.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>