Commit Graph

798 Commits

Author SHA1 Message Date
Karel Zak 1f4009146a build-sys: release++ (v2.36-rc2)
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-09 12:20:57 +02:00
Luca Boccassi 488fd4c3df cryptsetup: add option to use via dlopen in libmount
Enabling libcrypsetup in libmount had several unintended side
effects.
First of all, it increases the Debian minimal image size by
~2.5% (5.6MB worth of new libraries).
Then, due to libcryptsetup linkage to OpenSSL and libjson-c,
it causes incompatibilities with external programs linking
against both libmount and a private, static, old version of
OpenSSL, or external programs linking against libjansson or
json-glib, which have one symbol in common with libjson-c.

If ./configure is ran with --with-crypsetup=dlopen,
instead of linking to libcrypsetup, use dlopen to resolve
the symbols at runtime only when the verity feature is
used, thus avoiding clashes and keeping images size down.

Fixes #1081

Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
2020-07-07 16:43:55 +01:00
Evgeny Vereshchagin e6a4d8cc06 build-sys: add --enable-ubsan to make it possible to build util-linux with UBSan
mostly to prepare for https://github.com/karelzak/util-linux/pull/1068
but it's useful even without fuzzing.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-03 11:17:53 +02:00
Karel Zak a732e4a1d3 libblkid: remove blkid_llseek()
Let's use libc lseek() everywhere like we use in another tools. It's
year 2020 ...

Addresses: https://github.com/karelzak/util-linux/issues/1083
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-01 15:47:20 +02:00
Karel Zak 63c80c4cf7 build-sys: add --enable-werror
Add new ./configure option to make all compiler warnings into errors.

Addresses: https://github.com/karelzak/util-linux/issues/1083
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-01 15:23:10 +02:00
Karel Zak 313a738832 build-sys: add -Waddress-of-packed-member
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-01 09:32:58 +02:00
Karel Zak 5657d3492f build-sys: release++ (v2.36-rc1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-09 15:13:48 +02:00
Karel Zak c61470c7c0 build-sys: make lsirq and irqtop optional
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-08 11:33:00 +02:00
Karel Zak fee9910661 build-sys: cleanup $vendordir use
- use --with-vendordir= (rather than --enable) to be compatible with
  another package stuuf

- add USE_VENDORDIR automake condition

- add vendordir to global AM_CPPFLAGS to avoid binary specific cflags
  modifications

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-25 13:44:22 +02:00
Karel Zak d5e8818e03 Merge branch 'libeconf' of https://github.com/thkukuk/util-linux
* 'libeconf' of https://github.com/thkukuk/util-linux:
  Adjust test output to pass test suite
  Add support for libeconf
2020-05-25 12:23:13 +02:00
Sami Kerola 09070e1a65 more: use libmagic to identify binary files
As the old commend said: 'This code would best be shared with the file(1)
program or, perhaps, more should not try to be so smart'.  Now at configure
time one can choose whether more(1) is sharing code with file(1), or not.

Addresses: http://bugs.debian.org/139205
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-05-12 10:22:09 +02:00
Sami Kerola 823ef319b6
more: replace siglongjmp() and signal() calls with signalfd()
From man siglongjmp(3) 'longjmp() and siglongjmp() make programs hard to
understand and maintain.  If possible, an alternative should be used.'  That
manual page remark summarizes quite well why more(1) needs to move away from
jumping around.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-03-27 21:06:01 +00:00
Karel Zak f205a07363 build-sys: fix chfn-chsh configure help text
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-03-16 10:53:55 +01:00
Zbigniew Jędrzejewski-Szmek ac660b80fd build-sys: rename automake variable to match define name
Just to make things a bit more consistent.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-03-10 10:53:15 +01:00
Karel Zak a0f62b0b20 lsirq: add new command
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-03-06 16:21:10 +01:00
Sami Kerola fa8c5cd503
irqtop: use epoll event loop
The event loop takes care of the standard screen updates, signals, and user
inputs.  Two nice things using even loop like this are; 1) no need for any
global variables and 2) effect of user commands is immediate.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-02-21 21:09:15 +00:00
Sami Kerola 4f6610f5ca
irqtop: make util-linux build-system to build the command
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-02-21 21:09:13 +00:00
Karel Zak e8c21c894e build-sys: add --disable-hwclock-gplv3
The currently used date/time parser (for hwclock --set --date <date>)
is gnulib based code with GPLv3.

