]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
9 years agomkswap: tolerate ENOTSUP when failing to relabel
Lubomir Rintel [Mon, 18 Apr 2016 07:01:23 +0000 (09:01 +0200)] 
mkswap: tolerate ENOTSUP when failing to relabel

It might be that the underlying filesystem just doesn't support SELinux
labeling. This fixes creating swap on vfat live media:

  # livecd-iso-to-disk.sh --msdos --swap-size-mb 666 ...

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
9 years agolibmount: make kernel_fs_postparse() more robust
Karel Zak [Fri, 15 Apr 2016 12:48:29 +0000 (14:48 +0200)] 
libmount: make kernel_fs_postparse() more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibmount: fix mnt_table_parse_stream() logic
Karel Zak [Fri, 15 Apr 2016 12:30:43 +0000 (14:30 +0200)] 
libmount: fix mnt_table_parse_stream() logic

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: make tests more portable due to mtab
Karel Zak [Fri, 15 Apr 2016 12:10:23 +0000 (14:10 +0200)] 
tests: make tests more portable due to mtab

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibmount: fix mnt_table_parse_mtab() logic
Karel Zak [Fri, 15 Apr 2016 10:05:55 +0000 (12:05 +0200)] 
libmount: fix mnt_table_parse_mtab() logic

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: remove USE_LIBMOUNT_FORCE_MOUNTINFO
Karel Zak [Fri, 15 Apr 2016 09:29:22 +0000 (11:29 +0200)] 
tests: remove USE_LIBMOUNT_FORCE_MOUNTINFO

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoumount: add note about FS names differences to the man page
Karel Zak [Fri, 15 Apr 2016 08:47:12 +0000 (10:47 +0200)] 
umount: add note about FS names differences to the man page

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1327209
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibmount: don't support /etc/mtab by default
Karel Zak [Thu, 14 Apr 2016 12:26:54 +0000 (14:26 +0200)] 
libmount: don't support /etc/mtab by default

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>
9 years agobuild-sys: add --enable-libuuid-force-uuidd
Ruediger Meier [Wed, 6 Apr 2016 13:43:07 +0000 (15:43 +0200)] 
build-sys: add --enable-libuuid-force-uuidd

To build libuuid with uuidd support even though the daemon is
disabled (--disable-uuidd).

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agowipefs: force GPT detection
Karel Zak [Wed, 13 Apr 2016 12:41:47 +0000 (14:41 +0200)] 
wipefs: force GPT detection

The library libblkid (as well as fdisks) requires protective MBR when
probe for GPT by default.  This is unnecessary for wipefs where we're
more promiscuous and we want to delete as much as possible. This patch
enables BLKID_PARTS_FORCE_GPT for wipefs.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1326474
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: remove obsolete comment
Karel Zak [Fri, 8 Apr 2016 08:58:34 +0000 (10:58 +0200)] 
build-sys: remove obsolete comment

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: don't depend on GNU md5sum
Ruediger Meier [Wed, 6 Apr 2016 10:30:18 +0000 (12:30 +0200)] 
tests: don't depend on GNU md5sum

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: test_md5 prints md5sum only
Ruediger Meier [Wed, 6 Apr 2016 10:30:17 +0000 (12:30 +0200)] 
tests: test_md5 prints md5sum only

We want to to use it for other tests without depending on
gnu md5sum and without cut or awk.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agochrt: validate priority before trying to use it
Sami Kerola [Sun, 3 Apr 2016 08:35:29 +0000 (09:35 +0100)] 
chrt: validate priority before trying to use it

Earlier message:

$ chrt -i 1 ls
chrt: failed to set pid 0's policy: Invalid argument

basically told 'something failed', while the new one tries to be more
helpful.

$ chrt -i 1 ls
chrt: unsupported priority value for the policy: 1: see --max for valid range

Addresses: https://bugs.debian.org/791707
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agocolcrt: avoid the command getting hung [afl]
Sami Kerola [Sat, 2 Apr 2016 15:58:14 +0000 (16:58 +0100)] 
colcrt: avoid the command getting hung [afl]

Some inputs make getwc(3) not to progress file descriptor and neither to
report EILSEQ.  Detect such situation and skip the bad input.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agolibmount: try absolute target before canonicalize
Karel Zak [Thu, 24 Mar 2016 10:51:12 +0000 (11:51 +0100)] 
libmount: try absolute target before canonicalize

