| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The old deprecated list output format ("-o list") copies gettex string
into fixed buffer, that's really bad idea.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Let's consolidate the version printing code. It also seems better to
use exit() after --version, because it's handled in different way by
ASAN.
It's strange, but ASAN reports leaks after return in main(). Note that
we do not use free-before-exit.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
blkid(8) returns information from partition table also for empty
partitions. This is necessary for example for udev, but it could be
confusing if you care about on-device content only.
Default:
# blkid -p /dev/md0p1; echo $?
/dev/md0p1: PART_ENTRY_SCHEME="dos" PART_ENTRY_UUID="6d8796b1-01" PART_ENTRY_TYPE="0x83" PART_ENTRY_NUMBER="1" PART_ENTRY_OFFSET="2048" PART_ENTRY_SIZE="204800" PART_ENTRY_DISK="9:0"
0
With --no-part-details:
# blkid -p /dev/md0p1 --no-part-details; echo $?
2
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1653413
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
| |
This applies also for LABEL_FATBOOT which contains bytes according to DOS
code page and therefore does not contain valid UTF-8 sequence.
Signed-off-by: Pali Rohár <pali.rohar@gmail.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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 patch is trivial and changes nothing, because
we were always using usage(0).
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
* '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
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Found by:
grep -L "XALLOC_EXIT_CODE" $(grep -l "xalloc\.h" \
$(git grep -l "_EX_\|FINDFS_\|BLKID_EXIT\|EX_USAGE" -- "*.c"))
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
|
| |
We have a --help option and this is preferred.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* '2017wk16' of git://github.com/kerolasa/lelux-utiliteetit:
chfn, chsh: use readline(3) to receive user input
findfs: use getopt_long() to parse options
logger: make month names, login name, and tag read-only objects
sulogin: reduce vulnerability surface
partx: add --list-types option
libblkid: add blkid_partitions_get_name()
docs: try to convince open(2) O_DIRECT rather than using raw device
blkid: add long options
lsipc: fix options parsing and sync with man page
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change attempts to make tab completion more reasonable by alloging
memorizable option names. That also has positive impact to manual page, in
which referrals to other options are now easier to understand.
All short options are kept exactly as they were to avoid ABI breakage. The
only exception is -f option that getopt(3) recognized, but was not found
from anywhere else. The -f has been part of blkid since the initial commit.
Commit: 51410fc6deb29cae54a2669aafabae6c49f964fc
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|/
|
|
| |
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
|
|
|
|
|
|
| |
Let's also hide the show[] array in has_item().
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without obvious reason blkid has managed to be part of this project for
pretty long time without getting translations. Lets change that. In same
go use the usual error printing facilities instead of fprintf(stderr, ...);
[kzak@redhat.com: - use errtryh(),
- cleanup "unsupported output format"]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Some say people read do-while statements are easily as while statements and
get wrong impression. This happens because do-whiles are not common.
Adding braces should make it easier to read the code.
Reference: http://www.spinics.net/lists/linux-kernel-janitors/msg02018.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
| |
text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be
static?
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
| |
Fix various typos in error messages, warnings, debug strings,
comments and names of static functions.
Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Almost any code calling get_terminal_width() checks returned width for
non-positive values and sets it to some default value (say, 80). So,
let's pass this default value directly to the function.
[kzak@redhat.com: - get_terminal_width() refactoring]
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
These headers are in use allover this project without issues.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
# blkid -p /dev/sdc1; echo $?
2
but libblkid provides information about partition, fixed version:
# blkid -p /dev/sdc1; echo $?
/dev/sdc1: PART_ENTRY_SCHEME="dos" PART_ENTRY_UUID="4c1e518c-01" PART_ENTRY_TYPE="0x83" PART_ENTRY_NUMBER="1" PART_ENTRY_OFFSET="2048" PART_ENTRY_SIZE="1021952" PART_ENTRY_DISK="8:32"
0
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The high-level libblkid API uses /run/blkid/blkid.tab cache to
store probing results. The cache format is
<device NAME="value" ...>devname</device>
and unfortunately the cache code does not escape quotation marks:
# mkfs.ext4 -L 'AAA"BBB'
# cat /run/blkid/blkid.tab
...
<device ... LABEL="AAA"BBB" ...>/dev/sdb1</device>
such string is later incorrectly parsed and blkid(8) returns
nonsenses. And for use-cases like
# eval $(blkid -o export /dev/sdb1)
it's also insecure.
Note that mount, udevd and blkid -p are based on low-level libblkid
API, it bypass the cache and directly read data from the devices.
The current udevd upstream does not depend on blkid(8) output at all,
it's directly linked with the library and all unsafe chars are encoded by
\x<hex> notation.
# mkfs.ext4 -L 'X"`/tmp/foo` "' /dev/sdb1
# udevadm info --export-db | grep LABEL
...
E: ID_FS_LABEL=X__/tmp/foo___
E: ID_FS_LABEL_ENC=X\x22\x60\x2ftmp\x2ffoo\x60\x20\x22
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ blkid | egrep -i 'sda.*label' | cat -A
/dev/sda2: UUID="8382f307-fb43-489f-ab38-8d4cf37ca88c" SEC_TYPE="ext2" TYPE="ext3" LABEL="test" $
/dev/sda5: UUID="0b46d673-8c23-4709-b92c-3fdf460e1dd4" TYPE="ext3" LABEL="rescue" SEC_TYPE="ext2" $
/dev/sda6: UUID="cb9d814f-d885-435b-8e6d-ac17c0ac5aa1" TYPE="ext3" LABEL="root" $
/dev/sda8: UUID="1e2851bd-cc6f-4d72-bf9f-c6fa754155b1" TYPE="ext3" LABEL="data" SEC_TYPE="ext2" $
/dev/sda9: UUID="d16a2f42-9a50-4489-a788-8624c832a7f3" TYPE="ext3" LABEL="storage" SEC_TYPE="ext2" $
/dev/sda7: TYPE="swap" LABEL="swap" UUID="8393acfa-d4bd-40fc-8eb9-5ccd8d85e103" $
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586179
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
This reverts commit 0fd4b8132587a264f1e0df46eec7c12bba68c752.
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
# e2label /dev/loop0 'La"bel'
# blkid -p /dev/loop0
/dev/loop0: LABEL="La"bel" ....
new version:
/dev/loop0: LABEL="La\"bel" ....
Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
| |
... to make "strace -e open blkid" for libblkid stuff without
exceptions.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
|
|
|
|
| |
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
| |
misc-utils/blkid.c:402:15: warning: declaration of 'usage' shadows a global declaration [-Wshadow]
misc-utils/blkid.c:63:13: warning: shadowed declaration is here [-Wshadow]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
| |
[misc-utils/blkid.c:367]: (error) Common realloc mistake: 'str' nulled but not freed upon failure
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|