Commit Graph

59 Commits

Author SHA1 Message Date
Karel Zak d8d54e4bfc build-sys: keep adoc files in dist_noinst_DATA
* rename MANPAGES_EXTRA= to ADOCFILES_COMMON=

* keep track about individual adoc files by dist_noinst_DATA=
  This variable is not effected by automake conditions, so the files
  are always distributed.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-05 13:35:30 +02:00
Karel Zak ad67a438cf build-sys: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-26 11:57:07 +01:00
Karel Zak 4f79d3032e build-sys: split man pages and man page links
The symlinks are generated by asciidoctor and current dist_man_MANS
depends on order (nan page before man link). This solutions is useless
when execute "make -j". The real solution is to keep man pages in
separate variable and use only this variable evaluate what we need to
generate.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-26 11:49:59 +01:00
Karel Zak c2096885af build-sys: remove man page link files
It seems asciidoctor generates all necessary files.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-26 11:26:08 +01:00
Karel Zak bdda0dc051 build-sys: remove duplicate hook
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-26 10:31:29 +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
Karel Zak 68f4aa2a2f build-sys: move selinux_utils.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-13 13:30:31 +01:00
Pino Toscano 5547316c85 build-sys: do not build plymouth-ctrl.c w/ disabled plymouth
Do not build plymouth-ctrl.c in agetty and sulogin in case the plymouth
support is disabled.

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2020-11-17 11:27:48 +01:00
Egor Chelak 9203b41a4f nologin: use ul_copy_file
Suggested-by: Sami Kerola <kerolasa@iki.fi>
Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Egor Chelak <egor.chelak@gmail.com>
2020-11-09 07:19:24 +02:00
Karel Zak eee886ba1d build-sys: exclude GPL from libcommon
The library is not distributed and almost all code in this ar(1)
archive is Public Domain or LGPL ... but let's avoid any doubts and do
not mix non-GPL and GPL code there.

Addresses: https://github.com/karelzak/util-linux/issues/1157
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-06 13:26:36 +02:00
Evgeny Vereshchagin 2cdbf06f5e tests: add a fuzzer for process_wtmp_file
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2020-08-06 12:33:11 +00:00
Karel Zak 498f910eeb build-sys: add $LDADD and libcommon to test_logindefs_LDADD
Addresses: https://travis-ci.org/github/karelzak/util-linux/jobs/690915120
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-26 11:43:07 +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
Karel Zak 63869b842f build-sys: fix build with pty
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:54 +02:00
Karel Zak b923bdbe52 su: use lib/pty-session.c code for --pty
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:54 +02:00
Thorsten Kukuk 9e584ff324 Add support for libeconf 2019-09-03 15:04:43 +02:00
Sami Kerola 204aa7714d runuser: fix linking
Add conditional -lutil to runuser when needed to avoid linking error.

