]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
10 years agoMerge branch 'test-fix' of https://github.com/rudimeier/util-linux
Karel Zak [Wed, 22 Apr 2015 07:56:47 +0000 (09:56 +0200)] 
Merge branch 'test-fix' of https://github.com/rudimeier/util-linux

10 years agotests: config.h lives in build directory
Ruediger Meier [Wed, 22 Apr 2015 06:05:47 +0000 (08:05 +0200)] 
tests: config.h lives in build directory

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agohwclock: remove dead code
J William Piggott [Tue, 21 Apr 2015 20:46:23 +0000 (16:46 -0400)] 
hwclock: remove dead code

Removes never used #ifdef dead code.

Reported-by: Karel Zak <kzak@redhat.com>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agohwclock: regression fix
J William Piggott [Tue, 21 Apr 2015 20:43:41 +0000 (16:43 -0400)] 
hwclock: regression fix

Commit ab8f402952301106ad0bd5c5a51dc8646d1bff64 regression
where synchronize_to_clock_tick_rtc() only returns the correct
value for a select() time out if using debug mode. This caused
hwclock to have invalid output when select() timed out in
normal mode.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agosfdisk: don't use BLKRRPART to check loopdev usage
Karel Zak [Fri, 17 Apr 2015 08:32:48 +0000 (10:32 +0200)] 
sfdisk: don't use BLKRRPART to check loopdev usage

It seesm that kernel always returns EINVAL for BLKRRPART on loop
devices, we call the ioctl to check if nobody else uses the device.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: add old dump for sfdisk
Karel Zak [Thu, 16 Apr 2015 16:01:32 +0000 (18:01 +0200)] 
tests: add old dump for sfdisk

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: accept empty partitions from dump
Karel Zak [Thu, 16 Apr 2015 15:40:28 +0000 (17:40 +0200)] 
sfdisk: accept empty partitions from dump

Old sfdisk uses:
  dev/sdc2 : start=        0, size=        0, Id= 0

for undefined MBR partitions. Let's follow this behaviour.

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: fix logger device pathname too long
Ruediger Meier [Tue, 14 Apr 2015 12:54:52 +0000 (14:54 +0200)] 
tests: fix logger device pathname too long

$TS_OUTDIR may be too long for sockaddr_un.sun_path. Noticed on travis
in distcheck.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agoMerge branch 'tests-logger' of https://github.com/rudimeier/util-linux
Karel Zak [Tue, 14 Apr 2015 09:52:06 +0000 (11:52 +0200)] 
Merge branch 'tests-logger' of https://github.com/rudimeier/util-linux

* 'tests-logger' of https://github.com/rudimeier/util-linux:
  travis: install socat >= 1.7.2
  tests: add subtests for invalid logger devive
  tests: logger/errors does not use --no-act
  tests: logger, validate written socket data
  tests: logger with socat device
  tests: simplify common logger options
  logger: --stderr and --no-act turn "auto-errors" on

10 years agounshare: allow persisting mount namespaces
Karel Zak [Thu, 9 Apr 2015 09:48:07 +0000 (11:48 +0200)] 
unshare: allow persisting mount namespaces

We can create a reference (bind mount) to the new namespace after
unshare(2), but it does not make sense to do it within unshared
namespace. (And if I read kernel fs/namespace.c: do_loopback()
correctly than copy mount bind mounts of /proc/<pid>/ns/mnt between
namespaces is unsupported.)

This patch bypass this problem by fork() where parent continue as
usually (call unshare(2), setup another things, etc.), but child
waits for /proc/[ppid]/ns/mnt inode number change (the ino is
changed after parent's unshare(2)) and then it bind mounts the new
namespaces and exit.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agounshare: allow persisting namespaces
Karel Zak [Thu, 9 Apr 2015 09:34:02 +0000 (11:34 +0200)] 
unshare: allow persisting namespaces

For nsenter(1) we already support namespace specification by file
(e.g. bind mount to namespace /proc/[pid]/ns/[type] file). For
example:

  # nsenter --uts=/some/path

This patch extends unshare(1) to setup the bind mount for specified
namespace, for example

  # touch /some/path
  # unshare --uts=/some/path hostname FOO
  # nsenter --uts=/some/path hostname
  FOO

Note that the problem is mount namespace, because create bind mount
to ns/mount file within unshared namespace does not make sense.

Based on patch from Lubomir Rintel <lkundrak@v3.sk>.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolib/sysfs.c: use fcntl(..F_DUPFD_CLOEXEC) instead of dup(2)
Cristian Rodríguez [Fri, 10 Apr 2015 18:57:58 +0000 (15:57 -0300)] 
lib/sysfs.c: use fcntl(..F_DUPFD_CLOEXEC) instead of dup(2)

"The two descriptors do not share file descriptor flags (the
close-on-exec flag).  The close-on-exec flag  for the duplicate descriptor is off"

