]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
10 years agobuild-sys: fix UL_SCANF_TYPE_MODIFIER for icc
Ruediger Meier [Tue, 20 Jan 2015 13:55:57 +0000 (14:55 +0100)] 
build-sys: fix UL_SCANF_TYPE_MODIFIER for icc

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>
10 years agobuild-sys: free() needs stdlib.h
Ruediger Meier [Tue, 20 Jan 2015 13:37:38 +0000 (14:37 +0100)] 
build-sys: free() needs stdlib.h

followup 4f310fae

CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agobuild-sys: avoid icc warnings "ignoring unknown option"
Ruediger Meier [Tue, 20 Jan 2015 12:49:55 +0000 (13:49 +0100)] 
build-sys: avoid icc warnings "ignoring unknown option"

Our macro UL_WARN_ADD could not discover these ones:
icc: command line warning #10006: ignoring unknown option '-Wmissing-parameter-type'
icc: command line warning #10006: ignoring unknown option '-Wredundant-decls'
icc: command line warning #10006: ignoring unknown option '-Wunused-result'
icc: command line warning #10006: ignoring unknown option '-Wnested-externs'

We need to use AC_LANG_WERROR.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: python tests should not remove user's LD_LIBRARY_PATH
Ruediger Meier [Tue, 20 Jan 2015 11:22:35 +0000 (12:22 +0100)] 
tests: python tests should not remove user's LD_LIBRARY_PATH

LD_LIBRARY_PATH must be preserved like it's done in libtool's
temporary wrapper scripts.

This problem was noticed when building with Intel's icc (15.0.0):
$ make check TS_OPTS="libmount"
$ tail tests/diff/libmount/tabfiles-py-parse-mtab
[...]
+Traceback (most recent call last):
+  File "/tmp/util-linux/libmount/python/test_mount_tab.py", line 8, in <module>
+    import pylibmount as mnt
+ImportError: libimf.so: cannot open shared object file: No such file or directory

... although libimf.so was in LD_LIBRARY_PATH.

NOTE 1:
  When running root checks "sudo -E" is not enough to preserve
  LD_LIBRARY_PATH because glibc already removes is. This would work:
  $ sudo -E env LD_LIBRARY_PATH=$LD_LIBRARY_PATH make check TS_OPTS="--parallel=1"

NOTE 2:
  We also preserve PYTHONPATH which could bring us similar problems if
  the user has a customized python installation.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agolibmount: revert "read mtab on remount" idea
Karel Zak [Fri, 16 Jan 2015 11:24:57 +0000 (12:24 +0100)] 
libmount: revert "read mtab on remount" idea

It's backwardly incompatible nonsense to prefer mtab on remount.

 mount -o remount /foo

has to read mount options from fstab otherwise the remount has no
effect. (The ideal solution would be to read both mtab, then modify
the options according to fstab -- but for now more important is to be
backwardly compatible.)

References: https://bugzilla.redhat.com/show_bug.cgi?id=1182778
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibblkid: (bcache) fix keys usage
Karel Zak [Thu, 15 Jan 2015 10:56:27 +0000 (11:56 +0100)] 
libblkid: (bcache) fix keys usage