This patch allows to avoid this code and replace it with minimalistic
date/time parser.

Addresses: https://github.com/karelzak/util-linux/issues/891
Reported-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-27 16:23:21 +01:00
Karel Zak e3e7cd659e Merge branch 'dmverity_sig' of https://github.com/bluca/util-linux
* 'dmverity_sig' of https://github.com/bluca/util-linux:
  libmount: add support for signed verity devices
2020-01-23 15:47:15 +01:00
Karel Zak d355735912 build-sys: release++ (v2.35)
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-21 11:15:21 +01:00
Luca Boccassi 123b1a6708 libmount: add support for signed verity devices
A new API was added to libcryptsetup to make use of the kernel's new
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG feature, which allows to sign
root hashes. Add a verity.roothashsig option to use it.
Device reuse will be allowed only if signatures are used by all, or
by none.
2020-01-13 12:24:55 +00:00
Karel Zak b6c1eccc43 build-sys: release++ (v2.35-rc2)
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-08 10:28:29 +01:00
Samuel Thibault 393f266c76 build-sys: make scriptlive optional
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-11 13:24:25 +01:00
Karel Zak 6d67d84319 build-sys: release++ (v2.35-rc1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-11 10:55:14 +01:00
Karel Zak e601521259 Merge branch 'kill-pidfd' of https://github.com/kerolasa/util-linux
* 'kill-pidfd' of https://github.com/kerolasa/util-linux:
  kill: use pidfd system calls to implement --timeout option
  build-sys: add missing NR underscore to UL_CHECK_SYSCALL()
2019-12-09 12:20:22 +01:00
Luca Boccassi e6a498877c libmount: add support for verity devices via libcryptsetup
The following new options are added:

verity.hashdevice
verity.roothash
verity.hashoffset

The source path will be used as a dm-verity object, and will be
opened using libcryptsetup APIs.

A new --with-cryptsetup build-time option is added, which adds a
dependency on libcryptsetup. To ease bootstrapping, given libcryptsetup
build-depends on util-linux for libuuid, if --with-cryptsetup=yes but
libcryptsetup is not installed only a warning will be printed at
configure time rather than an error. This way stage0/first stage/ring0
builds can use the same configure options but avoid installing
cryptsetup to get a working base set, and then rebuild util-linux in
the next step of the boostrapping process.

If verity options are selected but cannot be fullfilled due to lack of
dependencies, mounting a volume will fail even if using a loop device
would work as a fallback, to avoid silently skipping integrity checks.
2019-12-05 10:39:21 +00:00
Sami Kerola 6e6b9a1d24
kill: use pidfd system calls to implement --timeout option
At times there is need in scripts to send multiple signals to a process.
Often these cases require some amount of waiting before follow-up signal
should be sent.

One common case is process termination, where first script tries to kill
process gracefully but if that does not work SIGKILL is sent.  Functionality
like that is commonly done by periodically checking if signalled pid exist
or not, and if it does another signal is sent possibly to an unrelated
process that reused pid number.  That means polling a pid is prone to a data
race.  Also if the first signal immediately kills the process one polling
interval is lost in sleep.

Another example when multiple signal need to be sent is various daemon
process control situations, such as Upgrading Executable on the Fly (see
reference).  This happens to be the case that inspired change author to make
sequential signaling a little bit easier.

Reference: http://nginx.org/en/docs/control.html#upgrade
Pull-request: https://github.com/karelzak/util-linux/pull/902
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-11-25 21:25:50 +00:00
Karel Zak c2409b55a0 build-sys: introduce $sysconfstaticdir
The current situation is that distros differentiate between:

* host specific configuration -- usually /etc, maintained by admin

* distribution specific (static) configuration -- usually /usr/lib,
  maintained by ditro packages

Unfortunately autotools have clue about $sysconfdir (/etc) only. This
patch introduces $sysconfstaticdir (default $prefix/lib).

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-12 10:09:34 +01:00
Sam Voss a76cd5f6ab wipefs: Allow explicitly enable/disablement
Currently if `--disable-all-packages` is set, there is no configure
option for re-enabling `wipefs`.

As the current default for `wipefs` is "enabled", add `--disable-` flag
to maintain backward compatibility.

Signed-off-by: Sam Voss <sam.voss@gmail.com>
2019-10-14 21:19:16 -05:00
Karel Zak ec10634e7e script: use lib/pty-session
This patch consolidate pseudo-terminal stuff in util-linux. From now
there is only one implementation used in su(1) --pty, scriptlive(1)
and script(1).

The new stuff is based on the original script(1) -- it means poll()
and signalfd() based.

Note that script(1) code does not provide fallback for systems/libc
where is no openpty().

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:54 +02:00
Karel Zak 37a11e1a3d scriptlive: run shell in PTY
After this change shell executed by scriptlive(1) is going to behave
like shell in script(1). It means that the shell stdin is a
pseudo-terminal rather than pipe. This allows live replay of
interactive applications, ssh sessions, etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:54 +02:00
Karel Zak 6954895cae lib/pty-session: add generic PTY container code
The idea is to consolidate script(1), scriptlive(1) and su(1) --pty
and use the same code everywhere.

TODO: add callbacks for stdin/out logging (necessary for script(1)).

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:54 +02:00
Karel Zak 33869e5ac0 scriptlive: add new command to re-execute script(1) typescript
The old good scriptreplay(1) just display your recorded session, the
scriptlive(1) uses stdin typescript (from new script(1)) to execute
your commands again.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:54 +02:00
Sami Kerola 218b1dd6f9
misc: fix typos [codespell]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-09-12 19:41:46 +01:00
Karel Zak 2c2ff2ed26 build-sys: check for linux/capability.h
Addresses: https://github.com/karelzak/util-linux/pull/864
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-09-12 12:45:50 +02:00
Thorsten Kukuk 9e584ff324 Add support for libeconf 2019-09-03 15:04:43 +02:00
Karel Zak e4925f591c libmount: improve mountinfo reliability
The standard way how we read mount table is not reliable because
during the read() syscalls the table may be modified by some another
process. The changes in the table is possible to detect by poll()
event, and in this case it seems better to lseek to the begin of the file
and read it again. It's expensive, but better than races...

This patch does not modify mountinfo parser, but it reads all file to
memory (by read()+poll()) and than it creates memory stream
from the buffer and use it rather than a regular file stream.

It means the parser is still possible to use for normal files
(e.g. fstab) as well as for mountinfo and it's also portable to
systems where for some reason is no fmemopen().

Note that re-read after poll() event is limited to 5 attempts (but
successful read() without event zeroize the counter). It's because we
do not want to wait for consistent mountinfo for ever. It seems better
to use old (less reliable) way than hang up in read()+poll()
loop.

Addresses: https://github.com/systemd/systemd/issues/10872
Reported-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-08-29 14:27:11 +02:00
Karel Zak b106229206 build-sys: improve hwclock CMOS dependences
Let's use standard UL_* macros to check for dependencies
(architectures and hwclock).

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-07-15 15:32:49 +02:00
Carlos Santos 88bc304ba8 hwclock: use CMOS clock only if available
- Add --disable-hwclock-cmos configuration argument
- Add USE_HWCLOCK_CMOS (enabled by default for i386/x86_64)
- Add define(USE_HWCLOCK_CMOS)
- Compile hwclock-cmos.c only if USE_HWCLOCK_CMOS is true
- Remove all unnecessary #ifdefs from hwclock-cmos.c
- Add #ifdef USE_HWCLOCK_CMOS around the determine_clock_access_method()
  call in hwclock.c

Signed-off-by: Carlos Santos <unixmania@gmail.com>
2019-07-15 13:56:13 +02:00
Florian Weimer 1632856ef1 build-sys: Include <stdlib.h> in ./configure wchar_t test
Without #include <stdlib.h>, this configure check fails for strict
C99/C11 compilers which do not support implicit function declarations
(which are a C90 feature removed from C99).

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-07-15 11:06:21 +02:00
Karel Zak d4319b91c9 build-sys: release++ (v2.34)
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-14 12:34:10 +02:00
Karel Zak 4de60aecad build-sys: release++ (v2.34-rc2)
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-30 12:06:50 +02:00
Karel Zak 5348fa7d88 build-sys: add info about ASAN
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-28 12:37:14 +02:00
Karel Zak 99f95a1ea9 build-sys: add --with-pkgconfigdir
It seems we need a way how to override the default pkg-config install directory.

default:
	$ ./configure
	$ grep 'pkgconfigdir ='  Makefile
	pkgconfigdir = ${usrlib_execdir}/pkgconfig

user-defined:
	$ ./configure --with-pkgconfigdir=/usr/share/pkgconfig
	$ grep 'pkgconfigdir ='  Makefile
	$ pkgconfigdir = /usr/share/pkgconfig

Addresses: https://github.com/karelzak/util-linux/issues/793
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-14 13:50:59 +02:00
Karel Zak 084365f1a1 build-sys: use __SANITIZE_ADDRESS__ rather than custom USE_CLOSE_ATEXIT
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-07 12:59:52 +02:00
Karel Zak 4267f2bcea build-sys: release++ (v2.34-rc1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-30 11:56:27 +02:00
Karel Zak 31c66833cb include/closestream: add close_stdout_atexit()
It seems better to have a way to control when atexit(close_stdout()) is
used, because close stdout means that for example ASAN (or another
into binary integrated tool) is not able to print the final summary.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-16 13:42:34 +02:00
Karel Zak ef61c093d3 build-sys: add ASAN_LDFLAGS
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-15 13:01:21 +02:00
Karel Zak 117f4d8bf4 Merge branch 'hardlink' of https://github.com/rudimeier/util-linux into hardlink
* 'hardlink' of https://github.com/rudimeier/util-linux: (25 commits)
  hardlink: add first simple tests
  hardlink: util-linux usage
  hardlink: fix compiler warnings
  hardlink: style indentations and license header
  hardlink: enable build with and without pcre2
  fixes for the fixes
  temporal fix before re-patch (updates from Fedora repo)
  Update hardlink.1
  Fixed version number, added changelog about Todd Lewis' patch
  exclude files via pcre
  Fixed 32 bit build with gcc7 (RH Bugzilla ID 1422989)
  spec file reflects the atomic hardlinking patch; removed cleaning buildroot (redundant); update FSF address at .c source file
  Revert "spec file reflects the atomic hardlinking patch; removed cleaning buildroot (redundant); current FSF address at .c source file"
  spec file reflects the atomic hardlinking patch; removed cleaning buildroot (redundant); current FSF address at .c source file
  Mention -f option in the man page
  do not allow to hardlink files across filesystems by default (#786719) (use -f option to override)
  fix possible buffer overflows, integer overflows, update man page
  fix URL and remove mmap() (#676962, #672917)
  - update docs to describe highest verbosity -vv option (#210816) - use dist Resolves: 210816
  mostly spec cleanup
  ...
2019-02-06 13:55:20 +01:00
edupont 41f58b6030
Typo in configuration help 2019-02-01 22:57:34 +01:00
Johannes Nixdorf 70c364b4db build-sys: fix crypt() detection without -lcrypt
The check tested whether code using crypt() links without -lcrypt, but
didn't set have_crypt to yes if it succeeded.

This fixes the check erroneously failing when compiling against musl
libc.

Signed-off-by: Johannes Nixdorf <mixi@shadowice.org>
2019-01-23 12:20:47 +01:00
Karel Zak 8229ed2f5c build-sys: do not require crypt()
The function is necessary only for newgrp and sulogin.

Addresses: https://github.com/karelzak/util-linux/issues/584
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-12-03 11:23:33 +01:00
Karel Zak a68ed87ffe build-sys: do not require dirfd()
The dirfd() is required on many places, but it should not be required for
all utils by ./configure.ac.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-12-03 11:23:33 +01:00
Karel Zak 3001923ba1 build-sys: improve error message
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-12-03 11:23:33 +01:00
Karel Zak 6df5acf970 lib/timer: add fallback if timer_create() not available
* add struct ul_timer as API abstraction to hide differences between
timer_create() and setitimer()

* add setitimer() detection to ./configure.ac

* add fallback code to use setitimer() if timer_create() not available
  (for example on OSX)

Addresses: https://github.com/karelzak/util-linux/issues/584
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-12-03 11:23:33 +01:00
Karel Zak 9a558f9cf6 build-sys: make sure HAVE_TIMER_CREATE defined
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-12-03 11:23:33 +01:00
Carlos Santos 9c7431fd18 build-sys: make fdisk, sfdisk, cfdisk optional (enabled by default)
Useful for embedded systems, on which only few utilities are required.

[kzak@redhat.com: - rename to --disable-fdisks
                  - use $enable_{c,s,}fdisk in code]

Signed-off-by: Carlos Santos <casantos@datacom.com.br>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-11-29 11:33:27 +01:00
Ruediger Meier 04ae85a7e5 hardlink: enable build with and without pcre2
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-11-12 19:40:33 +01:00
Karel Zak 06993ebb11 build-sys: release++ (v2.33)
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-11-06 12:08:46 +01:00
Karel Zak 3f7e7e4d3c build-sys: release++ (v2.33-rc2)
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-10-19 12:19:32 +02:00
Karel Zak 7a3b35b966 build-sys: add USE_LIBMOUNT_SUPPORT_NAMESPACES
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-10-05 11:02:26 +02:00
Karel Zak ed02256387 build-sys: release++ (v2.33-rc1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-25 11:26:58 +02:00
Karel Zak f40e316f5e build-sys: default to /lib64 for ${exec_prefix}/lib64
We already default to /lib for the default $exec_prefix, but the current
configure does not care about /lib64 although the use-case is exactly
same as for /lib.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-04 11:42:19 +02:00
Karel Zak 75efef98d4 su: add --whitelist-environment
* usable with --login to whitelist specified environment variables

* the list is ignored for the core variables like HOME, SHELL, USER,
  LOGNAME and PATH (su --login always resets these variables)

Note that su(1) requires password and after successful authentication
user has full control over the session, so he can set arbitrary
environment variables. The whitelist makes things more user friendly
only.

The patch removes unnecessary optimization when allocate environ[]. It
seems better to keep all in glibc hands and just reset the environment
array only.

Addresses: https://github.com/karelzak/util-linux/issues/221
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-15 13:03:21 +02:00
Karel Zak 17666c8760 build-sys: add -Wdiscarded-qualifiers
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 12:15:31 +02:00
Karel Zak 4f9d999a97 build-sys: add -Wno-cast-function-type for python
libmount/python/pylibmount.c:158:19: warning: cast between incompatible function types
   from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’}
     to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
   [-Wcast-function-type]

This is generic problem in all Python C code and gcc v8. The another
possible (and probably more correct) way is to add unused argument to
all API functions. Unfortunately, this solution is pretty invasive. The
question is if gcc is not too paranoid in this case.

For more details see https://bugs.python.org/issue33012. It seems
Python guys also prefer CFLAGS modification for now.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-18 10:23:51 +02:00
Karel Zak 95a89bd313 build-sys: cleanup --with/--without help strings
--with-     means disabled by default or modify any default path
--without-  means enabled by default

Reported-by: L A Walsh <lkml@tlinx.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-05-03 10:16:11 +02:00
Karel Zak 7a95313c31 build-sys: --without-systemd disables --with-systemdsystemunitdir
Make sure --without-systemd disables also --with-systemdsystemunitdir.

Reported-by: L A Walsh <lkml@tlinx.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-05-03 09:56:35 +02:00
Karel Zak bf2603c73a build-sys: extend "Could not locate the pkg-config" error message
Addresses: https://github.com/karelzak/util-linux/issues/631
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-30 09:43:32 +02:00
Karel Zak 0dadc8bcf4 Merge branch 'choom' 2018-04-16 13:03:25 +02:00
Karel Zak 8fa223daba choom: new command to adjust OOM-killer score value
Let's provide command line tool, man page with OOM description and
bash-completion. It seems better than force end-users to use "echo"
to /proc.

Addresses: https://github.com/karelzak/util-linux/issues/609
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-16 12:53:39 +02:00
G.raud Meyer 0dba6b6f19 rename: test availability of __fpurge() and fpurge() 2018-04-09 17:21:17 +02:00
Karel Zak 475ecbad15 build-sys: release++ (v2.32)
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-03-21 15:01:28 +01:00
Karel Zak a0357292b5 fstrim: fix fs.h and mount.h collision
Unfortunately, old version of the file linux/fs.h defines MS_*
macros, so the file cannot be included together with sys/mount.h.

We include sys/mount.h from libmount.h now.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-03-20 11:42:34 +01:00
Karel Zak e04d89e95b build-sys: release++ (v2.32-rc2)
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-03-01 14:15:49 +01:00
Karel Zak 2e20500a44 build-sys: forgot update NEWS for v2.32-rc1
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-22 13:04:46 +01:00
Ruediger Meier 73afd3f8e8 misc: fix typos using codespell
Some more funny typos, please review carefully.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-02-16 11:12:52 +01:00
Ruediger Meier 316795fcb3 build-sys: disable bz2 tarball and fix some am warnings
Nobody needs the .bz2 tarball. We dont't even upload it to
kernel.org.

BTW we fix dozens of these automake warnings:

    automake-1.13/am/ltlibrary.am: warning: 'libblkid.la': linking libtool libraries using a non-POSIX
    automake-1.13/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'

So we can remove -Wno-portability. The only warning left is this
last GNU-make'ism which somebody may fix when reading it:

   sys-utils/Makemodule.am:191: warning: addprefix sys-utils/,$(SETARCH_LINKS: non-POSIX variable name
   sys-utils/Makemodule.am:191: (probably a GNU make extension)
   Makefile.am:90:   'sys-utils/Makemodule.am' included from here

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-02-15 21:30:32 +01:00
Mike Frysinger 2afbcec561 build-sys: (configure) fix bashisms
The `test` command only recognizes =, not ==.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2018-01-30 12:22:16 +01:00
Rafal Luzynski 4e12a62e88 cal: Use ALTMON_* correctly
cal: use ALTMON_* and _NL_ABALTMON_* constants to display
months in a standalone form correctly.  These constants have just
been newly added to glibc.  ALTMON_x has been used in BSD family
since 1990s and has been accepted as the future POSIX extension.
_NL_ABALTMON_* is exclusively a GNU extension but it is expected
to be added to POSIX in future.

More info: https://sourceware.org/bugzilla/show_bug.cgi?id=10871
2018-01-22 11:50:50 +01:00
Karel Zak cf9b16f1d4 build-sys: don't check for swapon() number of arguments
The syscall swapon() with two arguments is supported since Linux 1.3.2
and it's really long time ago... Let's assume that all libc header files
have been already fixed.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-12-18 13:57:20 +01:00
Karel Zak 4b328279ce build-sys: lsns requires libmount
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-11-27 17:44:43 +01:00
Masatake YAMATO 4195756e03 lsns: add netnsid column
Linux network subsystem assigns an unique integer to a network
namespace.

  term0# ip netns add UTIL-LINUX-LSNS-TEST-NS
  term0# ip netns list
  UTIL-LINUX-LSNS-TEST-NS
  term0# ip link add name lsns-vetha type veth peer name lsns-vethb
  term0 # ip link set lsns-vethb netns UTIL-LINUX-LSNS-TEST-NS
  term0# ip netns list
  UTIL-LINUX-LSNS-TEST-NS (id: 0)
  term0# ip link show dev lsns-vetha
  230: lsns-vetha@if229: <BROADCAST,MULTICAST> mtu 1500 qdisc noop ...
         link/ether 3e:27:68:ba:b3:95 brd ff:ff:ff:ff:ff:ff link-netnsid 0
In this example 0 is assigned to UTIL-LINUX-LSNS-TEST-NS net namespace.
The name, UTIL-LINUX-LSNS-TEST-NS, and it semantics is given and defined
by iproute2 in userland; and nothing to do with util-linux.

However, the id, 0, is managed in linux kernel. If lsns can show
the ids, it helps users understand the state of network namespaces.

This commit adds NETNSID column to the output.

Here is an example of session:

  term0# ip netns exec UTIL-LINUX-LSNS-TEST-NS cat

  (Open another terminal)

  term1# ./lsns --type net
          NS TYPE NPROCS   PID USER     NETNSID COMMAND
  4026531993 net     383     1 root  unassigned /usr/lib/systemd/...
  4026532433 net       1  1219 rtkit unassigned /usr/libexec/rtkit-daemon
  4026532562 net       1 18201 root           0 cat

0 is shown as NETNSID for the cat process.

For the initial name space, "unassigned" is printed.
For the namespaces other type than net, "n/a" is printed.
If an error occurred during getting the id, "n/a" is printed.

Changes in V2:

* Remove wrongly used & operators.
* Make netnsid field empty if value for the column is not available.
  Suggested by Karel Zak.
* Remove redundant condtion for checking the avaiablebility of netlink
  socket. Suggested by Karel Zak.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2017-11-27 15:54:49 +01:00
Karel Zak b97cc9a829 build-sys: add --enable-asan and --memcheck-asan for tests
The command ./configure --enable-asan adds -fsanitize=address
to the compiler command line. In the regression tests leaks detection
is disabled by default. You have to use --memcheck-asan on test
command line to enable.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-11-23 14:59:05 +01:00
Karel Zak c08396c769 libmount: use eacess() rather than open() to check mtab/utab
The open() syscall is probably the most strong way how to check write
accessibility in all situations, but it's overkill and on some
paranoid systems with enabled audit/selinux. It fills logs with
"Permission denied" entries. Let's use eaccess() if available.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Karel Zak 27e66e59a3 build-sys: release++ (v2.31)
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-19 13:08:49 +02:00
Karel Zak bb305629d7 build-sys: release++ (v2.31-rc2)
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-03 17:53:33 +02:00
Karel Zak 47ba6dc411 build-sys: release++ (v2.31-rc1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-09-22 12:03:15 +02:00
Karel Zak 271552c72a build-sys: make rfkill optional (and enabled by default)
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-09-19 13:22:31 +02:00
Karel Zak ad442a818c build-sys: add libtinfow check
It seems some systems differentiate between tinfo and tinfow. And it
seems that mix ncursesw and tinfo (wide vs. non-wide char) is problem
for the systems.

Note that for example Fedora have ncursesw as well as ncurses, but
only one tinfo library. So, we need fallback this scenario.

Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-09-19 12:55:49 +02:00
Karel Zak 3d47ab0549 build-sys: add --disable-rfkill
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-08-31 11:40:51 +02:00
Sami Kerola b3849c66d3
rfkill: use libsmartcols output
This also makes the rfkill to output status when executed without arguments.
That is believed ot be more useful than usage() output.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-08-30 20:32:48 +01:00
Sami Kerola 367f40806e
rfkill: make programming style to match util-linux project
Use the usual facilities, add translation strings, move global variables at
the beginning of the file, make usage() look as expected, add standard
command-line option parsing.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-08-30 20:32:48 +01:00
Sami Kerola c0d78c90be
rfkill: make command to build in util-linux project
After this commit the command merely builds, but does not confirm style used
in util-linux project.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-08-30 20:32:48 +01:00
Karel Zak 49a3d609ed build-sys: define dependence between chsh and getusershell 2017-08-30 11:30:41 +02:00
Karel Zak 87c26ce5b6 build-sys: support ncursesw without headers in ncursesw/ directory
Let's check always for alone ncurses.h and term.h if the preferred
variant with ncursesw/ subdirectory is not available.

The patch also minimize number of HAVE_...NCURSES_H macros in
config.h. We don't need to check for ncurses.h if ncurses/ncurses.h is
available.

Reported-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-08-01 14:36:25 +02:00
Andreas Henriksson 8df545592d build: use --runstatedir instead of --localstatedir
The util-linux code was previously aligned to use @localstatedir@ and
the util-linux build system was set to override the default to use /run.

Current GNU Coding Standards introduced the @runstatedir@ variable
for this purpose. Lets use that instead.

The GNU default for @runstatedir@ is ${localstatedir}/run so util-linux
still override the default to be /run to preserve the status quo from
before. The only difference is that you'll now pass --runstatedir to
override the location on the command line instead of --localstatedir.

(FWIW, Debhelper in compat 11 will automatically start passing
--runstatedir=/run to all autotools configured builds. It already
passes --localstatedir=/var (to avoid it ending up with the GNU default
/usr/local/var) which breaks the util-linux build system code that
tries to default it to /run. This change will thus allow util-linux
and debhelper to work better together and avoid the need for a
package-specific override.)

Relevant historic commits:
 * commit 07a16b9d1e
   "build-sys: change --localstatedir to /run"
 * commit 80c51185d5
   "uuidd: use run configured state directory"
 * commit 01c5b78794
   "agetty: use configured run state directory"

[kzak@redhat.com: - add $runstatedir fallback for autoconf < 2.70
                  - check for unmodified $localstatedir]

CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-07-31 15:24:46 +02:00
Andreas Henriksson c9ab738706 whereis: include native multiarch path in lib search paths
This includes atleast the native multiarch path in the paths to search.
(Maybe also other multiarch paths should also be searched? But atleast
this is a first step.)

Before this change (on Debian):
$ whereis libc
libc: /usr/share/man/man7/libc.7.gz

After this change:
$ whereis libc
libc: /usr/lib/x86_64-linux-gnu/libc.so /usr/lib/x86_64-linux-gnu/libc.a /usr/share/man/man7/libc.7.gz

Addresses: https://bugs.debian.org/856968
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2017-07-31 13:48:04 +02:00
Sami Kerola 31f85fce55
ldattach: simplify debugging function when vwarnx(3) is available
The vwarnx(3) is probably not available in all libc implementations, in such
cases use the earlier printout as a fallback.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-07-15 22:02:53 +01:00
Sami Kerola 8e58889065
reset: remove script from the package
This script requires ncurses to work, and the ncurses provides reset so
there should not be need to keep this script hanging around.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-07-15 22:02:53 +01:00