10 years agotests: make libmount python context tests sensitive to USE_LIBMOUNT_FORCE_MOUNTINFO
Karel Zak [Tue, 14 Apr 2015 09:26:54 +0000 (11:26 +0200)] 
tests: make libmount python context tests sensitive to USE_LIBMOUNT_FORCE_MOUNTINFO

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: make libmount context tests sensitive to USE_LIBMOUNT_FORCE_MOUNTINFO
Karel Zak [Tue, 14 Apr 2015 09:26:54 +0000 (11:26 +0200)] 
tests: make libmount context tests sensitive to USE_LIBMOUNT_FORCE_MOUNTINFO

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agofdisk: fix typo
Karel Zak [Mon, 13 Apr 2015 16:11:38 +0000 (18:11 +0200)] 
fdisk: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agofdisk: add --protect-boot
Karel Zak [Mon, 13 Apr 2015 15:24:45 +0000 (17:24 +0200)] 
fdisk: add --protect-boot

Now fdisk erases the begin of the device when create a new disk label, it seems
like disadvantage for some use-cases.

Reported-by: Jean-Loup 'clippix' Bogalho <clippix@lse.epita.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotravis: install socat >= 1.7.2
Ruediger Meier [Mon, 13 Apr 2015 11:29:26 +0000 (13:29 +0200)] 
travis: install socat >= 1.7.2

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: add subtests for invalid logger devive
Ruediger Meier [Fri, 10 Apr 2015 06:28:26 +0000 (08:28 +0200)] 
tests: add subtests for invalid logger devive

Note --journald should not complain about invalid sockets.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: logger/errors does not use --no-act
Ruediger Meier [Thu, 9 Apr 2015 18:14:51 +0000 (20:14 +0200)] 
tests: logger/errors does not use --no-act

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agosfdisk: enable bootbits protection
Karel Zak [Mon, 13 Apr 2015 11:41:10 +0000 (13:41 +0200)] 
sfdisk: enable bootbits protection

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1210428
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: support bootbits protection from (p)MBR
Karel Zak [Mon, 13 Apr 2015 11:40:25 +0000 (13:40 +0200)] 
libfdisk: support bootbits protection from (p)MBR

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: logger, validate written socket data
Ruediger Meier [Thu, 9 Apr 2015 18:14:50 +0000 (20:14 +0200)] 
tests: logger, validate written socket data

Actually there should be no data written to the socket because
we are always using --no-act.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: logger with socat device
Ruediger Meier [Thu, 9 Apr 2015 15:12:34 +0000 (17:12 +0200)] 
tests: logger with socat device

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agosfdisk: improve -N warnings
Karel Zak [Mon, 13 Apr 2015 10:08:50 +0000 (12:08 +0200)] 
sfdisk: improve -N warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: add sfdisk resize tests
Karel Zak [Mon, 13 Apr 2015 08:56:03 +0000 (10:56 +0200)] 
tests: add sfdisk resize tests

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: require wipefs for sfdisk/gpt
Karel Zak [Mon, 13 Apr 2015 08:35:51 +0000 (10:35 +0200)] 
tests: require wipefs for sfdisk/gpt

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (dos) retain existing boot flag when resizing a partition
Karel Zak [Mon, 13 Apr 2015 08:29:00 +0000 (10:29 +0200)] 
libfdisk: (dos)  retain existing boot flag when resizing a partition

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1210912
Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author:  awilliam@redhat.com

10 years agotests: simplify common logger options
Ruediger Meier [Thu, 9 Apr 2015 15:00:26 +0000 (17:00 +0200)] 
tests: simplify common logger options

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agologger: --stderr and --no-act turn "auto-errors" on
Ruediger Meier [Thu, 26 Mar 2015 13:20:29 +0000 (14:20 +0100)] 
logger: --stderr and --no-act turn "auto-errors" on

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agolibfdisk: recognize FAT32 partitions hidden by Acronis software
Jörg Jenderek [Wed, 8 Apr 2015 08:24:26 +0000 (10:24 +0200)] 
libfdisk: recognize FAT32 partitions hidden by Acronis software

