Compiler warning discoverd this issue:
libmount/src/fs.c:1171:5: warning: no previous prototype for 'mnt_fs_set_priority' [-Wmissing-prototypes]
int mnt_fs_set_priority(struct libmnt_fs *fs, int prio)
^
Ruediger Meier [Mon, 22 Feb 2016 18:48:30 +0000 (19:48 +0100)]
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.
Karel Zak [Fri, 19 Feb 2016 15:43:28 +0000 (16:43 +0100)]
libsmartcols: support continuous printing
This patch allows to disable line-breaks. This feature is usable when
you want to re-print the same line more than once -- move terminal
cursor to the begin of the line and print again and again (aka
progress bar).
Karel Zak [Fri, 19 Feb 2016 10:30:53 +0000 (11:30 +0100)]
Merge branch 'port-osx' of https://github.com/rudimeier/util-linux
* 'port-osx' of https://github.com/rudimeier/util-linux:
include: fix sys/sysinfo.h
libblkid: don't include endian.h
lib: fix ismounted includes for FreeBSD
lib: remove unused variable
lsns: use xcalloc()
include: remove unused mntent.h
include: check for sys/sysmacros.h
lib: define LOGIN_NAME_MAX fallback
include: provide MAP_ANONYMOUS on OSX
lib: rename strmode() and setmode()
tests: fix ts_option helpers
build-sys: fix [g]libtoolize version for OSX
build-sys: check linker support for version scripts
build-sys: portable usage of find command
travis: minor cleanup
Karel Zak [Thu, 18 Feb 2016 11:57:13 +0000 (12:57 +0100)]
sfdisk: add --wipe
This patch changes sfdisk behavior and it wipes foreign signatures
from the device to avoid collisions. The wipe functionality is
automatically enabled in the interactive mode only (user is always
warned about it), otherwise it's possible to control all by --wipe
<auto|never|always>.
The program does not change behavior when executed in scripts (echo
<something> | sfdisk), the option "--wipe=always" is required to enable
in this case.
Karel Zak [Thu, 18 Feb 2016 11:50:11 +0000 (12:50 +0100)]
fdisk: add --wipe
This patch changes fdisk behavior and it wipes foreign signatures
from the device to avoid collisions. The wipe functionality is
automatically enabled in the interactive mode only (user is always
warned about it), otherwise it's possible to control all by --wipe
<auto|never|always>.
The program does not change behavior when executed in scripts (echo
<something> | fdisk), the option "--wipe=always" is required to enable
in this case.
Karel Zak [Thu, 18 Feb 2016 11:42:06 +0000 (12:42 +0100)]
libfdisk: add API to control signatures wiping
Now libfdisk warns if another filesystem/RAID/PT signature is detected
on the device. It seems better and user-friendly to make it possible to
wipe the signatures when we write a new disk label to the device.
Ruediger Meier [Wed, 17 Feb 2016 14:01:21 +0000 (15:01 +0100)]
tests: fix ts_option helpers
These two problems should be fixed now:
- BSD awk only accepts 1-char field seperator
- ts_has_option() did not returned "yes" if an option was given
multiple times
unshare: fix busyloop and reduce racing probability
Replace busy-loop with waiting on pipe from parent.
Note: reduces racing probability, but still there are window where
it is possible (if parent unshare process will be [externally] killed
between successful read(fds[0]) and mount() calls).
[kzak@redhat.com: - use all-io.h to avoid loops around write() and read(),
- use less generic 0x06 byte to sync parent and child]
Signed-off-by: Yuriy M. Kaminskiy <yumkam@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 16 Feb 2016 09:27:56 +0000 (10:27 +0100)]
build-sys: use $PKG_CONFIG
Reported-by: Helmut Grohne <helmut@subdivi.de>
References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811546 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 12 Feb 2016 12:35:18 +0000 (13:35 +0100)]
Merge branch 'compiler-warnings' of https://github.com/rudimeier/util-linux
* 'compiler-warnings' of https://github.com/rudimeier/util-linux:
exec_shell: prevent basename from modifying env
lib/path: ifdef path_set_prefix() like in path.h
lib: fix unused parameters and variables
misc: fix some printf format strings
include: add missing includes
ipcs: ulong -> unsigned long
libcommon: don't include sysinfo.h
Werner Fink [Thu, 11 Feb 2016 12:35:26 +0000 (13:35 +0100)]
sulogin: avoid shared memory area usemask but use waitid() for childs
This small patch improves the console detection code and also avoids not
existing device nodes due strdup() which is used in canonicalize_path().
Beside this now the code for emergeny mount does work if enabled at
configure time.
Ruediger Meier [Tue, 9 Feb 2016 17:08:56 +0000 (18:08 +0100)]
misc: fix some printf format strings
Fix the warnings below for OSX clang and add a few more
casts for timeval:
lib/at.c:131:27: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'off_t' (aka 'long long') [-Wformat]
printf("%16jd bytes ", st.st_size);
~~~~~ ^~~~~~~~~~
lib/strutils.c:522:52: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
lib/sysfs.c:468:42: warning: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
len = snprintf(buf, sizeof(buf), "%ju", num);
~~~ ^~~
libuuid/src/gen_uuid.c:316:34: warning: format specifies type 'unsigned long' but the argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
Sami Kerola [Tue, 2 Feb 2016 13:40:10 +0000 (13:40 +0000)]
swapon: do not run execvp() calls when swapon is setuid binary
swapon(8) is not expected to be setuid binary, but if it is try to avoid
obvious security vulnerability of executing user preferred mkswap file as
someone else, such as root.
Sami Kerola [Tue, 2 Feb 2016 13:40:09 +0000 (13:40 +0000)]
swapon: move function arguments to control structure
This makes reading what the code does easier. This change also makes error
messages to prefer none-canonical device path, e.g., the one user supplied
rather than the canonical path needed internally.
Ruediger Meier [Wed, 3 Feb 2016 23:58:04 +0000 (00:58 +0100)]
tests: ts_fdisk_clean(), remove optimal iosize
It's a pity a pity that we have to remove it. In past our test suite
could discover a kernel bug (4.4). But now they've changed optimal
iosizes on purpose.
travis: Remove workaround for libtool install of pylibmount
Commit 324330aca6443d ("build-sys: Properly order install dependencies
of pylibmount") introduces a proper make dependency for the install
rules, in a way that the workaround is no longer necessary.
Tested that a PR with this commit passes Travis-CI.
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
build-sys: Properly order install dependencies of pylibmount
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:
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>