It seems better to ignore this option than drop-permissions and later
exit with EPERMs. This change makes umount(8) more compatible with
fuser user umounts by systemd where -c is used to reduce overhead etc.
Addresses: https://github.com/karelzak/util-linux/issues/1192
Signed-off-by: Karel Zak <kzak@redhat.com>
This allows the rest of the programs using cap_last_cap to trust the
value returned by it, since it will either be obtained from procfs
(straight from kernel) or with prctl.
Also checked if the file under /proc is actually mounted in a procfs.
It should be safe assumption a command related to floppy disks does not
need to be part of default build. Notice that the reference commit removed
floppy driver from linux about year ago. Virtual floppies might exist they
should not need low-level formatting. But if someone really needs this
enabling the build in that case is better than pushing the binary by
default to many many systems that install util-linux.
Reference: 47d6a76074
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Before this change the error message about directory was not informative,
and a little bit out of place.
$ touch empty ; ./more ./empty /
::::::::::::::
./empty
::::::::::::::
magic failed: cannot read fd 4 (Is a directory)
::::::::::::::
/
::::::::::::::
After the change messaging is reverted back to what it used to be.
$ ./more ./empty /
::::::::::::::
./empty
::::::::::::::
*** /: directory ***
And while on it lets remove repeated fstat() call.
Fixes: 09070e1a65
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Short options had all sortss of characters listed, that were clearly copied
from col(1) command getopt_long() invocation. Luckily both -V and -h were
part of the short options, but lets get rid of the unnecessary ones.
Fixes: 1647d032a7
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Without this two error messages are printed when rfkill device
cannot be opened.
$ rfkill
rfkill: cannot open /dev/rfkill: No such file or directory
rfkill: cannot read /dev/rfkill: Bad file descriptor
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Fixex two yamllint indentation warning, the truthy is false positive.
util-linux $ yamllint ./.github/workflows/cifuzz.yml
6:1 warning truthy value should be one of [false, true] (truthy)
14:2 error wrong indentation: expected 2 but found 1 (indentation)
22:4 error wrong indentation: expected 5 but found 3 (indentation)
Reference: https://github.com/adrienverge/yamllint
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
As mentioned in 'Generating optimal glyphs' title in the manual page
mentioned in reference:
Where a proper caret (^) that renders well in both a terminal and PDF is
required, use "\(ha".
Using a naked "~" character results in a poor rendering in PDF. Instead
use "\(ti".
Reference: https://man7.org/linux/man-pages/man7/man-pages.7.html#STYLE_GUIDE
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
After commit: 367c85c47 ("lscpu: use SMBIOS tables on ARM for lscpu"),
Model name for A64FX shows like as:
Model name: 461F0010
That's because 367c85c47 changes to get the modelname from Processor
Version of SMBIOS.
To fix that, use the hard corded table to show the "Model name" and
add two new lines; "BIOS Vendor ID" and "BIOS Model name" to show the
SMBIOS information.
lscpu shows the SMBIOS information when root user runs it because
accessing the SMBIOS information requires root privilege.
[kzak@redhat.com: - port the patch to new lscpu code]
Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Over the past two years Arm has published further MIDR/part numbers
on https://developer.arm.com/ip-products/processors/cortex-a.
Lets sync the arm_part structure for A65, A76AE, A77 and A78*.
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Port commit
commit 6cb8af7be2
Author: Jiaxun Yang <jiaxun.yang@flygoat.com>
Date: Sat Mar 28 12:19:42 2020 +0800
to new lscpu code.
References: 6cb8af7be2
Signed-off-by: Karel Zak <kzak@redhat.com>
Port commit
commit 318542e060
Author: Sumanth Korikkar <sumanthk@linux.ibm.com>
Date: Fri Jun 5 18:15:10 2020 +0200
to new lscpu code.
References: 318542e060
Signed-off-by: Karel Zak <kzak@redhat.com>
ntypes greater than 1 is valid in some hardware configurations, and an assert()
on the value isn't necessary or very future proof
[kzak@redhat.com: - port this patch to new code]
Signed-off-by: Karel Zak <kzak@redhat.com>
* cpu MHz is per-CPU value and not printed in summary anymore
* topology is reordered
* number of NUMA nodes is moved to NUMA section
* parsable output uses cache ID from kernel if avalable
Signed-off-by: Karel Zak <kzak@redhat.com>
* keep global (cputype) bogomips
* add per-CPU bogomips
* use bogomips from the first CPU as global (for cputype) if /proc/cpuinfo does not provide global bogomips
* add BOGOMIPS column for to -e/-p output
Signed-off-by: Karel Zak <kzak@redhat.com>
Let's make it more robust and readable. The sysinfo file on s390 may
contain zeros, so we need to check the values and fallback to data
from shared maps if necessary.
Signed-off-by: Karel Zak <kzak@redhat.com>
Note that cxt->ncaches is number of all instances, but we split
output according to split output according to caches names.
Signed-off-by: Karel Zak <kzak@redhat.com>
The file /sys/devices/system/cpu/cpu*/cache/index*/id is not available
in old kernels. This patch add code to generate IDs according to cache
type and level.
Signed-off-by: Karel Zak <kzak@redhat.com>
* keep one sharedmap per cache instance
* initialize topology IDs to -1
* rewrite -e code to use a new data structs
Signed-off-by: Karel Zak <kzak@redhat.com>
The Dynamic and Static MHz are /proc/cpuinfo s390 per-CPU fields, but
we display it as a single value according the first parsed CPU. For
this purpose we store the values from the first CPU in lscpu_cputype.
For -p and -e outputs we will print per CPU values.
Signed-off-by: Karel Zak <kzak@redhat.com>