| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
Improve usage strings for debug and version.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
| |
Adding V3 and V5 UUIDs per RFC-4122.
[kzak@redhat.com: - fix symbols file]
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
Use the usual facilities, add translation strings, move global variables at
the beginning of the file, make usage() look as expected, add standard
command-line option parsing.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
|
|
|
|
|
|
|
| |
This removes one small header file, and makes inline function to static to
only file it is used in.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The util-linux code was previously aligned to use @localstatedir@ and
the util-linux build system was set to override the default to use /run.
Current GNU Coding Standards introduced the @runstatedir@ variable
for this purpose. Lets use that instead.
The GNU default for @runstatedir@ is ${localstatedir}/run so util-linux
still override the default to be /run to preserve the status quo from
before. The only difference is that you'll now pass --runstatedir to
override the location on the command line instead of --localstatedir.
(FWIW, Debhelper in compat 11 will automatically start passing
--runstatedir=/run to all autotools configured builds. It already
passes --localstatedir=/var (to avoid it ending up with the GNU default
/usr/local/var) which breaks the util-linux build system code that
tries to default it to /run. This change will thus allow util-linux
and debhelper to work better together and avoid the need for a
package-specific override.)
Relevant historic commits:
* commit 07a16b9d1e5a48550a0d19abb9a900853433ffa2
"build-sys: change --localstatedir to /run"
* commit 80c51185d50f00a2701f9379f10fc48a0f885dfc
"uuidd: use run configured state directory"
* commit 01c5b787947aeaffc7e56000827e3edefa357c59
"agetty: use configured run state directory"
[kzak@redhat.com: - add $runstatedir fallback for autoconf < 2.70
- check for unmodified $localstatedir]
CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
Let's make the ioctls usable also for libfdisk.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
For some reason kernel commit e980f62353c697cbf0c4325e43df6e44399aeb64
add extra warning when the ioctl is used for DM devices. It seems we
can avoid this ioctl when the device has dm/uuid.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1469532
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
changed in include/c.h and applied via sed:
sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c")
sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c")
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 'path-fixes' of https://github.com/rudimeier/util-linux:
hwclock: don't ifdef printf arguments
setpriv: align --help
tools: add segfault detection for checkusage.sh
misc: avoid some dead initialization warnings
lscpu: make clang analyzer happy
lsmem: fix, using freed memory
lib/path: add error handling to path_vcreate()
lib/path: fix crash, pathbuf overflow
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Simply avoiding strdup(). Error handling improved.
This was the Clang Analyzer warning:
Memory Error, Use-after-free
sys-utils/lsmem.c:259:3: warning: Use of memory after it is freed
err(EXIT_FAILURE, _("Failed to open %s"), path);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before:
$ lscpu -s "$(tr '\0' 'x' < /dev/zero | head -c 10000)"
Segmentation fault (core dumped)
After:
$ lscpu -s "$(tr '\0' 'x' < /dev/zero | head -c 10000)"
lscpu: invalid argument to --sysroot: File name too long
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|/
|
|
|
|
|
|
| |
We assume that users will have a kernel >= 2.6.0 and removel
references to earlier kernels. There are still a few ones
left.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We change
-h, --help display this help and exit
-V, --version output version information and exit
to
-h, --help display this help
-V, --version print version
Some thoughts about this:
* use "display" for --help because it matches better if we
would add pager support (like git --help)
* "print" for --version to be different
* "this" for --help is important to make clear that running
--help would not give you any better information than the
one you see already
* remove "information and exit" because it's bloat for the
short-help, everybody knows what it does if it exists
In the manpages we should use the old, longer but more correct
descriptions, inclusive a reminder if --help/--version are only
working when used as the only option. Note the term "version
information" indicates that we don't only print a single version
number.
CC: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consolidate --help and --version descriptions. We are
now able to align them to the other options.
We changed include/c.h. The rest of this patch was
generated by sed, plus manually setting the right
alignment numbers. We do not change anything but
white spaces in the --help output.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts the include/c.h part of cc7cb070.
As discussed on ml. Our current strings are imported from
coreutils and not too bad. Also the old strings are still
hardcoded at many places.
So let's revert the change, then consolidate these strings
really everywhere and then think again whether and how we
should change them.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|\
| |
| |
| |
| |
| |
| |
| | |
* '170622' of github.com:jwpi/util-linux:
Docs: move option naming to howto-contribute.txt
Docs: update howto-usage-function.txt
Docs: add a comment for constants to boilerplate.c
include/c.h: add USAGE_COMMANDS and USAGE_COLUMNS
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* login-utils/lslogins.c: all uses changed
* misc-utils/findmnt.c: likewise
* sys-utils/blkzone.c: likewise
* disk-utils/sfdisk.c: likewise
* sys-utils/lscpu.c: likewise
* sys-utils/lsmem.c: likewise
* sys-utils/wdctl.c: likewise
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* 'fix-exit-codes' of https://github.com/rudimeier/util-linux:
misc: fix optutils.h related exit codes
misc: fix xalloc.h related exit codes
misc: fix more strutils related exit codes
lib: fix strutils.h, remove STRTOXX_EXIT_CODE
misc: fix some broken exit codes
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
As discussed on the mailing list. We fix all places
where the non-working define STRTOXX_EXIT_CODE was used.
Regarding tunelp, also see 7e3c80a7.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|/
|
|
|
|
|
| |
Nowadays all our regular commands have --help options.
test_uuidd does not use translations anyways.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
|
| |
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are using now the formerly unused function sun_pt_checksum(). This
cleanup was motivated by clang compiler warning, see below. Also nice
that we are now always using uint16_t instead of short.
Warning was:
../libfdisk/src/sun.c:177:35: warning: taking address of packed member 'csum' of class or structure 'sun_disklabel' may result in an unaligned pointer value
[-Waddress-of-packed-member]
while(ush < (unsigned short *)(&sunlabel->csum))
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
This affected cfdisk, fdisk, sfdisk, cal, dmesg and hexdump.
|
|
|
|
|
|
| |
All defined by libmount now.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
* '170415' of github.com:jwpi/util-linux:
optutils.h: don't print non-graph characters
hwclock: improve audit control
hwclock: --set and --predict segmentation fault
hwclock: make epoch functions alpha only
hwclock: improve default function handling
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There is no eloquent way to exclude/include arch dependent arguments
from the ul_excl_t array. So when an arch dependent argument is left
undefined err_exclusive_options() was printing out-of-bounds values.
This commit cause them to be skipped instead.
err_exclusive_options() shouldn't be printing out-of-bounds values
in any case.
Also change the error massage from 'options' to 'arguments' as some
programs, like hwclock, distinguish between options and functions.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current libfdisk code uses gettext() to translate strings. It
means it follows the default text domain (as set by textdomain(3)
usually in the main program). This is useless for public shared
library.
We have call private bindtextdomain() and use dgettext() with private
domain name to be independent on the main program. For this purpose
include/nls.h supports UL_TEXTDOMAIN_EXPLICIT to use dgettext().
Note that libfdisk will continue to use util-linux.po, rather than
keep the texts in the separate file.
The nls.h has to be included only from fdiskP.h to be sure that
nls.h works as expected for the library.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current agetty uses TIOCSTI ioctl to return already read chars
from login name back to the terminal (without read() before
tcsetattr() we will lost data already written by user). The ioctl
based solution is fragile due to race -- we can return chars when
terminal already contains another new chars. The result is reordered
chars in login name.
The solution is to use extra buffer for already read data.
Reported-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|\
| |
| |
| |
| |
| |
| |
| | |
* jwpi/hwclock-date7:
lib: add parse-date documentation
hwclock: use parse_date function
build-sys: add parse-date.y
lib: add parse-date.y
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* include/timeutils.h
Add parse-date API
* lib/parse-date.y - new file
Lib function that parses a date string into a timespec struct.
Derived from gnulib-dd7a871 parse-datetime.y with these changes:
* reduced to a single function API renamed to parse_date()
* removed gnulib dependencies
* removed debugging
* converted to util-linux coding style
* include/cctype.h - new file
Like ctype.h only hard coded to the 'C' locale.
Used by lib/parse-date.y.
Derived from gnulib-dd7a871 c-ctype.h with these changes:
* removed gnulib dependencies
* converted to util-linux coding style
* add requisite util-linux constants
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
./include/optutils.h:12:18: warning: null pointer dereference [-Wnull-dereference]
for (o = opts; o->name; o++)
~^~~~~~
In file included from libfdisk/src/dos.c:12:0:
./include/pt-mbr.h:25:47: warning: potential null pointer dereference [-Wnull-dereference]
return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
~^~~
Well these should be impossible, so add assert() to catch possible bugs.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
| |
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer
Since many 'struct option' has used zero as NULL make them more readable in
same go by reindenting, and using named argument requirements.
Reference: https://lwn.net/Articles/93577/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
Local timegm() is a replacement function in cases it is missing from libc
implementation. Hopefully the replacement is never, or very rarely, used.
CC: Ruediger Meier <ruediger.meier@ga-group.nl>
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* the variable definition with hidden type is always horrible, for
example:
int func() {
LIST_HEAD(foo);
...
}
the more readable is:
int func() {
struct list_head foo;
INIT_LIST_HEAD(&foo);
...
}
* the name LIST_HEAD conflict with /usr/include/sys/queue.h
* we use it only on two places in sulogin
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
The current default is to print all usage() output. This is overkill
in many case.
Addresses: https://github.com/karelzak/util-linux/issues/338
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Add code to print:
Try '<progname> --help' for more information.
and exit.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|