* 'gh-actions-bionic' of https://github.com/mrc0mmand/util-linux:
ci: run the build test for each pull request
ci: build both w/ and w/o sanitizers on GH Actions
ci: code cleanup
ci: deal with uninstrumented binaries using instrumented libs
text-utils: correctly detect ASan under clang
ci: use the correct compiler version
ci: 'downgrade' Ubuntu version to Bionic
pam_set_item() man page:
PAM_TTY
The terminal name: prefixed by /dev/ if it is a device file;
for graphical, X-based, applications the value for this item
should be the $DISPLAY variable.
It seems for example pam_timestamp module is not robust enough to
differentiate between /dev/ and pty/0 and it assumes that '/' in the
path always means '/dev/' prefix ...
Fixes: https://github.com/karelzak/util-linux/issues/1242
Signed-off-by: Karel Zak <kzak@redhat.com>
pam_set_item() man page:
PAM_TTY
The terminal name: prefixed by /dev/ if it is a device file;
for graphical, X-based, applications the value for this item
should be the $DISPLAY variable.
It seems for example pam_timestamp module is not robust enough to
differentiate between /dev/ and pty/0 and it assumes that '/' in the
path always means '/dev/' prefix ...
Fixes: https://github.com/karelzak/util-linux/issues/1242
Signed-off-by: Karel Zak <kzak@redhat.com>
chrt requires sched_setattr() or sched_setscheduler(), the both is
covered by have_schedsetter variable in ./configure.ac. This variable
is useless for uclampset, because it requires sched_setattr(). Let's
make it more explicit for uclampset.
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'uclampset-v3' of https://github.com/qais-yousef/util-linux:
uclampset: Plumb in bash-completion
uclampset: Plump into the build system
uclampset: Add man page
Add uclampset schedutil
Move sched_attr struct and syscall definitions into header file
Utilization clamping is a new kernel feature that got merged in 5.3. It
allows controlling the performance of a process by manipulating the
utilization such that the task appears bigger or smaller than what it
really is.
There's a system-wide control to to restrict what maximum values the
process are allowed to use.
Man page added in a later patch attempts to explain the usage in more
detail.
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
This option has valid use cases on virtual consoles. Example:
enabling screen blanking in the same way as `setterm --blank ...`
does.
Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
All `eject` tests were failing under ASan, since they call /bin/mount,
which is uninstrumented, but it picks up the instrumented `libblkid`
library, causing ASan to complain:
gcc:
ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
eject: unmount of `/home/runner/work/util-linux/util-linux/tests/output/eject/umount-by-disk-mounted-mnt' failed
clang:
/bin/umount: symbol lookup error: /home/runner/work/util-linux/util-linux/.libs/libblkid.so.1: undefined symbol: __sancov_lowest_stack
eject: unmount of `/home/runner/work/util-linux/util-linux/tests/output/eject/umount-by-disk-mounted-mnt' failed
Subsequently, all tests which require the `scsi_debug` module get skipped,
since it's still in use due to the failed umount:
fdisk: align 512/4K ... SKIPPED (cannot remove scsi_debug module (rmmod))
fdisk: align 512/4K +alignment_offset ... SKIPPED (cannot remove scsi_debug module (rmmod))
fdisk: align 512/4K +MD ... SKIPPED (cannot remove scsi_debug module (rmmod))
In case of gcc this can be easily resolved by setting $LD_PRELOAD to the
respective ASan library. clang makes this a bit more difficult, since it
compiles the ASan library statically, so firstly we need to force dynamic
linking (via -shared-asan), and then add the runtime DSO path to the
linker cache, since it's in a non-standard path.
Since the current Ubuntu Focal image in GH Actions is missing the
`kernel-modules-extra` package with the `scsi_debug` module[0], let's
change the distro flag from `ubuntu-20.04` (Focal) to `ubuntu-latest`
(currently Bionic, as Focal is still in the beta phase).
[0] https://github.community/t/missing-scsi-debug-linux-kernel-module-on-gh-actions/157698
fsck.cramfs crashes when extracting a cramfs image with a 16KB blocksize.
The read_buffer is hardcoded for a 4KB blocksize. When using a blocksize
larger than 4KB, the program's code uses indexes that go past the end of the
allocated space for the read_buffer and this causes the crash.
The following changes fix the problem for me in the latest 2.36.1 release of
fsck.cramfs.c. However there are hardcoded values of 4096 in the code that
might cause problems under other circumstances and I have not attempted to
fix those.
[kzak@redhat.com: - some coding style changes to code]
Fixes: https://github.com/karelzak/util-linux/issues/1232
Signed-off-by: ToddRK <ToddRK@example.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Ubuntu 12.04 LTS (Precise Pangolin) -- from April 2012 to April 2017.
It's more and more difficult to keep code and tests in all details
compatible with it 4 years dead distro.
Signed-off-by: Karel Zak <kzak@redhat.com>
The command "mount -r" was supported for non-root users in very old
mount(8) versions. Unfortunately, in this case libmount replaces all
mount options from command line by options from fstab. We need
exception for MS_RDONLY.
Fixes: https://github.com/karelzak/util-linux/issues/1235
Signed-off-by: Karel Zak <kzak@redhat.com>
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 on travis-ci returns:
libuuid/src/unparse.c:42:67: error: ‘restrict’ undeclared here (not in a function)
libuuid/src/unparse.c: In function ‘uuid_fmt’:
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/wipefs.c: In function ‘main’:
misc-utils/wipefs.c:838:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
misc-utils/wipefs.c:838:3: note: use option -std=c99 or -std=gnu99 to compile your code
Signed-off-by: Karel Zak <kzak@redhat.com>
UINT64_MAX is 18446744073709551615, but 2^64 is 18446744073709551616.
We also need to use kbytes in all calculation in the test than bytes
as ipcs by default do not use bytes anymore.
Signed-off-by: Karel Zak <kzak@redhat.com>