References: http://bugs.debian.org/775374
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodocs: fix typos
Karel Zak [Wed, 14 Jan 2015 19:39:52 +0000 (20:39 +0100)] 
docs: fix typos

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: release++ (v2.26-rc1) v2.26-rc1
Karel Zak [Wed, 14 Jan 2015 11:51:33 +0000 (12:51 +0100)] 
build-sys: release++ (v2.26-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodocs: update v2.26-ReleaseNotes
Karel Zak [Wed, 14 Jan 2015 11:50:18 +0000 (12:50 +0100)] 
docs: update v2.26-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agofdisk: add --output to usage()
Karel Zak [Wed, 14 Jan 2015 11:07:52 +0000 (12:07 +0100)] 
fdisk: add --output to usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodocs: update AUTHORS file
Karel Zak [Wed, 14 Jan 2015 10:17:11 +0000 (11:17 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agopo: merge changes
Karel Zak [Wed, 14 Jan 2015 10:08:35 +0000 (11:08 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodocs: add TODO entry for libblkid
Karel Zak [Wed, 14 Jan 2015 09:59:56 +0000 (10:59 +0100)] 
docs: add TODO entry for libblkid

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agopo: update zh_TW.po (from translationproject.org)
Wei-Lun Chao [Wed, 14 Jan 2015 09:49:02 +0000 (10:49 +0100)] 
po: update zh_TW.po (from translationproject.org)

10 years agopo: update zh_CN.po (from translationproject.org)
Wylmer Wang [Wed, 14 Jan 2015 09:49:02 +0000 (10:49 +0100)] 
po: update zh_CN.po (from translationproject.org)

10 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update vi.po (from translationproject.org)

10 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update uk.po (from translationproject.org)

10 years agopo: update ru.po (from translationproject.org)
Pavel Maryanov [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update ru.po (from translationproject.org)

10 years agopo: update pt_BR.po (from translationproject.org)
Rafael Ferreira [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update pt_BR.po (from translationproject.org)

10 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update pl.po (from translationproject.org)

10 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update nl.po (from translationproject.org)

10 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update ja.po (from translationproject.org)

10 years agopo: update fr.po (from translationproject.org)
David Prévot [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update fr.po (from translationproject.org)

10 years agopo: update fi.po (from translationproject.org)
Lauri Nurmi [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update fi.po (from translationproject.org)

10 years agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update es.po (from translationproject.org)

10 years agopo: update de.po (from translationproject.org)
Mario Blättermann [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update de.po (from translationproject.org)

10 years agopo: update da.po (from translationproject.org)
Joe Hansen [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update da.po (from translationproject.org)

10 years agopo: update cs.po (from translationproject.org)
Petr Písař [Wed, 14 Jan 2015 09:49:01 +0000 (10:49 +0100)] 
po: update cs.po (from translationproject.org)

10 years agoMerge branch 'isa' of github.com:jwpi/util-linux
Karel Zak [Wed, 14 Jan 2015 09:29:44 +0000 (10:29 +0100)] 
Merge branch 'isa' of github.com:jwpi/util-linux

* 'isa' of github.com:jwpi/util-linux:
  hwclock: update man-page for directisa change
  hwclock: remove automatic ISA fallback

10 years agohwclock: update man-page for directisa change
J William Piggott [Wed, 14 Jan 2015 01:31:47 +0000 (20:31 -0500)] 
hwclock: update man-page for directisa change

Update man-page for the direct ISA options
changes.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agohwclock: remove automatic ISA fallback
J William Piggott [Wed, 14 Jan 2015 01:29:21 +0000 (20:29 -0500)] 
hwclock: remove automatic ISA fallback

The old behavior when hwclock was unable to access
the rtc device was to fallback to direct ISA I/O.

This was sometimes allowing two processes to access
the Hardware Clock at the same time and hanging the
system. This is the reason the rtc device driver
only allows one process to open it.

Now hwclock defaults to using the rtc device and only
uses direct ISA when that option is given.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agodocs: fix-up man-pages flaged by checkmans.sh
J William Piggott [Tue, 13 Jan 2015 15:34:59 +0000 (10:34 -0500)] 
docs: fix-up man-pages flaged by checkmans.sh

disk-utils/sfdisk.8 Fix font escape
login-utils/vipw.8 Delete bogus macro
misc-utils/look.1 Delete bogus macro
sys-utils/prlimit.1 Delete bogus macro

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agotools: checkmans.sh add stats
J William Piggott [Tue, 13 Jan 2015 02:14:55 +0000 (21:14 -0500)] 
tools: checkmans.sh add stats

Add test results statistics.
Fix-up 'KNOWN_REPEATS'.
Version bump.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agotools: checkmans.sh clean up 'let'
J William Piggott [Tue, 13 Jan 2015 01:30:01 +0000 (20:30 -0500)] 
tools: checkmans.sh clean up 'let'

Clean up 'let' issues and loop iteration.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agotools: checkman.sh portability lexgrog
J William Piggott [Mon, 12 Jan 2015 20:19:45 +0000 (15:19 -0500)] 
tools: checkman.sh portability lexgrog

checkman.sh depends upon the man-db package:
   Add using grog when lexgrog not installed.

   /dev/null some troff noise.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agotools: checkman.sh portability
J William Piggott [Mon, 12 Jan 2015 19:26:06 +0000 (14:26 -0500)] 
tools: checkman.sh portability

checkman.sh fails if 'git' or 'lib' are
anywhere in the tested file's path:
   Change to using relative paths.
   Improve the 'find' command call.

checkman.sh depends upon the man-db package:
   Remove all instants of the man command and
   use troff directly to improve portability.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agobuild-sys: add sfdisk.static
Karel Zak [Tue, 13 Jan 2015 15:59:03 +0000 (16:59 +0100)] 
build-sys: add sfdisk.static

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: update build tests
Karel Zak [Tue, 13 Jan 2015 15:58:46 +0000 (16:58 +0100)] 
tests: update build tests

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agohwclock: exclude also i386 from CMOS auto-probing
Karel Zak [Tue, 13 Jan 2015 12:47:48 +0000 (13:47 +0100)] 
hwclock: exclude also i386 from CMOS auto-probing

10 years agolibfdisk: add version.c
Karel Zak [Tue, 13 Jan 2015 12:46:31 +0000 (13:46 +0100)] 
libfdisk: add version.c

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: fix some typos
Karel Zak [Tue, 13 Jan 2015 12:46:09 +0000 (13:46 +0100)] 
libfdisk: fix some typos

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibblkid: fix compiler warnings [-Wpointer-sign]
Karel Zak [Tue, 13 Jan 2015 12:40:25 +0000 (13:40 +0100)] 
libblkid: fix compiler warnings [-Wpointer-sign]

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibsmartcols: (docs) improve section descriptions
Karel Zak [Tue, 13 Jan 2015 11:23:40 +0000 (12:23 +0100)] 
libsmartcols: (docs) improve section descriptions

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibmount: (docs) add monitor example
Karel Zak [Tue, 13 Jan 2015 11:13:09 +0000 (12:13 +0100)] 
libmount: (docs) add monitor example

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodocs: update API docs years
Karel Zak [Tue, 13 Jan 2015 11:03:17 +0000 (12:03 +0100)] 
docs: update API docs years

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibmount: cleanup gtk-docs warnings
Karel Zak [Tue, 13 Jan 2015 10:57:15 +0000 (11:57 +0100)] 
libmount: cleanup gtk-docs warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibsmartcols: cleanup gtk-docs warnings
Karel Zak [Tue, 13 Jan 2015 10:56:57 +0000 (11:56 +0100)] 
libsmartcols: cleanup gtk-docs warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: cleanup gtk-docs warnings
Karel Zak [Tue, 13 Jan 2015 10:45:19 +0000 (11:45 +0100)] 
libfdisk: cleanup gtk-docs warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoraw: fix raw query
Karel Zak [Tue, 13 Jan 2015 08:53:46 +0000 (09:53 +0100)] 
raw: fix raw query

Bug introduced by commit cd121363.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1181444
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agohwclock: don't check CMOS automatically on x86_64
Karel Zak [Tue, 13 Jan 2015 08:44:11 +0000 (09:44 +0100)] 
hwclock: don't check CMOS automatically on x86_64

We have enabled CMOS also for x86_64, but it should be available only
if --directisa is explicitly specified.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agounshare: add some examples
Lubomir Rintel [Sun, 28 Dec 2014 20:23:37 +0000 (21:23 +0100)] 
unshare: add some examples

...and fix one typo.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agohwclock: man regression
JWP [Fri, 9 Jan 2015 18:43:38 +0000 (13:43 -0500)] 
hwclock: man regression

Fixes merge for commit 2ed1d70 that clobbered commit 98ac774

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agosetarch: cleanup options usage
Karel Zak [Mon, 12 Jan 2015 11:19:54 +0000 (12:19 +0100)] 
setarch: cleanup options usage

* call --help, --verbose and --list from one place only
* add 'archwrapper' variable to detect when called by symplink
* make --list available only got setchar(8) (but no for symlinks)

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodocs: mention that setarch may not be able to set all listed architectures
Benno Schulenberg [Sat, 10 Jan 2015 13:41:33 +0000 (14:41 +0100)] 
docs: mention that setarch may not be able to set all listed architectures

[[kzak@redhat.com: - use minus in option name\

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosetarch: differentiate between "unrecognized" and "cannot set"
Benno Schulenberg [Sat, 10 Jan 2015 13:41:32 +0000 (14:41 +0100)] 
setarch: differentiate between "unrecognized" and "cannot set"

When the provided string does not match any architecture that
setarch knows about, the response stays "Unrecognized architecture",
but when trying to set the specified architecture does not have any
effect, then respond with "Kernel cannot set architecture to...".

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agopartx: don't use "hard drive" in man pages
Karel Zak [Mon, 12 Jan 2015 10:15:55 +0000 (11:15 +0100)] 
partx: don't use "hard drive" in man pages

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodocs: make the wording of the partx man page a bit more precise
Benno Schulenberg [Sun, 11 Jan 2015 21:27:58 +0000 (22:27 +0100)] 
docs: make the wording of the partx man page a bit more precise

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agopartx: simplify a --verbose progress message
Benno Schulenberg [Sun, 11 Jan 2015 21:27:57 +0000 (22:27 +0100)] 
partx: simplify a --verbose progress message

Reported-by: Antonio Ceballos <aceballos@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agodocs: remove obsolete and unneeded comments from man-page files
Benno Schulenberg [Sun, 11 Jan 2015 21:27:56 +0000 (22:27 +0100)] 
docs: remove obsolete and unneeded comments from man-page files

Transform some of them into copyright lines.
Also fix three header lines and snip some trailing whitespace.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agodocs: sync the docstring of addpart, delpart and resizepart to the man page
Benno Schulenberg [Sun, 11 Jan 2015 21:27:55 +0000 (22:27 +0100)] 
docs: sync the docstring of addpart, delpart and resizepart to the man page

Also tweak the wording of those man pages a bit.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agopartx: add --update to ul_excl_twq list
Karel Zak [Mon, 12 Jan 2015 09:58:00 +0000 (10:58 +0100)] 
partx: add --update to ul_excl_twq list

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (gpt) cleanup header size usage
Karel Zak [Fri, 9 Jan 2015 12:05:49 +0000 (13:05 +0100)] 
libfdisk: (gpt) cleanup header size usage

Kay reported that Windows 8.1 installed does not recognize GPT created
by libfdisk, but parted works as expected.

It seems (according to the header hexdump) that the problem is
HeaderSize GPT field where libfdisk uses 512 (header + reserved area),
but parted uses 92. The both is pretty valid according to the current
EFI standard, but 92 is probably more backwardly compatible.

I also found places in code where libfdisk gpt driver is inconsistent
and uses sometimes all sector and simetimes sizeof(gpt_header) only.
The right solution is to read all sector (into zeroized memory) and
later write again all sector to the device.

Reported-by: Kay Sievers <kay@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoMerge branch 'master' of https://github.com/pali/util-linux
Karel Zak [Fri, 9 Jan 2015 09:54:56 +0000 (10:54 +0100)] 
Merge branch 'master' of https://github.com/pali/util-linux

* 'master' of https://github.com/pali/util-linux:
  tests: Add UDF hdd image created by NetBSD newfs_udf (from UDFclient 0.7.7)
  tests: Add UDF hdd image created by NetBSD newfs_udf (from UDFclient 0.7.5)
  tests: Add UDF hdd image created by Linux mkudffs with custom params
  tests: Add UDF hdd image created by Linux mkudffs
  tests: Add UDF hdd image created by Windows 7

10 years agohwclock: man page 'Since v2.26' notes
JWP [Thu, 8 Jan 2015 04:22:01 +0000 (23:22 -0500)] 
hwclock: man page 'Since v2.26' notes

Clean up the 'Since v2.26' man page notes.
They were redundant of information already
in the manual, and became too verbose.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agohwclock: update man page for v2.26 rc
JWP [Thu, 8 Jan 2015 04:18:52 +0000 (23:18 -0500)] 
hwclock: update man page for v2.26 rc

Authored new section: DATE-TIME CONFIGURATION.
Subsections: Keeping Time..., LOCAL vs UTC, POSIX vs 'RIGHT'.
Errata and drop outdated language.
Updates for v2.26

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agohwclock: Incorrect UTC defaults
JWP [Thu, 8 Jan 2015 04:15:39 +0000 (23:15 -0500)] 
hwclock: Incorrect UTC defaults

Hwclock's default timescale was changed to UTC in:

commit 7894bf0f08740f75610990a2ba76af7a7cbce61e
Date:   Mon Feb 21 13:27:07 2011 +0000

This change was incomplete.

With no /etc/adjtime file the current behavior is:
hwclock --utc --adjust        #Creates a UTC file.
hwclock --localtime --adjust  #File is not created.

That is the opposite of what UTC default should do.

With this patch the behavior is:
hwclock --utc --adjust        #File is not created.
hwclock --localtime --adjust  #Creates a LOCAL file.

'Creates a xxxx file' means: An /etc/adjtime file
is created with zero for all parameters except the
Hardware Clock's timescale field, which is set to
the value indicated by xxxx.

The second item missed in the patch was a test in
the save_adjtime() function that defaults to LOCAL.

Theoretically we cannot get to the save function
without having a value set for adjtime.local_utc,
but the test is there so it needs be correct.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agohwclock: enable --directisa for x86_64
JWP [Thu, 8 Jan 2015 04:13:21 +0000 (23:13 -0500)] 
hwclock: enable --directisa for x86_64

Currently only x86 and Alpha can use --directisa.
This patch allows x86_64 machines to use it as well.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agonsenter: add --preserve-credentials and cleanup setgroups() usage
Karel Zak [Thu, 8 Jan 2015 11:52:43 +0000 (12:52 +0100)] 
nsenter: add --preserve-credentials and cleanup setgroups() usage

The new option --preserve-credentials completely disables all
operations related to UIGs and GIDs.

The patch also calls setgroups() before we enter user namespace (so
root can always clear their groups) and after we enter user namespace
(to detect /proc/self/setgroups "deny"). If both fail then nsenter
complains.

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agonsenter: keep semantic consistent
Karel Zak [Thu, 8 Jan 2015 11:27:59 +0000 (12:27 +0100)] 
nsenter: keep semantic consistent

The current nseneter behavior is inconsistent and depends on way how
namespace is specified on command line

    # nsenter --user
vs.
    # nseneter --user=filename

if the namespace is specified by <filename> than nsenter does not do
additinal setting and actions (e.g. does not call setgroups, setuid).
This is bug.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agounshare: add --setgroups=deny|allow
Karel Zak [Thu, 8 Jan 2015 10:51:58 +0000 (11:51 +0100)] 
unshare: add --setgroups=deny|allow

Since Linux 3.19 the file /proc/self/setgroups controls setgroups(2)
syscall usage in user namespaces. This patch provides command line knob
for this feature.

The new --setgroups does not automatically implies --user to avoid
complexity, it's user's responsibility to use it in right context. The
exception is --map-root-user which is mutually exclusive to
--setgroups=allow.

CC: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agounshare: Fix --map-root-user to work on new kernels
Eric W. Biederman [Wed, 17 Dec 2014 23:06:03 +0000 (17:06 -0600)] 
unshare: Fix --map-root-user to work on new kernels

In rare cases droping groups with setgroups(0, NULL) is an operation
that can grant a user additional privileges.  User namespaces were
allwoing that operation to unprivileged users and that had to be
fixed.

Update unshare --map-root-user to disable the setgroups operation
before setting the gid_map.

This is needed as after the security fix gid_map is restricted to
privileged users unless setgroups has been disabled.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
10 years agotests: Add UDF hdd image created by NetBSD newfs_udf (from UDFclient 0.7.7)
Pali Rohár [Thu, 8 Jan 2015 16:50:38 +0000 (17:50 +0100)] 
tests: Add UDF hdd image created by NetBSD newfs_udf (from UDFclient 0.7.7)

$ dd if=/dev/zero of=/tmp/test bs=1M count=10
$ newfs_udf -L discname /tmp/test

Version from UDFclient 0.7.7 generate default Volume set identifier correctly.

10 years agotests: Add UDF hdd image created by NetBSD newfs_udf (from UDFclient 0.7.5)
Pali Rohár [Thu, 8 Jan 2015 16:46:58 +0000 (17:46 +0100)] 
tests: Add UDF hdd image created by NetBSD newfs_udf (from UDFclient 0.7.5)

$ dd if=/dev/zero of=/tmp/test bs=1M count=10
$ newfs_udf -L discname /tmp/test

Version from UDFclient 0.7.5 does not generate default Volume set identifier
according to OSTA UDF specification. But it is used so for test is usefull.

10 years agotests: Add UDF hdd image created by Linux mkudffs with custom params
Pali Rohár [Thu, 8 Jan 2015 16:29:58 +0000 (17:29 +0100)] 
tests: Add UDF hdd image created by Linux mkudffs with custom params

$ dd if=/dev/zero of=/tmp/test bs=1M count=10
$ mkudffs -b 512 --lvid=Label --vid=Label --vsid="Volume set identifier" /tmp/test

When calling mkudffs with --vsid param there is bug which cause that garbage
from application stack is copied into Volume set identifier after 8th character.
Characters 1 -- 16 are used in libblkid for generating UUID, so this is perfect
test example that everything is working!

10 years agotests: Add UDF hdd image created by Linux mkudffs
Pali Rohár [Thu, 8 Jan 2015 16:23:32 +0000 (17:23 +0100)] 
tests: Add UDF hdd image created by Linux mkudffs

$ dd if=/dev/zero of=/tmp/test bs=1M count=10
$ mkudffs -b 512 /tmp/test

10 years agotests: Add UDF hdd image created by Windows 7
Pali Rohár [Thu, 8 Jan 2015 16:11:52 +0000 (17:11 +0100)] 
tests: Add UDF hdd image created by Windows 7

10 years agoMerge branch '2015wk01' of https://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Thu, 8 Jan 2015 13:53:01 +0000 (14:53 +0100)] 
Merge branch '2015wk01' of https://github.com/kerolasa/lelux-utiliteetit

* '2015wk01' of https://github.com/kerolasa/lelux-utiliteetit:
  eject: add verbosity to cdrom door lock error
  libblkid: assume strtoull() is available
  ipcs: remove FIXME markup
  ul: remove unexplained TERM=lpr override
  look: remove dead code
  docs: make tools/checkmans.sh to pass without warnings
  build-sys: fix make checkincludes warnings
  docs: add howto-pull-request.txt
  docs: small improvements to howto-contribute.txt

Conflicts:
Documentation/howto-pull-request.txt

10 years agoMerge branch 'master' of https://github.com/pali/util-linux
Karel Zak [Thu, 8 Jan 2015 13:36:20 +0000 (14:36 +0100)] 
Merge branch 'master' of https://github.com/pali/util-linux

* 'master' of https://github.com/pali/util-linux:
  tests: update UDF test (add identifiers)
  libblkid: udf: Fix reading LABEL, add support for UUID and other udf identifiers
  libblkid: superblocks: Add function blkid_probe_set_utf8_id_label for setting utf8 id label

10 years agodocs: add howto-pull-request.txt
Sami Kerola [Wed, 7 Jan 2015 19:25:39 +0000 (19:25 +0000)] 
docs: add howto-pull-request.txt

Reference: http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/10431
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agodocs: small improvements to howto-contribute.txt
Sami Kerola [Wed, 7 Jan 2015 19:25:38 +0000 (19:25 +0000)] 
docs: small improvements to howto-contribute.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoeject: add verbosity to cdrom door lock error
Sami Kerola [Wed, 7 Jan 2015 22:33:09 +0000 (22:33 +0000)] 
eject: add verbosity to cdrom door lock error

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolibblkid: assume strtoull() is available
Sami Kerola [Wed, 7 Jan 2015 22:05:43 +0000 (22:05 +0000)] 
libblkid: assume strtoull() is available

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>
10 years agoipcs: remove FIXME markup
Sami Kerola [Wed, 7 Jan 2015 21:44:44 +0000 (21:44 +0000)] 
ipcs: remove FIXME markup

The ipc message q_qbytes information is not in /proc, and it is unlikely
it will ever appear to there.

Reference: https://lkml.org/lkml/2012/11/25/18
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoul: remove unexplained TERM=lpr override
Sami Kerola [Wed, 7 Jan 2015 21:30:54 +0000 (21:30 +0000)] 
ul: remove unexplained TERM=lpr override

The FIXME item has been in place since 2011-04-30, and the code has never
made sense, so remove it.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolook: remove dead code
Sami Kerola [Wed, 7 Jan 2015 21:24:39 +0000 (21:24 +0000)] 
look: remove dead code

MAP_FILE is ignored compatibility flag.

Reference: http://man7.org/linux/man-pages/man2/mmap.2.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agodocs: make tools/checkmans.sh to pass without warnings
Sami Kerola [Wed, 7 Jan 2015 19:57:54 +0000 (19:57 +0000)] 
docs: make tools/checkmans.sh to pass without warnings

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agobuild-sys: fix make checkincludes warnings
Sami Kerola [Wed, 7 Jan 2015 19:44:26 +0000 (19:44 +0000)] 
build-sys: fix make checkincludes warnings

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agodocs: add howto-pull-request.txt
Sami Kerola [Tue, 6 Jan 2015 22:37:52 +0000 (22:37 +0000)] 
docs: add howto-pull-request.txt

Reference: http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/10431
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agodocs: small improvements to howto-contribute.txt
Sami Kerola [Tue, 6 Jan 2015 20:25:16 +0000 (20:25 +0000)] 
docs: small improvements to howto-contribute.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolibsmartcols: use ASCII art for trees rather than padding
Karel Zak [Wed, 7 Jan 2015 14:20:22 +0000 (15:20 +0100)] 
libsmartcols: use ASCII art for trees rather than padding

Based on patch from  Roman Odaisky.

References: https://launchpad.net/bugs/1406133
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: support nsenter.static
Karel Zak [Wed, 7 Jan 2015 09:59:16 +0000 (10:59 +0100)] 
build-sys: support nsenter.static

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agofsck.minix: fix segmentation fault
Sami Kerola [Sat, 3 Jan 2015 09:20:05 +0000 (09:20 +0000)] 
fsck.minix: fix segmentation fault

Return from check_file() and check_file2() functions when maximum name
depth is reached.  The use unsafe strncpy() is also removed just to be on
safe side.

Addresses: https://bugs.debian.org/773892
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolslocks: fix type warning
Sami Kerola [Sat, 3 Jan 2015 09:20:04 +0000 (09:20 +0000)] 
lslocks: fix type warning

misc-utils/lslocks.c:229:2: warning: format '%x' expects argument of type
'unsigned int *', but argument 3 has type 'int *' [-Wformat=]

Reference: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/fs/locks.c?id=5e0f872c7d7e371fbdf09e864eddd24bddfda8fe#n2533
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agomaint: fix shadow declaration
Sami Kerola [Wed, 31 Dec 2014 23:01:21 +0000 (23:01 +0000)] 
maint: fix shadow declaration

This change fixes all shadow declarations.  The worth while to mention
fix is with libfdisk sun geometry.  It comes from bitops.h cpu_to_be16
macro that further expands from include/bits/byteswap.h that has the
shadowing.

libfdisk/src/sun.c:961:173: warning: declaration of '__v' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:69: warning: shadowed declaration is here [-Wshadow]
libfdisk/src/sun.c:961:178: warning: declaration of '__x' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:74: warning: shadowed declaration is here [-Wshadow]

That could have caused earlier some unexpected results.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agofallocate: create mode 0666, that's what umask is for
Karel Zak [Wed, 7 Jan 2015 08:57:55 +0000 (09:57 +0100)] 
fallocate: create mode 0666, that's what umask is for

User's umask will typically mask the mode down to 0664 or 0644.

Reported-by: Peter Cordes <peter@cordes.ca>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibmount: (monitor) make mnt_monitor_next_changed() usable for epoll version too
Karel Zak [Tue, 6 Jan 2015 15:18:52 +0000 (16:18 +0100)] 
libmount: (monitor) make mnt_monitor_next_changed() usable for epoll version too

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolinmount: (monitor) refresh docs, headers and symbols table
Karel Zak [Wed, 17 Dec 2014 12:09:29 +0000 (13:09 +0100)] 
linmount: (monitor) refresh docs, headers and symbols table

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibmount: (monitor) use inotify for utab lock file
Karel Zak [Wed, 17 Dec 2014 11:50:29 +0000 (12:50 +0100)] 
libmount: (monitor) use inotify for utab lock file

It's better than monitor utab directly. The utab is updated by
rename(2) and it's really tricky for inotify, because it's necessary
to monitor all /run/mount directory and then it's necessary to verify
that the renamed file is really "utab".

The new concept is without possible false positives and it also
triggers the change when utab update is really done.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibmount: (monitor) add kernel mountninfo monitoring
Karel Zak [Wed, 17 Dec 2014 09:39:37 +0000 (10:39 +0100)] 
libmount: (monitor) add kernel mountninfo monitoring

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibmount: (monitor) cleanup wait/verify stuff
Karel Zak [Tue, 16 Dec 2014 14:28:41 +0000 (15:28 +0100)] 
libmount: (monitor) cleanup wait/verify stuff

Signed-off-by: Karel Zak <kzak@redhat.com>