The path canonicalization is expensive and in many cases unwanted due
to problems with readlink() on unreachable NFS and automounters.

This patch add a possibility to search also by $(CWD)/<path> if the
<path> is relative to reduce number of situation when we convert the
path to the canonical absolute path.

The common use-case:

# cd /some/long/path
# umount ./mountpoint

old version:

15543: libmount:      TAB: [0x560a99a54230]: lookup TARGET: './test'
15543: libmount:    CACHE: [0x560a99a54290]: canonicalize path ./test
15543: libmount:    CACHE: [0x560a99a54290]: add entry [ 1] (path): /mnt/test: ./test
15543: libmount:      TAB: [0x560a99a54230]: lookup canonical TARGET: '/mnt/test'
15543: libmount:      CXT: [0x560a99a54050]: umount fs: /mnt/test

new version:

15597: libmount:      TAB: [0xabf230]: lookup TARGET: './test'
15597: libmount:      TAB: [0xabf230]: lookup absolute TARGET: '/mnt/test'
15597: libmount:      CXT: [0xabf050]: umount fs: /mnt/test

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoscript: use empty-slave heuristic more carefully
Karel Zak [Wed, 13 Apr 2016 09:52:43 +0000 (11:52 +0200)] 
script: use empty-slave heuristic more carefully

script(1) waits for empty slave FD (shell stdin) before it writes to
master. This feature has been intorduiced by 54c6611d6f7b73609a5331f4d0bcf63c4af6429e
to avoid misbehavior when we need to send EOF to the shell.

Unfortunately, this feature has been used all time for all messages.
This is wrong because command in the session (or shell) may ignore
stdin at all and wait forever in busy loop is really bad idea. Test
case:

 script /dev/null
 tailf /etc/passwd
 <enter>
 <enter>

... script process taking 100% CPU.

This patch forces script to use empty-stave detection only when we
need to write EOF. The busy loop has been modified to use nanosleep
and it does not wait forever...

Addresses: http://bugs.debian.org/820843
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: release++ (v2.28) v2.28
Karel Zak [Tue, 12 Apr 2016 10:33:03 +0000 (12:33 +0200)] 
build-sys: release++ (v2.28)

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update v2.28-ReleaseNotes
Karel Zak [Tue, 12 Apr 2016 10:31:56 +0000 (12:31 +0200)] 
docs: update v2.28-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update AUTHORS file
Karel Zak [Tue, 12 Apr 2016 10:30:40 +0000 (12:30 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agopo: merge changes
Karel Zak [Tue, 12 Apr 2016 10:29:25 +0000 (12:29 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Tue, 12 Apr 2016 10:13:51 +0000 (12:13 +0200)] 
po: update uk.po (from translationproject.org)

9 years agopo: update sv.po (from translationproject.org)
Sebastian Rasmussen [Tue, 12 Apr 2016 10:13:51 +0000 (12:13 +0200)] 
po: update sv.po (from translationproject.org)

9 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Tue, 12 Apr 2016 10:13:51 +0000 (12:13 +0200)] 
po: update pt_BR.po (from translationproject.org)

9 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 12 Apr 2016 10:13:51 +0000 (12:13 +0200)] 
po: update pl.po (from translationproject.org)

9 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Tue, 12 Apr 2016 10:13:51 +0000 (12:13 +0200)] 
po: update nl.po (from translationproject.org)

9 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Tue, 12 Apr 2016 10:13:51 +0000 (12:13 +0200)] 
po: update ja.po (from translationproject.org)

9 years agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Tue, 12 Apr 2016 10:13:51 +0000 (12:13 +0200)] 
po: update es.po (from translationproject.org)

9 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Tue, 12 Apr 2016 10:13:50 +0000 (12:13 +0200)] 
po: update de.po (from translationproject.org)

9 years agopo: update cs.po (from translationproject.org)
Petr Písař [Tue, 12 Apr 2016 10:13:50 +0000 (12:13 +0200)] 
po: update cs.po (from translationproject.org)

