* 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>
We need to evaluate "include::" directive relatively to project
top-level source directory rather than to the current document
location.
Signed-off-by: Karel Zak <kzak@redhat.com>
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>
To build: meson build && ninja -C build
To run tests: ninja -C build check
To install for packaging: DESTDIR=/var/tmp/inst ninja -C build install
To install for realz: sudo ninja -C build install
v2:
- Optional items are now based on the 'feature' feature in meson.
Built libraries which are disabled turn into disabler() objects
and also poison any executables which link to them.
What is there:
- building of the binaries and libs and the python module
- installation of binaries, libs, python module, localization files,
man pages, pkgconfig files
- running of tests
- most options to configure build equivalently to the
./configure settings
Partially implemented:
- disabling of stuff when things missing. In the C code, the defines
are all used, so that should be fine. In the build system, some
files should be skipped, but that is probably not always done properly.
Getting this right might require some testing of various build option
combinations to get the details right.
Not implemented:
- static builds of fdisk and other binaries
- things marked with XXX or FIXME
- ???
Differences:
- .la files are not created. They are useless and everybody hates them.
- Requires.private in pkgconfig files are not present in the
autogenerated .pc file. Not sure if they should be there or not. If
necessary, they can be added by hand.
- man pages and systemd units are installed by the install target. Not
sure why 'make install' doesn't do that.
- the split between / and /usr is probably wrong. But it's all pointless
anyway, so maybe we could simplify things but not implementing it at
all under meson?
The following usages of utmpdump result in no output being flushed to the specified file because the default output buffering is fully buffered:
$ utmpdump --follow --output myOutputFile /var/log/utmp
$ utmpdump --follow /var/log/utmp > myOutputFile
This change configures line buffering for these scenarios so that output will be flushed after each log event.
Signed-off-by: Andrew Shapiro <anshapiro@gmail.com>
The current situation:
# su --pty - kzak
$ ll $(tty)
crw--w---- 1 root tty 136, 9 Feb 23 11:53 /dev/pts/9
$ mesg
mesg: cannot open /dev/pts/9: Permission denied
the pseudo-terminal is still owned by the original user.
New version:
# su --pty - kzak
# ll $(tty)
crw--w---- 1 kzak tty 136, 9 Feb 23 11:56 /dev/pts/9
# mesg
is y
The patch follows login(1) to change the pty owner and group. It
follows "TTYPERM" and "TTYGROUP" from login.defs (or econf lib).
Signed-off-by: Karel Zak <kzak@redhat.com>
* '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>
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.
It seems like overkill to provide this #ifdef. For example coreutils
use "char *" for all selinux contexts (since 2014).
Signed-off-by: Karel Zak <kzak@redhat.com>
The util-linux close_all_fds() serves the same purpose as close_range()
that will over time obsolete local implementation completely. For
upcoming few years it is best to have a fallback that uses same input
arguments as the new system call. That allows surrounding code and
variables not to be affected by version of mass file descriptor closing
function.
Proposed-by: Karel Zak <kzak@redhat.com>
Reference: https://github.com/karelzak/util-linux/pull/1205#discussion_r534080128
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Apart two function calls login(1) already used xalloc functions. If there
was a time when login tried to gracefully handle allocation errors that has
not been true for long time.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Couple function had spaces instead of tabs in indent. This change uses tabs
everywhere, and does handful of other spacing additions and removals.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Allocating stack for about 10x more than longest possible user name is
wasteful, even if it happens for reletively short period of time.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Earlier code was most probably correct, but it is best to be safe than sorry
when dealing with confidental data removals.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
There are translations in getlogindefs_num() and they will not take effect
unless the function call is after the setlocale(), bindtextdomain(), and
textdomain().
Signed-off-by: Sami Kerola <kerolasa@iki.fi>