BSD fix missed for 22 years, and all util-linux releases so far.
Backported-from: 2a15260a2a
Addresses: https://github.com/karelzak/util-linux/issues/422
Reported-by: Pavel Raiskup <praiskup@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The wipe operation is potentially dangerous. Let's inform about it
always by 'p' (list) command to make sure user knowns about it.
Command (m for help): p
...
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 204799 202752 99M 83 Linux
Filesystem/RAID signature on partition 1 will be wiped.
Addresses: https://github.com/karelzak/util-linux/issues/437
Signed-off-by: Karel Zak <kzak@redhat.com>
Now we use libsmartcols for the default output and all is allocated in
the smartcols table. So, we can reuse the same buffer for all
sprintf/scanf calls.
Signed-off-by: Karel Zak <kzak@redhat.com>
Problem:"lscpu frequency-info" command was always reading CPU0
max and min frequencies. If CPU0 is guarded or offline then it used to
display max and min frequencies as NULL.
This patch will read overall CPU max and min frequencies.
Test Results:
Before Patch:
#lscpu (CPU0 is guarded/offline)
Architecture: ppc64le
Byte Order: Little Endian
CPU(s): 120
On-line CPU(s) list: 8-127
Thread(s) per core: 8
Core(s) per socket: 3
Socket(s): 4
NUMA node(s): 4
Model: 2.1 (pvr 004b 0201)
Model name: POWER8E (raw), altivec supported
CPU max MHz: (null)
CPU min MHz: (null)
L1d cache: 64K
L1i cache: 32K
L2 cache: 512K
L3 cache: 8192K
NUMA node0 CPU(s): 8-31
NUMA node1 CPU(s): 32-63
NUMA node16 CPU(s): 64-95
NUMA node17 CPU(s): 96-127
With Patch:
# ./lscpu
Architecture: ppc64le
Byte Order: Little Endian
CPU(s): 120
On-line CPU(s) list: 8-127
Thread(s) per core: 8
Core(s) per socket: 3
Socket(s): 4
NUMA node(s): 4
Model: 2.1 (pvr 004b 0201)
Model name: POWER8E (raw), altivec supported
CPU max MHz: 4322.0000
CPU min MHz: 2061.0000
L1d cache: 64K
L1i cache: 32K
L2 cache: 512K
L3 cache: 8192K
NUMA node0 CPU(s): 8-31
NUMA node1 CPU(s): 32-63
NUMA node16 CPU(s): 64-95
NUMA node17 CPU(s): 96-127
[kzak@redhat.com: - cpu_{max,min}_mhz() refactoring]
Signed-off-by: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
* '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
The readline offers editing capabilities while the user is entering the
line, unlike fgets(3) and getline(3) that were used earlier.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Hopefully these changes are unreachable code, but better safe than sorry
when dealing with setuid root code that is installed everywhere. Quite
obviously the introduced abort() calls protect from impossible inputs.
Secondly set all possible data to be read-only in attempt to make it more
difficult to alter anything at all.
Reference: https://www.securecoding.cert.org/confluence/display/c/DCL00-C.+Const-qualify+immutable+objects
Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This new function can be use to enquiry what partition names libblkid is
aware of. First use of this information will be in partx(8) to make bash
completion to work without a magic list.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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: 51410fc6de
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Option --pid was never implemented so remove it from struct options and
manual page. Interestingly this option was not in usage(). Short option
string had 'u' that has never appear anywhere else, so it is also removed.
Finally add options --bytes and --numeric-perms to manual page.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>