* '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
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.
Signed-off-by: Werner Fink <werner@suse.de>
Add a new fstab tests which check loop mount of the same source multiple times
in multiple steps.
The test is currently failing, but it should not fail once the triggering bug
will be fixed.
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Many tests do.
2>&1 >> $TS_OUTPUT
It redirects stdout to $TS_OUTPUT and stderr to stdout.
It could cause unintended ignoring of errors on strerr and false positive result
of the test.
Use
>> $TS_OUTPUT 2>&1
instead to redirect both stdout and stderr to $TS_OUTPUT.
Automatically created by:
cd tests/ts
sed -i 's:2>\&1 >> \$TS_OUTPUT:>> $TS_OUTPUT 2>\&1:g' $(fgrep -rl '2>&1 >> $TS_OUTPUT' .)
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
btrfs needs a special support in mount. Add a testcase for btrfs specific
problems.
Coverage:
352740e8: bind mounts pointing to btrfs
2cd28fc8: mounting default subvolume
d2f82678: use of "auto"
618a8814: use of "subvolid"
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
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]
snprintf(buf, sizeof(buf), "%d%s%jd%s", dec, dp, frac, suffix);
~~~ ^~~~
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]
clock_seq, last.tv_sec, last.tv_usec, adjustment);
^~~~~~~~~~~~
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* use and initialize ctl->{label,uuid,device} by do_swapon() only
* remove ctl->canonic, function arguments are good enough for this
Signed-off-by: Karel Zak <kzak@redhat.com>
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.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
The initial implementation has been introduced by SCOLS_FL_WRAP columns,
but this patch clean ups all and makes things more elegant.
Note that use SCOLS_FL_TREE | SCOLS_FL_WRAP for a column is bad idea
and I don't think we need to fix it.
References: https://github.com/karelzak/util-linux/issues/269
Signed-off-by: Karel Zak <kzak@redhat.com>
Commit 324330aca6 ("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>
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>
The reimplementation caused output to change in some corner cases, such as
how binary inputs, long lines with underscores, and white space trimming,
are handled.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This implementation aims to be easier to read, more robust dealing all sorts
of unexpected inputs, and possibly even more correct. The correctness
refers to last line handling this implementation does differently than the
previous. With the previous last line that ended to EOF without \n was not
printed.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Output formats are based on colcrt before recent asan fixes and magic
constant replace, that are the commits ee24ab6f1..70e3fcf29. It seems the
fixes caused unintentional, and not detected change to output format - which
to me means colcrt has a regression that got to be part of release v2.27.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>