References: http://www.acronis.de/products/trueimage
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Jörg Jenderek <joerg.jen.der.ek@gmx.net>
10 years agoMerge branch 'fix-last' of https://github.com/rudimeier/util-linux
Karel Zak [Tue, 7 Apr 2015 13:22:22 +0000 (15:22 +0200)] 
Merge branch 'fix-last' of https://github.com/rudimeier/util-linux

* 'fix-last' of https://github.com/rudimeier/util-linux:
  last, fix race when comparing time stamps
  last: fix first (current) runlevel line

10 years agocal: add -Y and -n <num>
Max Klinger [Tue, 7 Apr 2015 11:05:39 +0000 (13:05 +0200)] 
cal: add -Y and -n <num>

[kzak@redhat.com: - add month_in_row to avoid extra meaning of num_month=-3,
                  - add header_year
                  - add long option for -Y
                  - define conflicts between -Y, -y and -n
                  - remove ctl.yflag]

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoMerge branch 'test-fixes' of https://github.com/rudimeier/util-linux
Karel Zak [Tue, 7 Apr 2015 10:42:56 +0000 (12:42 +0200)] 
Merge branch 'test-fixes' of https://github.com/rudimeier/util-linux

* 'test-fixes' of https://github.com/rudimeier/util-linux:
  tests: mount/rlimit tries to restore mtab
  tests: fix, don't call ts_die from subshell
  tests: ts_scsi_debug_init() sleeps a bit earlier
  tests: fix cramfs/mkfs for BE and different pagesizes

10 years agoMerge branch 'fix-tinfo-typo' of https://github.com/rudimeier/util-linux
Karel Zak [Tue, 7 Apr 2015 10:31:55 +0000 (12:31 +0200)] 
Merge branch 'fix-tinfo-typo' of https://github.com/rudimeier/util-linux

* 'fix-tinfo-typo' of https://github.com/rudimeier/util-linux:
  build-sys: typo -ltinfo

10 years agowhereis: trivial spelling and grammar fix
Mike Place [Tue, 7 Apr 2015 08:44:50 +0000 (10:44 +0200)] 
whereis: trivial spelling and grammar fix

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agologger: fix memory leaks
Sami Kerola [Tue, 7 Apr 2015 07:58:19 +0000 (08:58 +0100)] 
logger: fix memory leaks

Reported-by: Patrick Plagwitz <patrick.plagwitz@fau.de>
Signed-off-by: Sami Kerola <sami.kerola@lastminute.com>
10 years agologger: generate header when reading message from stdin
Patrick Plagwitz [Mon, 6 Apr 2015 21:50:46 +0000 (22:50 +0100)] 
logger: generate header when reading message from stdin

This change fixes crashing error, that ought not to be simply avoided.

$ echo foo | logger -n localhost
Segmentation fault (core dumped)

If the ctl->hdr is just checked not to be NULL syslog message will not
have valid header, so generating such is not optional when reading
message from stdin and writing it to remote destination.

Reviewed-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Patrick Plagwitz <patrick.plagwitz@fau.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agowall: do not use a temporary file.
Karel Zak [Fri, 3 Apr 2015 09:44:24 +0000 (11:44 +0200)] 
wall: do not use a temporary file.

The issue with using a temporary file in wall is that wall runs as setgid.
This means that an unprivileged user who runs wall can modify wall's
temporary files, even if those are mode 0600, so the unprivileged user can
edit and effectively suppress the banner. The fix is to simply not use
temporary files.

[kzak@redhat.com: - rewrite growing string functions
                  - use struct buffer
                  - add buf_print() function]

Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Jann Horn <jann@thejh.net>