login-utils/su-common.o: In function `pty_create':
login-utils/su-common.c:269: undefined reference to `openpty'
login-utils/su-common.c:273: undefined reference to `openpty'

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-09-18 11:49:11 +02:00
Karel Zak eb7d0ad0fe su: add PTY support
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-09-18 11:49:11 +02:00
Karel Zak a65041b5ae build-sys: make chown usage more robust
* add --disable-makeinstall-chown to travis non-root mode

* use "if MAKEINSTALL_DO_SETUID" for chown root:root

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-06-21 11:12:04 +02:00
Karel Zak 8c1979948c build-sys: chown before chmod for SUIDs
Make sure SUIDs are really owned by root.

Reported-by: L A Walsh <lkml@tlinx.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-06-20 13:12:43 +02:00
Sami Kerola e41ae45093
chfn, chsh: use readline(3) to receive user input
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>
2017-05-02 23:22:05 +01:00
Karel Zak 23f7509326 Revert "su,runuser: add libseccomp based workaround for TIOCSTI ioctl"
This reverts commit 8e49250168.

Stupid hack...
2016-10-03 16:56:56 +02:00
Karel Zak 8e49250168 su,runuser: add libseccomp based workaround for TIOCSTI ioctl
This patch add libseccomp based syscalls filter to disable TIOCSTI
ioctl in su/runuser children.

IMHO it is not elegant solution due to dependence on libseccomp
(--without-seccomp if hate it)... but there is nothing better for now.

Addresses: CVE-2016-2779
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-29 16:32:33 +02:00
Sami Kerola 1173d0a6bf
utmpdump: use iso-8601 timestamp format with subsecond accuracy
Newer 'struct utmp' is using 'struct timeval' to represent login and logout
times, so include the maximum accuracy to textual utmp format.  Notice that
this change does not remove support of converting earlier textual formats
back to binary.  But conversions from binary to former format will no longer
be available.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-06-26 21:58:18 +01:00
Ruediger Meier b0b54cc582 build-sys: always add AM_CFLAGS
We were missing our nice compliler warnings for many programs
and libs. See next commits how many trivial and non-trival
warnings have to be fixed.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-23 01:17:29 +01:00
Ruediger Meier b201f1d86c build-sys: always use global LDADD
This was a major showstopper when building on a system where
LTLIBINTL libs are needed (e.g. OSX). Maybe there are a few test
programs which wouldn't need LDADD ... never mind.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-23 01:16:58 +01:00
Sami Kerola 0688911ad4 last-deprecated: remove from source tree
The last/lastb(1) from sysvinit has been around for about two years,
and the better implementation is already part of releases 2.24 to 2.26.
It should be safe to remove the unused last code from the source tree.

Reference: ce60272039
Signed-off-by: Sami Kerola <sami.kerola@lastminute.com>
2015-06-29 12:05:39 +02:00
Karel Zak 254743e4a6 build-sys: cleanup realtime lib usage
* check for timer_create()
* define dependence on timer_create() for flock
* rename CLOCKGETTIME_LIBS to REALTIME_LIBS

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-06 14:20:19 +01:00
Sami Kerola 144ae70ef3 chfn, chsh: share illegal_passwd_chars() function
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-05 22:52:50 +00:00
Sami Kerola e88f005949 chfn: make command to obey login.defs CHFN_RESTRICT instructions
Reference: http://man7.org/linux/man-pages/man5/login.defs.5.html
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=138519
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-19 09:11:04 +00:00
Will Johansson fe2c9909cd login-utils: Enable building util-linux against OpenPAM
OpenPAM is compatible with util-linux, with a few changes, namely
using OpenPAM's conversation function, openpam_ttyconv.

We check for Linux-PAM by querying for security/pam_misc.h, and OpenPAM
by querying for security/openpam.h.

Signed-off-by: Will Johansson <will.johansson@gmail.com>
2014-12-15 10:16:03 +01:00
Karel Zak cd2876d252 build-sys: move all around clock_gettime() to monotonic.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-19 11:54:47 +01:00
Karel Zak 8fc4a88630 build-sys: properly check for -lrt
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-27 11:05:14 +01:00
Karel Zak f37b357b47 lslogins: print systemd journal logs
Co-Author: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-27 17:34:15 +02:00
Ondrej Oprala 29cc2a5568 lslogins: add functionality
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Ondrej Oprala 914e20a00a lslogins: move to login-utils
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Karel Zak 08ca3e26a8 lib/timeutils: remove get_boot_time from libcommon
clock_gettime() needs -lrt, so let's keep this stuff
outside libcommon.la

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 13:16:05 +02:00
Karel Zak 88407b9321 nologin: add new command
Currently it's maintained as distro specific (or people use impolite
/bin/false way).

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-30 13:36:26 +02:00
Karel Zak bccc956df3 build-sys: fix lastb symlink
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-27 14:02:58 +02:00
Sami Kerola 3a4ae395a4 last: parse easy to use time formats
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-29 18:14:08 +01:00
Sami Kerola 1bd68aab3b last: check expected numeric user input is number
This commit also changes the line count to use unsigned integers, as
negative numbers in this context does not make sense.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-23 10:58:55 +02:00
Karel Zak ec01e9d048 build-sys: fix last stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-12 12:59:52 +02:00
Ondrej Oprala ce60272039 last: merge sysvinit last/lastb
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-12 12:07:52 +02:00
Karel Zak d86918b6eb chsh-chfn: fix bugs, improve compilation
* rename --disable-require-password to --disable-chsh-chfn-password

 * is_local() is really unnecessary when linked with libuser

 * fix set_value_libuser() returns codes

 * fix chfn.c, there is no 'pw', but oldf.pw

 * don't link with PAM when--disable-chsh-chfn-password

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-13 13:44:34 +01:00
Cody Maloney 6adb1ef279 chsh: Add libuser support
This is based directly on lchsh which is a part of libuser. libuser.{c,h}
exist because exactly the same code is needed for both chsh and chfn.

[kzak@redhat.com: cleanup err() usage]

Signed-off-by: Cody Maloney <cmaloney@theoreticalchaos.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-13 09:37:15 +01:00
Cody Maloney d91ad6ab3c chsh-chfn: Move pam auth to its own function, factoring out common code
This makes it easier to add support for libuser, which needs the same PAM
authentication. Also removes duplicate code between chsh and chfn.

Signed-off-by: Cody Maloney <cmaloney@theoreticalchaos.com>
2013-02-13 09:28:33 +01:00
Cody Maloney 7e4714f22b build-sys: Add flag for enabling/disabling libuser support.
Signed-off-by: Cody Maloney <cmaloney@theoreticalchaos.com>
2013-02-13 09:17:34 +01:00
Karel Zak a73f59fa03 sulogin: remove consoles.c from libcommon
- move struct chardata to include/ttyutils.h
- move console.{h,c} to login-utils/sulogin-* (it's sulogin specific)
- fix sulogin and agetty includes

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-23 22:14:21 +01:00
Karel Zak bbc5a5eac4 su: use get_terminal_name() for compatibility with login(1)
login(1) uses tty name (!= path) in the syslog messages.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-22 14:45:49 +01:00