Commit Graph

15084 Commits

Author SHA1 Message Date
Karel Zak c3a6350335 tests: be explicit with file permissions for cramfs
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-09 18:02:13 +01:00
Karel Zak b6787fca02 libmount: fix /{etc,proc}/filesystems use
* always update context->helper
* consolidate helper and syscall status use

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-09 10:36:04 +01:00
Karel Zak d4b5887354 build-sys: add --disable-scriptutils
This new ./configure option disables script, scriptreplay ans
scriptlive.

Fixes: https://github.com/karelzak/util-linux/issues/1244
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-08 15:01:33 +01:00
Karel Zak f458782f14 libsmartcols: remove unnecessary code
Fixes: https://github.com/karelzak/util-linux/pull/1243
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-08 14:47:38 +01:00
Karel Zak 56fc4adac9 github: fix distcheck job
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-05 15:21:56 +01:00
Karel Zak 63900c506b github: add 'distcheck' workflow job
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-05 15:03:49 +01:00
Karel Zak ec89bec1cd Merge branch 'gh-actions-bionic' of https://github.com/mrc0mmand/util-linux
* '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
2021-02-05 10:29:26 +01:00
Karel Zak 0edc239542 build-sys: fix schedutils/sched_attr.h include
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-05 10:23:04 +01:00
Karel Zak 9c7a613c82 login: use full tty path for PAM_TTY
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>
2021-02-03 14:49:09 +01:00
Karel Zak 6165376737 su: use full tty path for PAM_TTY
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>
2021-02-03 14:45:15 +01:00
Karel Zak 82643a9be5 build-sys: cleanup uclampset dependencies
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>
2021-02-02 16:54:33 +01:00
Karel Zak f4b07719ee uclampset: cleanup --hel output
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-02 16:54:22 +01:00
Karel Zak 12d776c833 include/pathnames: cleanup /proc/sys/kernel use
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-02 16:54:12 +01:00
Karel Zak 9a823f1536 Merge branch 'uclampset-v3' of https://github.com/qais-yousef/util-linux
* '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
2021-02-02 16:53:50 +01:00
Qais Yousef 860112cb21 uclampset: Plumb in bash-completion
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-02-02 10:56:26 +00:00
Qais Yousef f59654bb06 uclampset: Plump into the build system
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-02-02 10:56:26 +00:00
Qais Yousef 9dd95bea42 uclampset: Add man page
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-02-02 10:56:26 +00:00
Qais Yousef 5407f89782 Add uclampset schedutil
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>
2021-02-02 10:56:26 +00:00
Ivan Mironov 5df455dbbc agetty: Allow --init-string on a virtual console
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>
2021-02-02 00:29:25 +05:00
Karel Zak d687a6b4b0 eject: cleanup before successful exit
Fixes: https://github.com/karelzak/util-linux/issues/1239
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-01 12:21:18 +01:00
Frantisek Sumsal f30ec3eee6 ci: run the build test for each pull request 2021-02-01 12:00:30 +01:00
Frantisek Sumsal eed6393d14 ci: build both w/ and w/o sanitizers on GH Actions 2021-02-01 12:00:30 +01:00
Frantisek Sumsal b17a386004 ci: code cleanup 2021-02-01 12:00:30 +01:00
Frantisek Sumsal 81edf9f0da ci: deal with uninstrumented binaries using instrumented libs
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.
2021-02-01 12:00:30 +01:00
Frantisek Sumsal c40b3cd03d text-utils: correctly detect ASan under clang
__SANITIZE_ADDRESS__ is not defined when compiling with clang, so cover
both use cases with a special set of macros
2021-02-01 11:59:47 +01:00
Frantisek Sumsal 0388289e3a ci: use the correct compiler version 2021-02-01 11:54:31 +01:00
Frantisek Sumsal 4076d51e2e ci: 'downgrade' Ubuntu version to Bionic
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
2021-01-30 19:11:23 +01:00
Qais Yousef ee3f4a3dfc Move sched_attr struct and syscall definitions into header file
So that we can re-use them in other files.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-01-30 17:13:17 +00:00
ToddRK deba6720fb fsck.cramfs: fix fsck.cramfs crashes on blocksizes > 4K
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>
2021-01-28 12:46:49 +01:00
Karel Zak 867df2617c lib: use ul_prefix for close_all_fds() and mkdir_p()
The names are too generic and it makes problems in static libraries.

Addresses: https://gitlab.com/cryptsetup/cryptsetup/-/issues/623
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-28 10:27:21 +01:00
Karel Zak 67f2918a6b github: enable ci-build for all basic branches
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-26 15:52:41 +01:00
Karel Zak ba8fbf21ef docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-26 15:51:26 +01:00
Karel Zak b94c187069 travis: remove old ubuntu
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>
2021-01-26 15:25:54 +01:00
Karel Zak bf32069382 github: make sure compiler is defined
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-26 12:39:22 +01:00
Karel Zak cf82a233eb github: CC fix export
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-26 12:09:01 +01:00
Karel Zak 025c43dfe1 github: export CC and CXX
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-26 11:56:33 +01:00
Karel Zak e589e25f19 tests: skip hwclock/systohc on GH Actions
It seems the delay on GH is too large to get proper result for this
tests. We already ignore it on Travis.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-26 11:54:38 +01:00
Karel Zak f9d7ed5517 tests: mark ul/basic as KNOWN_FAIL
It works locally and on Travis, but fail on Github Actions.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-26 11:39:10 +01:00
Karel Zak 8839d98089 tests: migrate from ext3 to ext2
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-26 11:11:14 +01:00
Karel Zak bf7e7d5c84 tests: dump more information about CFS and block devices
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-26 10:30:01 +01:00
Karel Zak 8b6019e65a github: remove distcheck
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-26 09:44:44 +01:00
Karel Zak 830a871e16 github: cleanup cibuild.sh
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-25 17:32:17 +01:00
Karel Zak 48575df6e8 github: fix btrfs package name
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-25 17:13:51 +01:00
Karel Zak 263db7f6bf github: fix cibuild typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-25 16:57:06 +01:00
Karel Zak 84cccd3eb5 github: add build workflow
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-25 16:54:38 +01:00
Karel Zak 7b78b571b7 libmount: allow --read-only for not-root users
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>
2021-01-25 11:11:05 +01:00
Karel Zak 34a58c05a7 travis: use verbose mode (V=1) for make
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-25 09:23:16 +01:00
Karel Zak 7397f2c1f9 build-sys: add restrict keyword fallback
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-22 13:28:02 +01:00
Karel Zak 33b09aebf5 libuuid: improve "restrict" keyword use
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>
2021-01-22 10:44:01 +01:00
Karel Zak 798608c842 Merge branch 'fix-vms' of https://github.com/Govelius/util-linux 2021-01-21 12:01:19 +01:00