10 years agolibmount: add note about flock() to docs
Karel Zak [Thu, 2 Apr 2015 10:30:26 +0000 (12:30 +0200)] 
libmount: add note about flock() to docs

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: mount/rlimit tries to restore mtab
Ruediger Meier [Thu, 2 Apr 2015 09:35:29 +0000 (11:35 +0200)] 
tests: mount/rlimit tries to restore mtab

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: fix, don't call ts_die from subshell
Ruediger Meier [Tue, 31 Mar 2015 14:07:37 +0000 (16:07 +0200)] 
tests: fix, don't call ts_die from subshell

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: ts_scsi_debug_init() sleeps a bit earlier
Ruediger Meier [Sat, 28 Mar 2015 14:32:30 +0000 (15:32 +0100)] 
tests: ts_scsi_debug_init() sleeps a bit earlier

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: fix cramfs/mkfs for BE and different pagesizes
Ruediger Meier [Sat, 28 Mar 2015 11:34:43 +0000 (12:34 +0100)] 
tests: fix cramfs/mkfs for BE and different pagesizes

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agolsblk: don't ignore dependences for partitioned devies
Karel Zak [Wed, 1 Apr 2015 10:23:23 +0000 (12:23 +0200)] 
lsblk: don't ignore dependences for partitioned devies

The code only lists partitions, but ignore another dependencies
on whole-disk device:

$ lsblk /dev/sdb
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb      8:16   0 298.1G  0 disk
└─sdb1   8:17   0 298.1G  0 part

$ ls /sys/block/sdb/holders/
dm-0

fixed version:

$ lsblk /dev/sdb
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sdb           8:16   0 298.1G  0 disk
├─sdb1        8:17   0 298.1G  0 part
└─mpatha    253:0    0 298.1G  0 mpath
  └─mpatha1 253:1    0 298.1G  0 part

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolsblk: follow kernel for inverse tree
Karel Zak [Wed, 1 Apr 2015 10:06:41 +0000 (12:06 +0200)] 
lsblk: follow kernel for inverse tree

For multi-path devices kernel defines dependence between the device
and whole-list:

$ ls /sys/block/dm-0/slaves/
sdb

but lsblk inserts partition into the tree:

$ lsblk -s -oNAME,KNAME /dev/dm-1
mpatha1   dm-1
└─mpatha  dm-0
  └─sdb1  sdb1     <--- !
    └─sdb sdb

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolsblk: add debug support
Karel Zak [Wed, 1 Apr 2015 10:06:15 +0000 (12:06 +0200)] 
lsblk: add debug support

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agocfdisk: cleanup extra partitions info for slang
Karel Zak [Tue, 31 Mar 2015 11:10:17 +0000 (13:10 +0200)] 
cfdisk: cleanup extra partitions info for slang

The patch removes problem with getch() on slang, now the code is based
on subwin() and extra info window is persistent.

A new problem is that slang does not keep sub-window border
persistent. I'm going to ignore this slang problem... use ncurses
dude!

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: define cfdisk dependence on open_memstream
Karel Zak [Mon, 30 Mar 2015 11:54:08 +0000 (13:54 +0200)] 
build-sys: define cfdisk dependence on open_memstream

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agomount: fix lazytime docs
Karel Zak [Mon, 30 Mar 2015 10:52:22 +0000 (12:52 +0200)] 
mount: fix lazytime docs

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibmount: add support for MS_LAZYTIME
Karel Zak [Mon, 30 Mar 2015 10:43:45 +0000 (12:43 +0200)] 
libmount: add support for MS_LAZYTIME

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosetarch: fix regression for sparc builds
Waldemar Brodkorb [Sun, 29 Mar 2015 13:00:30 +0000 (15:00 +0200)] 
setarch: fix regression for sparc builds

With following commit:
5edb0ea6bbd57dd916417737f98c9109dc1ecb5b

Sparc cross-compile fails.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
10 years agobuild-sys: typo -ltinfo
Ruediger Meier [Sat, 28 Mar 2015 10:23:53 +0000 (11:23 +0100)] 
build-sys: typo -ltinfo

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agosfdisk: cleanup prompt usage
Karel Zak [Fri, 27 Mar 2015 14:04:58 +0000 (15:04 +0100)] 
sfdisk: cleanup prompt usage

Let's use fgets-like callback only when compiled with readline,
otherwise (and also for non-tty) print prompt by printf().

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agocfdisk: provide extra partinfo with "x"
Ondrej Oprala [Fri, 20 Feb 2015 08:41:19 +0000 (09:41 +0100)] 
cfdisk: provide extra partinfo with "x"

The new 'extra' info provides:

 * filesystem information from libblkid (TYPE, UUID, LABEL)

   This feature is based on libblkid ability to probe specified area
   on the device. It allows to probe for filesystems although the
   partition devices (e.g. /dev/sda2) does not exist. For example from
   disk image:

    # cfdisk /home/archive/fs-images/disk.img

 * additional information from libfdisk (partition UUID, Name, ...)

 * mount information from libmount (from fstab or mountinfo)

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Karel Zak <kzak@redhat.com>