9 years agobuild-sys: fix cap-ng configure flag handling
Mike Frysinger [Thu, 7 Apr 2016 16:17:43 +0000 (12:17 -0400)] 
build-sys: fix cap-ng configure flag handling

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
9 years agobuild-sys: add --disable-logger and --disable-lslogins
Ruediger Meier [Wed, 6 Apr 2016 10:51:07 +0000 (12:51 +0200)] 
build-sys: add --disable-logger and --disable-lslogins

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>
9 years agotests: remove deprecated md5sum based fdisk/bsd test
Ruediger Meier [Wed, 6 Apr 2016 07:16:11 +0000 (09:16 +0200)] 
tests: remove deprecated md5sum based fdisk/bsd test

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: fix fdisk/bsd for hppa
Ruediger Meier [Wed, 6 Apr 2016 07:16:10 +0000 (09:16 +0200)] 
tests: fix fdisk/bsd for hppa

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: add fdisk/bsd hexdump for alpha
Ruediger Meier [Wed, 6 Apr 2016 07:16:09 +0000 (09:16 +0200)] 
tests: add fdisk/bsd hexdump for alpha

Taken from Debian build logs:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.28~rc2-1&stamp=1459443555

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agorename: add example to the man page
Kaligule [Tue, 5 Apr 2016 12:35:24 +0000 (14:35 +0200)] 
rename: add example to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolib/strutils: use int for fgetc()
Karel Zak [Mon, 4 Apr 2016 09:01:15 +0000 (11:01 +0200)] 
lib/strutils: use int for fgetc()

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agogetopt: make sure setprogname provided by non-Linux system
Karel Zak [Mon, 4 Apr 2016 08:39:20 +0000 (10:39 +0200)] 
getopt: make sure setprogname provided by non-Linux system

based on suggestion from Ruediger Meier.

Reported-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobash-completion: update chrt completion
Sami Kerola [Sun, 3 Apr 2016 08:35:28 +0000 (09:35 +0100)] 
bash-completion: update chrt completion

Add couple missing options, and make the completion overall work better.

That said completion is still incomplete, pardon the pun.  After user has
specified policy then giving a hint what priority needs to be specified is
theoretically possible, but such hint is not given.  There does not seem to
be easy way to know when user wants stops specifying options and move to
defining priority in: chrt [options] [prio] [command|pid].

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agochrt: make --sched-* short options to require an argument
Sami Kerola [Sun, 3 Apr 2016 08:35:27 +0000 (09:35 +0100)] 
chrt: make --sched-* short options to require an argument

These options are expecting an argument, and the long options struct already
required them.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agolibmount: Fix possible NULL dereference in get_btrfs_fs_root()
Karel Zak [Thu, 31 Mar 2016 09:45:55 +0000 (11:45 +0200)] 
libmount: Fix possible NULL dereference in get_btrfs_fs_root()

The function mnt_table_get_fs_root() should be robust enough to accept
NULL as mountinfo -- the right behaviour is to default to '/'.

The set_fs_root() (tab_update.c) has to understand when mountinfo is
necessary (for bind mounts and btrfs).

Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add DM error target for blkid
Karel Zak [Wed, 30 Mar 2016 13:18:20 +0000 (15:18 +0200)] 
tests: add DM error target for blkid

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibblkid: revert mmap usage
Karel Zak [Wed, 30 Mar 2016 12:53:33 +0000 (14:53 +0200)] 
libblkid: revert mmap usage

The implementation has not been ready for I/O errors and it seems that
there is no elegant way how to resolve this issue. Linux returns
SIGBUS on mmap errors and play with signals (or longjumps) in shared
library is really bad idea.

