* add UL_ENABLE_ALIAS(NAME, MASTERNAME) to initialize $enable_<name>
according to MASTERNAME. Note that we have to use $build_<mastername>,
the $enable_<mastername> is just AC_ARG_ENABLE() stuff only. The
$build_ is evaluated and modified by our UL_...() functions.
* add enable-schedutils.conf to have build-system regression test for
this use-case
Addresses: https://github.com/karelzak/util-linux/issues/415
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch adds:
- blkreset to issue Reset (Write Pointer) zone commands
- blkreport to retrieve drive zone information
[kzak@redhat.com: - cleanup man page and usage()
- remove command line options aliases,
- use strtosize_or_err()
- remove unnecessary -ludev
- use blkdev.h stuff]
Signed-off-by: Shaun Tancheff <shaun@tancheff.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'hwclock-jwp-reviewed' of git://github.com/kerolasa/lelux-utiliteetit: (25 commits)
hwclock: remove --compare option
hwclock: remove trailing dot from messages that include system error message
hwclock: make --date=argument less prone to injection
hwclock: fix rtc atexit registration
hwclock: clarify cmos inb and outb preprocessor directives
hwclock: try RTCGET and RTCSET only when normal rtc fails
hwclock: stream line synchronize_to_clock_tick_rtc()
hwclock: improve coding style
hwclock: remove division by zero [asan]
hwclock: add debugging to open_rtc()
hwclock: remove magic constants from interpret_date_string()
hwclock: use symbolic magic values passed in between functions
hwclock: initialize struct adjtime members
hwclock: alloate date_resp parsing buffer in interpret_date_string()
hwclock: simplify save_adjtime() execution flow
hwclock: remove dead code and other minor fixes
hwclock: move error messages to determine_clock_access_method()
hwclock: clarify set_cmos_epoch() code
hwclock: move command-line options to control structure
hwclock: remove unnecessary type casts
...
Local timegm() is a replacement function in cases it is missing from libc
implementation. Hopefully the replacement is never, or very rarely, used.
CC: Ruediger Meier <ruediger.meier@ga-group.nl>
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
System call getrandom(2) is relatively new, available since kernel 3.17 but
not supported by glibc 2.24. That in mind autotools is made to check
availability of this function and keep old code as fallback. It is
reasonable assume it will take years before the syscall(2) and fallback are
unproblematic to remove.
One might ask why bother using getrandom(2). Main reason is to avoid
unnecessary system calls to achieve exactly same end result. That
demonstrated with 'strace -c ./mcookie' showing 36 calls before, and 32
after this change. Secondly the getrandom(2) function got to kernel with
promise it can be used to avoid file descriptor run down, and since uuidd
uses random_get_bytes() it should fulfill it's promise here.
Reference: http://man7.org/linux/man-pages/man2/getrandom.2.html
Reference: https://lwn.net/Articles/606141/
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Let's hope this is last change necessary to cleanup x-* usage:
x-* persistent option, stored in utab, available for umount, etc.
X-* fstab comment only
mount(8) supports x-mount.mkdir= as well as newly recommended X-mount.mkdir=
Advantages:
* less invasive
* does not require exception for x-systemd
* does not require rename x-initrd to X-initrd
The systemd and dracut users will get the new (=fixed) functionality without a
change in fstab configuration. This is the primary goal.
Disadvantages:
* not 100% compatible libmount behavior, x-* options have not been
previously stored in utab. The API is the same, options will be still
available, but on x-* libmount will write to /run/mount/utab. For now
it seems only systemd uses x-*, and they like this behavior, so...
Addresses: https://github.com/systemd/systemd/pull/4515
Signed-off-by: Karel Zak <kzak@redhat.com>
The previous patch introduces X-* options namespace for options
that have to be maintained in user space.
Unfortunately, systemd users already use mount options that are
necessary by umount or another operations. The conclusion from
discussion with systemd guys is to store all the systemd options
in userspace.
It seems better to add one line exception to libmount than force all
fstab users to rename x-systemd to X-systemd.
Addresses: https://github.com/systemd/systemd/pull/3904
Signed-off-by: Karel Zak <kzak@redhat.com>
We simply check for utmpxname and updwtmpx functions to disable
all programs which are not POSIX utmpx compatible, even though
last(1) and utmpdump(1) does not use them, see below.
utmpx.h is used in:
login agetty write lslogins last runuser su utmpdump wall
Non-Posix utmpx usage:
utmpxname -> login agetty write lslogins
updwtmpx -> login agetty runuser su
_PATH_.TMP -> login agetty write lslogins last runuser su
utmpx.ut_addr_v6 -> login last utmpdump
POSIX utmpx usage:
wall
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Now the build will fail on many non-Linux systems because
utmpx.h is available everywhere but we still use non-POSIX
features. We'll fix this next commit.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This include was removed in a365953a but we will need it again
when we move from utmp.h to utmpx.h.
On Linux (glibc, musl) the struct lastlog is defined in utmp.h
and lastlog.h just includes utmp.h.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Conflicts:
login-utils/login.c
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Now we use
v2.29-5-g8ffab30 -> 2.29.5-8ffa (libblkid 2.29.5)
instead of
v2.29-5-g8ffab30 -> 2.29.5-8ffa (libblkid 2.29.0)
otherwise the bugfix releases (2.29.1) would look newer that latest HEAD.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Was broken for major releases since b0e6b25e:
$ blkid -V
blkid from util-linux 2.28 (libblkid 2.28., 12-Apr-2016)
Now we also set 0 in this case, like:
$ blkid -V
blkid from util-linux 2.30 (libblkid 2.30.0, 12-Apr-2016)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Move the s390 specific chmem tool to util-linux.
The chmem tool was originally written in perl and is part of the
s390-tools package which can be found here:
https://www.ibm.com/developerworks/linux/linux390/s390-tools.html
Given that the tool is architecture independent, there is no reason to
keep it in an s390 specific repository. It seems to be useful for
other architectures as well.
This patch converts the tool to C and adds it to util-linux, while the
command line options stay compatible. The only exception is the option
"-v" which used to be the short form of "--version". That got changed
to "-V" so it behaves like most other tools contained within
util-linux.
The chmem tool can be used to set memory online or offline. This can
be achieved by specifying a memory range:
Memory Block 19 (0x0000000130000000-0x000000013fffffff) disabled
or by specifying a size where chmem will automatically select memory
blocks:
Memory Block 21 (0x0000000150000000-0x000000015fffffff) disable failed
Memory Block 18 (0x0000000120000000-0x000000012fffffff) disabled
Memory Block 17 (0x0000000110000000-0x000000011fffffff) disabled
Memory Block 16 (0x0000000100000000-0x000000010fffffff) disabled
Memory Block 15 (0x00000000f0000000-0x00000000ffffffff) disabled
or by specifying memory block numbers instead of address ranges:
Memory Block 15 (0x00000000f0000000-0x00000000ffffffff) disabled
Memory Block 16 (0x0000000100000000-0x000000010fffffff) disabled
Memory Block 17 (0x0000000110000000-0x000000011fffffff) disabled
Memory Block 18 (0x0000000120000000-0x000000012fffffff) disabled
This is based on a patch from Clemens von Mann.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Move the s390 specific lsmem tool to util-linux.
The lsmem tool was originally written in perl and is part of the
s390-tools package which can be found here:
https://www.ibm.com/developerworks/linux/linux390/s390-tools.html
Given that the tool is architecture independent, there is no reason to
keep it in an s390 specific repository. It seems to be useful for
other architectures as well.
This patch converts the tool to C and adds it to util-linux, while the
command line options stay compatible. The only exception is the option
"-v" which used to be the short form of "--version". That got changed
to "-V" so it behaves like most other tools contained within
util-linux.
The lsmem tool inspect the contents of /sys/devices/system/memory and
prints a summary output similar to what lscpu does:
RANGE SIZE STATE REMOVABLE BLOCK
0x0000000000000000-0x000000005fffffff 1,5G online yes 0-5
0x0000000060000000-0x000000007fffffff 512M online no 6-7
0x0000000080000000-0x000000013fffffff 3G online yes 8-19
0x0000000140000000-0x000000014fffffff 256M offline - 20
0x0000000150000000-0x000000017fffffff 768M online no 21-23
Memory block size : 256M
Total online memory : 5,8G
Total offline memory: 256M
In order to keep the output small the tool merges subsequent address
ranges where the attributes are identical. To avoid merging of line
the "-a" option can be used.
The lsmem tool also has "--extendend" and "--parsable" option which
can be used to customize the output, e.g. limit the output to
specified columns. This is quite similar to what the lscpu tool does.
This is based on a patch from Clemens von Mann.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
It's painful, but ncurses upstream does not distribute .pc files by
default and it seems that ncurses{6,5}-config is the preferred solution.
For better compatibility lets use ncurses-config.
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
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>
The pg command is marked deprecated in POSIX since 1997, and this project
has thought the same since Feb 2013. Time has come to stop shipping this
binary by default.
Reference: 956e582874
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
It seems that globally defined dependence between ncursesw and
wide-char support is overkill, because in some cases (e.g. cal(1)) we
can use ncurses independently on wide-char support.
It would be better to care about relation between wide-char and
ncurses individually (per util).
Signed-off-by: Karel Zak <kzak@redhat.com>
* error if wide-char enabled/supported, but (non-wide) ncurses
explicitly requested
* disable ncurses at all if widechar enabled/supported, but ncursesw
not found
Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
* don't use UL_CHECK_LIB(), only use pkg-config to avoid complexity
* split --with-ncursesw and --with-ncurses; ncurses (widechar) is the
default, check for ncurses only if ncursesw disabled/unavailabled
* don't use generic placeholders, just have_ncursesw and have_ncurses
Signed-off-by: Karel Zak <kzak@redhat.com>
uClibc-ng tries to be compatible with GNU libc and defines
__GLIBC__ and pretend to be version 2.2.
We once changed it to 2.10, but then some hard to fix problems
in different software packages (gcc) occured.
It would be better if we disable the special GNU libc checks
for uClibc-ng here. uClibc-ng implements the required scanf
functionality.
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
The UL_DEFAULT_ENABLE modifies $enable_<name> according to the global
--enable-all-programs. This makes sense only for programs, but not for
any built-in code.
Signed-off-by: Karel Zak <kzak@redhat.com>
The plymouth support depends on Linux specific SOCK_* flags and all
the feature is probably unnecessary in some cases (non-plymouth
distros, etc.)
Signed-off-by: Karel Zak <kzak@redhat.com>
The file mtab is evil and already unused by mainstream distributions.
Now libmount is able to detect mtab->/proc/mounts and use
/proc/self/mountinfo if necessary. This heuristic seems overkill in
many cases. It's also dangerous on systems where mountinfo is strongly
required (systemd based distros).
This patch #ifdefs mtab code and forces libmount to always use
/proc/self/mountinfo.
The new configure option --enable-libmount-support-mtab is necessary
to enable old behavior to support mtab.
Signed-off-by: Karel Zak <kzak@redhat.com>
Now we are able to disable all programs which have systemd/journald
support. This feature is needed by openSUSE packagers who are building
util-linux in 2 stages to avoid build cycles.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Otherwise configure output looks like this:
configure: WARNING: not found; not building cfdisk
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This reverts commit c8494d88:
"build-sys: fix UL_SCANF_TYPE_MODIFIER for icc"
plus fix the check prog, because it found "%as" to be valid on
systems where "%a" is used for float conversion.
icc warns about "%ms" but it works anyways. Our AC_RUN_IFELSE prog
should do it right now regardless of compiler warnings.
Note "%ms" is POSIX.1-2008 standard but still not available on
many systems. Maybe it's time to remove "%as" fallback for old
glibc which is even less portable.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
ipcs's source history looks like some people are using it on BSD
but it won't build on most non-Linux systems. That's why it's nice
let "./configure --disable-ipcrm --disable-ipcs" work.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Actually we could have also used UL_REQUIRES_LINUX because our
utmp usage and the shadow.h header is unlikely to be portable.
However only requiring these headers may help others who are
curious what needs to be done to port something.
Note, we could easily make the utmp stuff more portable by using
utmpx which is POSIX standard and on LINUX (glibc) basically just
renaming work. See getutxent(3).
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
features.h: any glibc header includes this already
libgen.h: was unused there
sys/uio.h: for writev(3p)
sys/queue.h seems like it was never used
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Introduce a dependency so that libmount.so is installed before
pylibmount.so, so that when libtool tries to relink it, it can find
libmount.so in the destdir.
We introduce this additional make rule through an AC_SUBST variable, to
prevent automake from trying to interpret that. This trick has been
suggested in http://stackoverflow.com/a/8643550.
This fixes a failure of `make install DESTDIR=...` when trying to relink
pylibmount against libmount.la. libtool will look for libmount.so under
${DESTDIR}/${libdir} in that case, but if it is not yet present there,
libtool assumes it is a system installed library and use -lmount
instead, which causes the following failure if libmount is not installed
on the base system yet:
libtool: install: warning: relinking `pylibmount.la'
libtool: install: (... libtool --mode=relink gcc -o pylibmount.la \
-rpath /usr/lib/python2.7/dist-packages/libmount \
libmount/python/*.lo libmount.la ... -lpython2.7 \
-inst-prefix-dir /path/to/destdir)
/usr/bin/ld: cannot find -lmount
collect2: error: ld returned 1 exit status
libtool: install: error: relink `pylibmount.la' ...
make[3]: *** [install-pylibmountexecLTLIBRARIES] Error 1
This seems to be a previously encountered issue, since automake includes
a hack to insert such a dependency rule to install all libLTLIBRARIES
before attempting to install binPROGRAMS, initially introduced in the
commit below:
http://git.savannah.gnu.org/cgit/automake.git/commit/?id=bd4a1d5ad1a72fa780a8b7fd6c365a5dad2e6220
Also related bug from Ubuntu tracker:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1442076
Tested that `make install` starts working again after this commit, even
when libmount-dev is not installed on the system. Also confirmed that
`make distcheck` is now functional.
Confirmed that the all the files expected in the Python directory (both
__init__.py and pylibmount.so) are present after an install.
Tested that parallel install works, the dependency is always respected
since it's explicit.
Inspected the generated Makefile and confirmed that the definition of
install-pylibmountexecLTLIBRARIES (generated by automake) and the
explicit dependency we introduced are both present.
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
- add --with-btrfs (enabled by default)
- check for linux/btrfs.h
- add "btrfs" to libmount features list (see mount -V)
- #ifdef HAVE_BTRFS_SUPPORT for all btrfs stuff in libmount
Signed-off-by: Karel Zak <kzak@redhat.com>
lscpu currently prints information for CPUs configured in the system.
In case of KVM or other virtualized guest operating systems, this
refers to the virtual system, and bears no relation to the physical
topology of the system.
It would be useful if lscpu could also display the physical topology
info when available:
$ ./lscpu
Architecture: ppc64le
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 16
NUMA node(s): 1
Model: IBM pSeries (emulated by qemu)
Hypervisor vendor: KVM
Virtualization type: para
L1d cache: 64K
L1i cache: 32K
NUMA node0 CPU(s): 0-15
Physical sockets: 2 <<< New
Physical chips: 4 <<< New
Physical cores/chip: 4 <<< New
For now, physical topology information is available on platforms that
support the following RTAS (Real time abstraction service) call provided
by librtas:
rtas_get_sysparm(PROCESSOR_MODULE_INFO).
Currently this call is available to the PowerVM (pHYP) guests on PowerPC.
With a patch propoosed to PowerKVM, this RTAS call would also be available
to PowerKVM guests.
Based on input from Nishanth Aravamudan and Karel Zak.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Now we bump only PACKAGE_VERSION_MAJOR and PACKAGE_VERSION_MINOR
numbers. The PACKAGE_VERSION_RELEASE is always zero.
These numbers are used for LIBxxx_VERSION strings and Version: field
in the .pc files.
Unfortunately, if we keep PACKAGE_VERSION_RELEASE= always zero then
our bugfix releases are invisible for pkg-config.
(Although I don't think it's good idea to depend in code on any
library bugfix release, code should be about APIs).
Addresses: https://github.com/systemd/systemd/pull/1754
Signed-off-by: Karel Zak <kzak@redhat.com>
configure should include errno.h instead of argp.h when
checking for presence of program_invocation_short_name
uclibc defines this to be const char* unlike util-linux-ng
which defines this to be char* so this error goes unnoticed
on glibc/eglibc systems.
here is the error it fixes
in file included from mountP.h:14:0,
from cache.c:29:
/home/kraj/work/slugos/build/tmp-slugos-uclibc/sysroots/nslu2le/usr/include/errno.h:55:46: error: conflicting types for '__progname'
../../../include/c.h:118:14: note: previous declaration of '__progname' was here
make[3]: *** [cache.lo] Error 1
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jonathan Liu <net147@gmail.com>
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>
It's necessary for people who want to compile util-linux in very
unusual environment and disable as much as possible dependencies.
For example distro bootstrap.
References: https://bugzilla.redhat.com/show_bug.cgi?id=1223894
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch adds support for building a static version of unshare.
We need to add unshare to the list of possible static programs, and
provide build flags for the compiler and linker, which are equivalent to
the flags of the non-static program, except additional static linking.
See also: commit 2fa60c5 build-sys: support nsenter.static
Signed-off-by: Georg Schiesser <georg.schiesser@opentech.at>
and use this variable for $READLINE_LIBS_STATIC.
Note the patch also moves READLINE checks after TINFO check.
Signed-off-by: Karel Zak <kzak@redhat.com>
It seems that musl libc and uClibc without UCLIBC_NTP_LEGACY
does not provide ntp_gettime and compile will fail.
References: https://github.com/karelzak/util-linux/issues/174
Signed-off-by: Karel Zak <kzak@redhat.com>
* 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>
Signal ALRM raised by the timer, and the timer only, will be considered
as a timeout criteria.
Secondly time interval is made to use monotonic clock. Documentation of
ITIMER_REAL is unclear whether that time is affected various sources of
clock skew, or does it even tick when system is suspended.
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The directories /{sbin,bin} are symliks to /usr/{sbin,bin} on many
systems. This patch add new ./configure option to remove the non-usr
paths from the default $PATH environment variable.
The default $PATH is hardcoded in login(1) and can be overwritten
by /etc/login.defs.
default:
./test_pathnames | grep DEFPATH
_PATH_DEFPATH /usr/local/bin:/bin:/usr/bin
_PATH_DEFPATH_ROOT /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
--enable-usrdir-path:
./test_pathnames | grep DEFPATH
_PATH_DEFPATH /usr/local/bin:/usr/bin
_PATH_DEFPATH_ROOT /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
This patch does not modify install paths, you still have to care about
--{bin,lib}dir configure options.
Signed-off-by: Karel Zak <kzak@redhat.com>
The current implementation assumes that all terminals supports colors
and users are forcet to use terminal-colors.d/ to disable colors for
some terminals.
This patch checks for maximal supported colors for the current
terminal and colors are automatically disabled for terminals like
vt100.
The patch moves lib/colors.c from libcommon.la to libtcolors.la to
avoid collisions with another utils.
Signed-off-by: Karel Zak <kzak@redhat.com>
The current util-linux is to have enabled colorized outputs by
default, this default behavior is possible to change by new configure
option --disable-colors-default.
Signed-off-by: Karel Zak <kzak@redhat.com>
The default libmount mtab management depends on mtan symlink. If the
symlink exists than libmount parses /proc/self/mountinfo, otherwise it
parses regular classic /etc/mtab. This is backwardly compatible and
transparent solution.
Unfortunately, this is not robust enough because some broken init
scripts or 3-party mount helpers may remove the symlink and create
regular mtab file. This is pretty bad if initd (systemd) depends on
libmount.
Fortunately we known that mtab is absolutely unwanted on some distros,
so it's fine too ignore mtab at all and don't care about the symlink.
Reported-by: Martin Pitt <martin.pitt@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Make compilation to work in systems which don't have sys/timex.h and its
ntp_gettime().
Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Samuel Thibault <sthibault@debian.org>
icc needs -Werror to let %m fail and to avoid this:
../libmount/src/tab_parse.c(61): warning #269: invalid format string conversion
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
The strtoull() is part of ISO/IEC 9899:1999 (aka C99) and the function
has been happily used in prlimit(1) since 2011-10-19 without anyone
complaining compatibility issues.
Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/strtoul.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
- symbols versioning
- SONAME from configure.ac
- library version to header file
- modify build-sys to compile and install shared lib
Signed-off-by: Karel Zak <kzak@redhat.com>
It seems better to warn about --reload in ./configure if futimens or
inotify_init1 are missing.
The patch also replaces futimes() with futimens() to make the code
compatible with Uclibc.
Addresses: https://github.com/karelzak/util-linux/issues/133
Signed-off-by: Karel Zak <kzak@redhat.com>
Patch add:
--intro-command string : send command to modem
--pause value : define delay between intro command and ldattach
Based on patch from Martin Schmid <scm@aps-systems.ch>
Signed-off-by: Karel Zak <kzak@redhat.com>
The tests failed with following message in config.log
ERROR: LeakSanitizer: detected memory leaks
Direct leak of 2 byte(s) in 1 object(s) allocated from:
#0 0x49a40e in realloc (/home/src/util-linux/conftest+0x49a40e)
#1 0x7fbe48633e69 in __GI__IO_vfscanf (/usr/lib/libc.so.6+0x56e69)
#2 0x7fbe48649786 in _IO_vsscanf (/usr/lib/libc.so.6+0x6c786)
which knocked out libmount from build, and commands depending on it.
The reason this change makes sense is that AddressSanitizer seems like a
good addition to set of tools that util-linux package can use, when and
if needed.
Reference: https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer
Reviewed-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* 'misc' of git://github.com/kerolasa/lelux-utiliteetit:
textual: share crypt() error message in sulogin and newgrp
newgrp: avoid use of obsolete getpass() function
newgrp: use libc function to read gshadow if it is available
setarch: use personality() system call when it is available
setarch: reindent code
hwclock: remove referal to deprecated keyboard interface
eject: make open_device() and select_speed() to use struct eject_control
eject: add struct eject_control to remove global variables
mountpoint: simplify if statement
mkfs.minix: fix couple compiler warnings
mountpoint: add struct mountpoint_control
last: improve code readability by renaming variable names
last: make is_phantom() when kernel config does not include audit support
lib: remove xgetpass()
include: simplify fputc_careful() in carefulputc.h
libuuid: add extern qualifiers to uuid/uuid.h system header
This enables libmount to build on non-linux, which also
means we can build fsck on non-linux again.
(Since the context part of libmount still needs porting,
building the mount utility has instead been restricted
to only build on Linux.)
This has been build-tested on Debian GNU/kFreeBSD.
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
The glib versionf of getsgnam() is using /etc/nsswitch.conf, allowing the
group passwords to come from external database.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* with configure --prefix=$HOME --libdir=$HOME usrlib_execdir
ends up being ${exec_prefix}/${libbir}, which is double-prefixed
* fix: use explict given ${libbir} if is matches ${prefix}/*
Signed-off-by: Christoph Junghans <ottxor@gentoo.org>
Add an 'agetty --reload' command which asks all running agetty
commands to display their prompts again.
Several of the /etc/issue escape codes such as \4 and \S depend on
variable data which can change after the agetty prompt is displayed.
This can cause stale data to be displayed when a user looks at a VT,
especially in cases of DHCP racing with system start up.
We never want this to occur once the user has started typing a
user name. So we detect when the user starts typing, after which
no further reprompting occurs after that point.
[kzak@redhat.com: - add #ifdefs to make it usable on non-inotify systems,
- use futimens() with NULL timespec
- add --reaload to usage()]
Signed-off-by: Stef Walter <stefw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
The "linux only" check for pivot_root seems to suffer from
a cut-n-paste problem from the earlier switch_root part.
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
We avoid or fix many portability issues.
The first more generic "sort --version-sort" solution was almost
useless anyway because autopoint itself can also only deal with
a few hardcoded versions.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
We add a little hack for backward compatibility on systems with
older gettext installed
See 0576dbd3 and 81ed13ed.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* globally disable all Python bindings by --without-python
* use --with-python=<version> to specify Python version
* --enable-pylibmount to override --disable-all-programs
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
This is necessary to build only explicitly specified program/library,
for example to build only libblkid.so
./configure --disable-all-programs --enable-libblkid
or to build only hwclock(8):
./configure --disable-all-programs --enable-hwclock
Signed-off-by: Karel Zak <kzak@redhat.com>
Assumption is there are not many who need this tool. Whom ever they
might be the recommendation is to use the command from old util-linux
release. Second reason to removal is difficulty to test hardware
specific command when none of the active project members does not seem to
have such. Basically the command has reached dead end what comes to
maintainability of it.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This reverts commit 0576dbd3ea.
There is two possible ways:
1/ autotools complains that gettext 0.18 uses deprecated macro
2/ users complain that 0.18.2 is too new and they cannot rebuild
We care about users and project contributors, so let's live for the
next util-linux release with the old stupid gettext 0.18.
Signed-off-by: Karel Zak <kzak@redhat.com>
* systemd (since v209) uses only one library (when compiled
without --enable-compat-libs)
* all systemd build-sys stuff is merged into HAVE_SYSTEMD
(automake) and HAVE_LIBSYSTEMD (C macro) now
* all is controlled by --with-systemd, default is to automatically
check for systemd libs
* no more --enable-socket-activation and --enable-journald
Signed-off-by: Karel Zak <kzak@redhat.com>
The function is no critical for fdisk functionality. The SUN label
verification will check for less issues. All the verification code is
optional ('v' fdisk command).
Signed-off-by: Karel Zak <kzak@redhat.com>
Note that open_memstream() is POSIX-1.2008, so it's possible than not
all libc have already implemented this function.
Signed-off-by: Karel Zak <kzak@redhat.com>
The autopoint is designed to not use the latest installed bug fix
release, if you specify
AM_GNU_GETTEXT_VERSION([0.18])
in your configure.ac then it really uses 0.18, rather than also
installed 0.18.2 or 0.18.3. It means that bug fix update has no any
effect. Oh...
The AM_PROG_MKDIR_P is deprecated for years, unfortunately still used
in 0.18 gettext m4 stuff. This problem should be fixed in 0.18.2 where
is the correct AC_PROG_MKDIR_P macro.
If you do not have gettext 0.18.2 (or 0.18.3) then update.
Signed-off-by: Karel Zak <kzak@redhat.com>
This feature is hopefully mostly used to give MESSAGE_ID labels for
messages coming from scripts, making search of messages easy. The
logger(1) manual page update should give enough information how to use
--journald option.
[kzak@redhat.com: - add missing #ifdefs
- use xalloc.h]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
[kzak@redhat.com: - remove USE_SOCKET_ACTIVATION and use
HAVE_* as we use for another libs]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
This avoids unneeded churn during POT-file renewal and PO-file updates,
as the PO files at the TP are made with '--no-wrap'.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Acked-by: Sami Kerola <kerolasa@iki.fi>
* it seems that we don't have to link the utils with ncurses, tinfo is enough.
This change saves one unnecessary dependence.
* libtinfo is also distributed with pkg-config files, so we can use
PKG_CHECK_MODULES() as a primary source for LIBS and CFLAGS.
* add TINFO_CFLAGS (although it's probably always empty)
Signed-off-by: Karel Zak <kzak@redhat.com>
__sighandler_t is libc implementation specific and should not be relied
upon. Instead, we fall back upon void (*)(int), as specified by POSIX.
Signed-off-by: Karel Zak <kzak@redhat.com>
sys/types.h: For u_char typedef
sys/params.h: For MAXNAMLEN
sys/ttydefaults.h: For various tty definitions (also add configure check)
Signed-off-by: Karel Zak <kzak@redhat.com>
This allows './configure --enable-most-builds' and 'make distcheck' to
work when both python2 and python3 are installed, and user has set python
version preference using symlink and PATH order.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The ncurses package has been providing pkg-config files for a while now.
So let's start using them to get the proper linker & compiler flags. It
can make a difference when ncurses is configured in a way that requires
extra link time flags but util-linux doesn't provide them, or when the
headers live in a weird place and util-linux can't find them.
Since the NCURSES_LIBS is always defined for the Makefile, there's no need
to gate on the HAVE_NCURSES conditional. When it's disabled, the var will
simply be empty.
With a minor tweak to how tinfo is handled, we can do the same thing -- we
just always use TINFO_LIBS in the Makefile's.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>