10 years agolibfdisk: don't return empty strings from fdisk_partition_to_string()
Karel Zak [Fri, 27 Mar 2015 12:47:13 +0000 (13:47 +0100)] 
libfdisk: don't return empty strings from fdisk_partition_to_string()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: add HAVE_LIBMOUNT
Karel Zak [Fri, 27 Mar 2015 12:46:15 +0000 (13:46 +0100)] 
build-sys: add HAVE_LIBMOUNT

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: add TINFO_LIBS_STATIC
Karel Zak [Fri, 27 Mar 2015 09:32:24 +0000 (10:32 +0100)] 
build-sys: add TINFO_LIBS_STATIC

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>
10 years agobuild-sys: fix READLINE_LIBS_STATIC usage for fdisk
Karel Zak [Thu, 26 Mar 2015 18:05:11 +0000 (19:05 +0100)] 
build-sys: fix READLINE_LIBS_STATIC usage for fdisk

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: fix -a vs. -A bug
Karel Zak [Thu, 26 Mar 2015 17:21:53 +0000 (18:21 +0100)] 
sfdisk: fix -a vs. -A bug

The -A has been originally used for --activate, since v2.26 it's used
for --append. This is stupid mistake. This patch reverts the change to:

 -A, --activate
 -a, --append

Note that --append is a new command line option in v2.26.

Addresses: https://bugs.archlinux.org/task/44349
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodocs: document --exclude for tests
Karel Zak [Thu, 26 Mar 2015 12:00:24 +0000 (13:00 +0100)] 
docs: document --exclude for tests

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: add documentation about environment variables
Ruediger Meier [Wed, 25 Mar 2015 11:09:36 +0000 (12:09 +0100)] 
tests: add documentation about environment variables

Introduced in 8e3ac29e, now advertised :)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: verify logger return value
Ruediger Meier [Tue, 24 Mar 2015 18:37:01 +0000 (19:37 +0100)] 
tests: verify logger return value

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: avoid &>> for bash compatibility
Ruediger Meier [Tue, 24 Mar 2015 08:47:49 +0000 (09:47 +0100)] 
tests: avoid &>> for bash compatibility

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: fix getopt for old glibc
Ruediger Meier [Tue, 24 Mar 2015 08:37:30 +0000 (09:37 +0100)] 
tests: fix getopt for old glibc

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agobuild-sys: python is optional, don't fail when missing
Karel Zak [Thu, 26 Mar 2015 11:09:50 +0000 (12:09 +0100)] 
build-sys: python is optional, don't fail when missing

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: ncurses is optional, don't fail when missing
Karel Zak [Thu, 26 Mar 2015 10:50:15 +0000 (11:50 +0100)] 
build-sys: ncurses is optional, don't fail when missing

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: add --exclude=<list> for run.sh
Karel Zak [Wed, 25 Mar 2015 18:32:22 +0000 (19:32 +0100)] 
tests: add --exclude=<list> for run.sh

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: support static build with readline
Karel Zak [Wed, 25 Mar 2015 16:55:22 +0000 (17:55 +0100)] 
build-sys: support static build with readline

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: more(1) depends on terminal, force to TERM=linux
Karel Zak [Wed, 25 Mar 2015 16:36:28 +0000 (17:36 +0100)] 
tests: more(1) depends on terminal, force to TERM=linux

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodocs: remove obsolete things from TODO
Karel Zak [Wed, 25 Mar 2015 15:09:32 +0000 (16:09 +0100)] 
docs: remove obsolete things from TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add readline support
Karel Zak [Wed, 25 Mar 2015 15:06:39 +0000 (16:06 +0100)] 
sfdisk: add readline support

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agofdisk: fix readline wrapper
Karel Zak [Wed, 25 Mar 2015 15:06:26 +0000 (16:06 +0100)] 
fdisk: fix readline wrapper

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: add fgets() callback for scripts
Karel Zak [Wed, 25 Mar 2015 15:05:14 +0000 (16:05 +0100)] 
libfdisk: add fgets() callback for scripts

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: fix symbols versioning script
Karel Zak [Wed, 25 Mar 2015 10:08:22 +0000 (11:08 +0100)] 
libfdisk: fix symbols versioning script