It also seems that mmaped devices have some unexpected side-effects
with page-cache where for example dd returns old data for already
modified device etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: fix ref.counting in fdisk_apply_script() [clang analyze]
Karel Zak [Wed, 30 Mar 2016 09:17:48 +0000 (11:17 +0200)] 
libfdisk: fix ref.counting in fdisk_apply_script() [clang analyze]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibmount: result of operation is garbage or undefined [clang analyze]
Karel Zak [Tue, 29 Mar 2016 13:44:48 +0000 (15:44 +0200)] 
libmount: result of operation is garbage or undefined [clang analyze]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agofdisk: remove dead assignment [clang analyze]
Karel Zak [Tue, 29 Mar 2016 12:13:22 +0000 (14:13 +0200)] 
fdisk: remove dead assignment [clang analyze]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoipcs: make static analyzer happy [clang analyze]
Karel Zak [Tue, 29 Mar 2016 12:02:57 +0000 (14:02 +0200)] 
ipcs: make static analyzer happy [clang analyze]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoagetty: remove atoi() from argv[] parsing [clang analyze]
Karel Zak [Tue, 29 Mar 2016 11:53:28 +0000 (13:53 +0200)] 
agetty: remove atoi() from argv[] parsing [clang analyze]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agovipw: make tmp_file usage more robust [clang analyze]
Karel Zak [Tue, 29 Mar 2016 11:23:32 +0000 (13:23 +0200)] 
vipw: make tmp_file usage more robust [clang analyze]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: happy new year...
Karel Zak [Tue, 29 Mar 2016 10:51:24 +0000 (12:51 +0200)] 
build-sys: happy new year...

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: release++ (v2.28-rc2) v2.28-rc2
Karel Zak [Tue, 29 Mar 2016 08:47:40 +0000 (10:47 +0200)] 
build-sys: release++ (v2.28-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update v2.28-ReleaseNotes
Karel Zak [Tue, 29 Mar 2016 08:44:50 +0000 (10:44 +0200)] 
docs: update v2.28-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update AUTHORS file
Karel Zak [Tue, 29 Mar 2016 08:42:14 +0000 (10:42 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agopo: merge changes
Karel Zak [Tue, 29 Mar 2016 08:38:01 +0000 (10:38 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Tue, 29 Mar 2016 08:34:55 +0000 (10:34 +0200)] 
po: update ja.po (from translationproject.org)

9 years agoMerge branch 'tests-setarch' of https://github.com/rudimeier/util-linux
Karel Zak [Thu, 24 Mar 2016 08:54:54 +0000 (09:54 +0100)] 
Merge branch 'tests-setarch' of https://github.com/rudimeier/util-linux

* 'tests-setarch' of https://github.com/rudimeier/util-linux:
  tests: improve setarch tests, regarding --uname-2.6 issues
  setarch: add "exec" message to --verbose
  build-sys: ignore vim .swp files

9 years agotests: improve setarch tests, regarding --uname-2.6 issues
Ruediger Meier [Tue, 22 Mar 2016 09:06:22 +0000 (10:06 +0100)] 
tests: improve setarch tests, regarding --uname-2.6 issues

Add some more tests:
  * error handling "unknown arch" and "unknown command"
  * "noop" test with host arch and no other options
  * all options except --uname-2.6
  * --uname-2.6 whithout any other options but handle fatal
    glibc error "kernel too old" (with debug output)
  * add a "real" --uname-2.6 test which validates uname(1)
    output

Note the "kernel too old" cases are systems where glibc was
configured to support only kernels > 3.0. On some archs
(e.g. x86) --uname-2.6 still works with such glibc because
2.6.39 had all needed features on board (e.g. vdso).
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=806911

Some people reported segfaults (after execvp) but I can only
reproduce it on arm* and aarch64 qemu-user-space builds. We
don't need to fix our tests for such broken systems where
also many other tests fail currently.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agolsipc: don't free shm data if no shm id is found
Romain Naour [Tue, 22 Mar 2016 21:19:54 +0000 (22:19 +0100)] 
lsipc: don't free shm data if no shm id is found

There is a segfault in do_shm_global() when ipc_shm_get_info() return 0 and
ipc_shm_free_info() is called.

When no shm id is found, the memory allocated in shmds by ipc_shm_get_info() is
already free when ipc_shm_free_info() is called.

Move ipc_shm_free_info(shmds) inside the if statement where at least one shm id
is found.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
9 years agolibblkid: Update for newer bcache superblocks
Kent Overstreet [Tue, 15 Mar 2016 02:44:36 +0000 (18:44 -0800)] 
libblkid: Update for newer bcache superblocks

Later version of bcache add different checksum types, and allow for superblocks
greater than 4k - skipping the checksum check (as in most other probes) is the
easiest solution.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
9 years agopartx: fix --nr usage
Karel Zak [Tue, 22 Mar 2016 14:49:00 +0000 (15:49 +0100)] 
partx: fix --nr usage

Reported-by: Serge van den Boom <serge+util-linux@vdboom.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agosetarch: add "exec" message to --verbose
Ruediger Meier [Tue, 22 Mar 2016 11:14:45 +0000 (12:14 +0100)] 
setarch: add "exec" message to --verbose

Also we don't need fflush() in non-verbose case.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agobuild-sys: ignore vim .swp files
Ruediger Meier [Tue, 22 Mar 2016 13:11:25 +0000 (14:11 +0100)] 
build-sys: ignore vim .swp files

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agosulogin: Always make echo work after performing getpasswd even if root account is...
Werner Fink [Tue, 22 Mar 2016 09:38:59 +0000 (10:38 +0100)] 
sulogin: Always make echo work after performing getpasswd even if root account is locked

If the root account is locked and no password was provided then the terminal
line is not set back to do echo of the input. This correct a small overlook
in commit 7ff1162e67164cb4ece19dd809c26272461aa254

Signed-off-by: Werner Fink <werner@suse.de>
9 years agolscpu: revert unnecessary path_exist()
Karel Zak [Tue, 22 Mar 2016 09:31:16 +0000 (10:31 +0100)] 
lscpu: revert unnecessary path_exist()

The features file is there from 2.6.31 when Xen has been added to
kernel. Sorry.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update TODO file
Karel Zak [Tue, 22 Mar 2016 09:26:35 +0000 (10:26 +0100)] 
docs: update TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolscpu: correct the Virtualization type on Xen DomU PV guest
Dongli Zhang [Tue, 22 Mar 2016 05:38:14 +0000 (13:38 +0800)] 
lscpu: correct the Virtualization type on Xen DomU PV guest

Nowadays, most Intel CPUs have "cpuid faulting" available which could trap
the execution of "cpuid" instruction when CPL>0  with GP fault. Thus,
"cpuid" instruction could trap to Xen hypervisor on the paravirtualized PV
guest on most servers today, except on old CPUs prior to 2011. On CPU after
2011, Xen will put "XenVMMXenVMM" on both HVM and PV guests, which could
have lscpu command erroneously classify the guest as type "full".  The
current lscpu command, which is based on "cpuid" instruction, still assumes
that it will not cause the trap to Xen hypervisor on Xen PV guest and uses
/proc/xen to identify whether it's running on PV DomU or not.  To identify
this kind of information under the help of
/sys/hypervisor/properties/features would be more accurate for the CPU
nowadays. The bit 5 (XENFEAT_mmu_pt_update_preserve_ad) of the features
will be set only when it's running on Xen PV domain. The combo of bit 3 and
8 (XENFEAT_supervisor_mode_kernel and XENFEAT_hvm_callback_vector) will be
set simultaneously only when it's running on Xen PVH domain.

[kzak@redhat.com: - add path_exist()]

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: add note about CLONE_NEWCGROUP support
Karel Zak [Mon, 21 Mar 2016 20:13:25 +0000 (21:13 +0100)] 
docs: add note about CLONE_NEWCGROUP support

The patch has been planned for weeks and now the kernel part is
already in Linus' tree. It's a new feature, but it's probably better
to merge the userspace stuff now (v2.28 rc1) than wait next 6 months
for the next util-linux release.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoMerge branch '2016-03-02/cgns' of https://github.com/hallyn/util-linux
Karel Zak [Mon, 21 Mar 2016 20:08:05 +0000 (21:08 +0100)] 
Merge branch '2016-03-02/cgns' of https://github.com/hallyn/util-linux

* '2016-03-02/cgns' of https://github.com/hallyn/util-linux:
  Implement support for cgroup namespaces

9 years agoipcs: consolidate output header printing
Ruediger Meier [Mon, 21 Mar 2016 13:04:45 +0000 (14:04 +0100)] 
ipcs: consolidate output header printing

Print a warning (instead of header) if --limits fails, like we did
it in past (2.20.1) and like we are still doing for --summary. Note
in past we were printing the same message like for --summary
"kernel not configured for ...", but actually this message is not
really correct.

This patch simply consolidates the current behavior. Probably we
should refactor it regarding warnings (stderr) and exit codes.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: skip ipcs test which require /proc
Ruediger Meier [Mon, 21 Mar 2016 13:04:44 +0000 (14:04 +0100)] 
tests: skip ipcs test which require /proc

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agosulogin: ignore missing WEXITED, add warning
Ruediger Meier [Mon, 21 Mar 2016 13:04:43 +0000 (14:04 +0100)] 
sulogin: ignore missing WEXITED, add warning

This happens on Debian kFreeBSD and probably on Hurd too since
cde7699c. One should review this issue to fix it properly.

CC: Werner Fink <werner@suse.de>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agobuild-sys: pylibmount, mount context is Linux only
Ruediger Meier [Mon, 21 Mar 2016 13:04:42 +0000 (14:04 +0100)] 
build-sys: pylibmount, mount context is Linux only

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agobuild-sys: some libmount test progs are Linux only
Ruediger Meier [Mon, 21 Mar 2016 13:04:41 +0000 (14:04 +0100)] 
build-sys: some libmount test progs are Linux only

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agoipcs: --shmems, upward/backward compatibility
Ruediger Meier [Fri, 18 Mar 2016 11:49:18 +0000 (12:49 +0100)] 
ipcs: --shmems, upward/backward compatibility

Re-add backward compatibility which got lost in 058e8154.
Initializing unknown struct members to 0xdead is similar to
the fallback.

For upward compatibility ignore columns > 16 but not the whole
line (in case the kernel would add more columns in future).

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agoipcs: make sure to parse whole lines for shm_data
Ruediger Meier [Fri, 18 Mar 2016 11:49:17 +0000 (12:49 +0100)] 
ipcs: make sure to parse whole lines for shm_data

We want to parse 16 columns _per_row_ without mixing them up. The
existing code is unsafe for more or less columns and could even
run into endless loops. This patch assures that we parse row-wise
and really skip lines with columns != 16.

Probably somehow we could have also done this with fscanf() only.
Using fgets() additionally makes the code more easy to read and
to improve later.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agoswapon: rewrite control struct usage
Karel Zak [Fri, 18 Mar 2016 13:28:29 +0000 (14:28 +0100)] 
swapon: rewrite control struct usage

The old version has been pretty broken... the most important is to
keep swap options specified on command line as read-only template.
For example if we call "swapon --all" then we cannot modify the global
options for each fstab swap entry.

The another story has been control struct modification due to device
reinitialization etc.

This patch splits all to:

* struct swapon_control; top-level struct with command line options

* struct swap_device; this is device specific and never globally
  maintained by swapon_control.

* struct swap_prop; used as global read-only template swap options
  and per device swap options (when parse fstab).

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818252
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: check for TS_HELPER_SYSINFO in swap tests
Karel Zak [Fri, 18 Mar 2016 13:24:44 +0000 (14:24 +0100)] 
tests: check for TS_HELPER_SYSINFO in swap tests

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: add to TODO file
Karel Zak [Fri, 18 Mar 2016 11:05:51 +0000 (12:05 +0100)] 
docs: add to TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotools: add missing checkcompletion.sh
Karel Zak [Thu, 17 Mar 2016 13:34:29 +0000 (14:34 +0100)] 
tools: add missing checkcompletion.sh

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: ignore setarch on sparc
Karel Zak [Thu, 17 Mar 2016 13:32:07 +0000 (14:32 +0100)] 
tests: ignore setarch on sparc

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotools: add checkcompletion.sh
Karel Zak [Thu, 17 Mar 2016 13:05:27 +0000 (14:05 +0100)] 
tools: add checkcompletion.sh

The command "make checkcompletion" prints missing completion scripts.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoumount: add man page note that --force is not perfect
Karel Zak [Thu, 17 Mar 2016 11:19:31 +0000 (12:19 +0100)] 
umount: add man page note that --force is not perfect

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: no need to un-ignore tracked files
Ruediger Meier [Thu, 17 Mar 2016 10:04:05 +0000 (11:04 +0100)] 
build-sys: no need to un-ignore tracked files

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agobuild-sys: install missing bash completions
Ruediger Meier [Thu, 17 Mar 2016 10:04:06 +0000 (11:04 +0100)] 
build-sys: install missing bash completions

We haven't installed these files since three years. Hopefully
they will work.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agodocs: miscellaneous tiny tweaks of man pages
Benno Schulenberg [Thu, 17 Mar 2016 09:54:31 +0000 (10:54 +0100)] 
docs: miscellaneous tiny tweaks of man pages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agofdisk: fix the grammar of an option description
Benno Schulenberg [Thu, 17 Mar 2016 09:39:14 +0000 (10:39 +0100)] 
fdisk: fix the grammar of an option description

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agounshare: describe the setgroups restriction more explicitly
Benno Schulenberg [Thu, 17 Mar 2016 09:39:13 +0000 (10:39 +0100)] 
unshare: describe the setgroups restriction more explicitly

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agoscript: tweak spacing and wording, and restore filling in the man page
Benno Schulenberg [Thu, 17 Mar 2016 09:39:12 +0000 (10:39 +0100)] 
script: tweak spacing and wording, and restore filling in the man page

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agolscpu: improve spacing and spelling in the man page
Benno Schulenberg [Thu, 17 Mar 2016 09:39:11 +0000 (10:39 +0100)] 
lscpu: improve spacing and spelling in the man page

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agochrt: remove duplicate words and tweak some phrasings in the man page
Benno Schulenberg [Thu, 17 Mar 2016 09:39:10 +0000 (10:39 +0100)] 
chrt: remove duplicate words and tweak some phrasings in the man page

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agolscpu: fix memleak because of ambiguous tags
Ruediger Meier [Wed, 16 Mar 2016 12:18:19 +0000 (13:18 +0100)] 
lscpu: fix memleak because of ambiguous tags

Now the first one of certain ambiguous tags wins. Alternatively to
this patch we could have called free() before xstrdup().

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agolscpu: use cpu and revision tag if available
Ruediger Meier [Wed, 16 Mar 2016 12:18:18 +0000 (13:18 +0100)] 
lscpu: use cpu and revision tag if available

Avoid ifdef which does not work with --sysroot. Our existing test
dumps produce even better output now for ppc and sparc.

The logic moved to the printing section.

CC: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agoRevert "lscpu: keep lscpu usable on snapshots"
Ruediger Meier [Wed, 16 Mar 2016 12:18:17 +0000 (13:18 +0100)] 
Revert "lscpu: keep lscpu usable on snapshots"

This reverts commit 641350fe822e7f1ac10873dad9a364bdeaba8083.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
9 years agotests: add new fdisk bsd test
Karel Zak [Wed, 16 Mar 2016 12:42:08 +0000 (13:42 +0100)] 
tests: add new fdisk bsd test

New BDS test based on hexdump, this commit provides:

bsd_0_64.BE - generated on ppc64
bsd_0_64.LE - generated on ppc64le
bsd_1_0.LE - generated on x86_64
bsd_1_0.BE - generated on s390

the last missing is Alpha where all is different :-)

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: mark old bsd fdisk test as deprecated
Karel Zak [Wed, 16 Mar 2016 12:01:10 +0000 (13:01 +0100)] 
tests: mark old bsd fdisk test as deprecated

It seems better to use hexdump rather than md5sum, but it means that
we have to gather hexdumps of the all possible BSD variants. For this
purpose will be introduced a new bsd fdisk test and to verify the
new hexdumps we can use this old test as both tests are exactly the
same.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodmesg: improve grammar and consistency of usage text
Benno Schulenberg [Wed, 16 Mar 2016 08:55:55 +0000 (09:55 +0100)] 
dmesg: improve grammar and consistency of usage text

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agouuidd: correct the wording of an error message
Benno Schulenberg [Wed, 16 Mar 2016 08:55:54 +0000 (09:55 +0100)] 
uuidd: correct the wording of an error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agomount, umount, swapon, fsck, lsblk, findmnt: harmonize six error messages
Benno Schulenberg [Wed, 16 Mar 2016 08:55:53 +0000 (09:55 +0100)] 
mount, umount, swapon, fsck, lsblk, findmnt: harmonize six error messages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agologger: correct the grammar of an error message
Benno Schulenberg [Wed, 16 Mar 2016 08:55:52 +0000 (09:55 +0100)] 
logger: correct the grammar of an error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agolibfdisk: (gpt) reword two error messages with a sense of direction
Benno Schulenberg [Wed, 16 Mar 2016 08:55:51 +0000 (09:55 +0100)] 
libfdisk: (gpt) reword two error messages with a sense of direction

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>