Really stupid copy & past mistake. The libfdisk symbols should not be
prefixed by MOUNT_ suffix.

This change makes binaries linked with libfdisk 2.26 incompatible with
new libfdisk. Fortunately, 2.26 has been the first release and very
probably the library has been used for util-linux fdisks only.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolast, fix race when comparing time stamps
Ruediger Meier [Tue, 24 Mar 2015 11:22:13 +0000 (12:22 +0100)] 
last, fix race when comparing time stamps

It is just luck if two time() calls happen within the same
second. Introduced in 31d28e09.

Actually I don't like adding another global variable but this
way we avoid bigger refactoring. IMO it's questionable why
lastdate, lastdown, etc. are initialized with current time() at
all. It looks unsafe to print "still running" always when
logout_time = now.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agolast: fix first (current) runlevel line
Ruediger Meier [Tue, 24 Mar 2015 13:38:09 +0000 (14:38 +0100)] 
last: fix first (current) runlevel line

Since 744c7fec lastrch was not set to current time anymore, but we need it.

 # broken:
 $ ./last -x | grep -m 2 runlevel
 runlevel (to lvl 5)   3.11.10-25-deskt Wed Feb 18 13:11 - 01:00 (-16484+-12:-11)
 runlevel (to lvl 5)   3.11.10-25-deskt Thu Jan 22 16:50 - 13:11 (26+20:21)

 # fixed:
 $ ./last -x | grep -m 2 runlevel
 runlevel (to lvl 5)   3.11.10-25-deskt Wed Feb 18 13:11   still running
 runlevel (to lvl 5)   3.11.10-25-deskt Thu Jan 22 16:50 - 13:11 (26+20:21)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agofdisk: add GNU Readline support to fdisk
Karel Zak [Wed, 25 Mar 2015 09:31:37 +0000 (10:31 +0100)] 
fdisk: add GNU Readline support to fdisk

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agobuild-sys: add --with-readline
Ondrej Oprala [Mon, 2 Feb 2015 17:11:40 +0000 (18:11 +0100)] 
build-sys: add --with-readline

[kzak@redhat.com: - define READLINE_LIBS]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agofsck: fix fsck -C {fd} parsing
Stanislav Brabec [Tue, 24 Mar 2015 20:01:10 +0000 (21:01 +0100)] 
fsck: fix fsck -C {fd} parsing

Both fsck(8) and fsck --help documents progress bar redirection as
-C {fd}

This did not work, and only -C{fd} and "-C {fd}" worked.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (gpt) check header size before verify CRC
Karel Zak [Mon, 23 Mar 2015 11:03:30 +0000 (12:03 +0100)] 
libfdisk: (gpt) check header size before verify CRC

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=780834
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodmesg: use GMT in tests, add DMESG_TEST_BOOTIME
Karel Zak [Mon, 23 Mar 2015 10:40:59 +0000 (11:40 +0100)] 
dmesg: use GMT in tests, add DMESG_TEST_BOOTIME

We don't want to hardcode anything to the test, just use
env.variable DMESG_TEST_BOOTIME.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agologger: fix LOGGER_TEST_TIMEOFDAY check
Karel Zak [Mon, 23 Mar 2015 10:40:45 +0000 (11:40 +0100)] 
logger: fix LOGGER_TEST_TIMEOFDAY check

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: check dmesg message coloring
Sami Kerola [Sun, 22 Mar 2015 23:05:30 +0000 (23:05 +0000)] 
tests: check dmesg message coloring

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotests: check timestamp formats
Sami Kerola [Sun, 22 Mar 2015 23:05:29 +0000 (23:05 +0000)] 
tests: check timestamp formats

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotests: add test_dmesg that has fixed boot time
Sami Kerola [Sun, 22 Mar 2015 23:05:28 +0000 (23:05 +0000)] 
tests: add test_dmesg that has fixed boot time

This allows testing time stamp formats.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotests: add dmesg multiline message check
Sami Kerola [Sun, 22 Mar 2015 23:05:27 +0000 (23:05 +0000)] 
tests: add dmesg multiline message check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agodmesg: fix shadow declaration
Sami Kerola [Sun, 22 Mar 2015 23:05:26 +0000 (23:05 +0000)] 
dmesg: fix shadow declaration

sys-utils/dmesg.c:650:9: warning: declaration of 's' shadows a previous local [-Wshadow]
sys-utils/dmesg.c:619:12: warning: shadowed declaration is here [-Wshadow]

And since the code had to be touched deprecate loop printing one character
at a time, in favour of printf and instruction to repeat spaces the number
required.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agounshare: add --propagation, use MS_PRIVATE by default
Karel Zak [Wed, 18 Mar 2015 14:13:15 +0000 (15:13 +0100)] 
unshare: add --propagation, use MS_PRIVATE by default

After "unshare --mount" users assume that mount operations within the
new namespaces are unshared (invisible for the rest of the system).

Unfortunately, this is not true and the behavior depends on the
current mount propagation setting. The kernel default is "private",
but for example systemd based distros use "shared". The solution is to
use (for example) "mount --make-private" after unshare(1).

I have been requested many times to provide less fragile and more
unified unshared mount setting *by default* to make things user
friendly.

The patch forces unshare(1) to explicitly use MS_REC|MS_PRIVATE for all
tree by default.

We can use something less (e.g MS_SLAVE), but "private" is the kernel
default, so for many users this change (feature) will be invisible.

This feature is possible to disable by "--propagation unchanged" or it's
possible to specify another propagation flag, supported are:

<slave|shared|private|unchanged>

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agonsenter: add -Z to set selinux context
Karel Zak [Fri, 20 Mar 2015 14:26:58 +0000 (15:26 +0100)] 
nsenter: add -Z to set selinux context

The new context is copied from --target <PID>. This solution allows to
keep SELinux happy when you enter container by nsenter(1).

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1116100
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agomount: don't remount read-only on --bind
Karel Zak [Fri, 20 Mar 2015 11:42:33 +0000 (12:42 +0100)] 
mount: don't remount read-only on --bind

mount(8) tries to mount read-only when the previous attempt ends with
EROFS or EACCES. This is bad idea for bind mounts as "ro,bind" has
a special semantic.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: remove private2 dir from mount/move
Karel Zak [Fri, 20 Mar 2015 10:05:42 +0000 (11:05 +0100)] 
tests: remove private2 dir from mount/move

The directory is unnecessary, all we need is to create from "private"
directory a mount point (so "--bind $DIR_PRIVATE $DIR_PRIVATE").

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: some more mount error handling
Ruediger Meier [Thu, 19 Mar 2015 16:12:15 +0000 (17:12 +0100)] 
tests: some more mount error handling

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: more error handling in mount/move (refactor)
Ruediger Meier [Thu, 19 Mar 2015 16:12:00 +0000 (17:12 +0100)] 
tests: more error handling in mount/move (refactor)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agotests: mount/move also tests findmnt vs. mountpoint
Ruediger Meier [Thu, 19 Mar 2015 16:11:43 +0000 (17:11 +0100)] 
tests: mount/move also tests findmnt vs. mountpoint

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
10 years agofindmnt: add --mountpoint command line option
Karel Zak [Thu, 19 Mar 2015 11:08:30 +0000 (12:08 +0100)] 
findmnt: add --mountpoint command line option

The current --target <path> implementation check the <path> elements in
reverse order to get the mountpoint. The feature may be inwanted in
some cases when we really want to check for mountpoint specified by
the <path>. The new option "--mountpoint <path>" allows to be strict.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: start script/race test only when --force specified
Karel Zak [Thu, 19 Mar 2015 11:06:35 +0000 (12:06 +0100)] 
tests: start script/race test only when --force specified

The test generates 1000 processes and it seems too invasive for
test/build machines and containers.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agohwclock: non-root access in test mode
J William Piggott [Sun, 15 Mar 2015 20:44:05 +0000 (16:44 -0400)] 
hwclock: non-root access in test mode

Allow a non-root user to call all hwclock
functions when the --test option is used.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agohwclock: increase debug output precision
J William Piggott [Sun, 15 Mar 2015 18:17:13 +0000 (14:17 -0400)] 
hwclock: increase debug output precision

Increased the precision in debug output showing
the clock drift and the time lapsed.

Showing a clock drift of 0.0 while giving a value that the
drift factor was adjusted by makes no sense.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
10 years agotravis: add MAKE_CHECK_OPTS
Karel Zak [Tue, 17 Mar 2015 11:03:28 +0000 (12:03 +0100)] 
travis: add MAKE_CHECK_OPTS

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: add --skip-loopdevs
Karel Zak [Tue, 17 Mar 2015 10:34:22 +0000 (11:34 +0100)] 
tests: add --skip-loopdevs

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