]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agoswitch_root: check open() return value [coverity scan]
Karel Zak [Fri, 7 Sep 2012 11:02:42 +0000 (13:02 +0200)] 
switch_root: check open() return value [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/sysfs: more robust sysfs_opendir() [coverity scan]
Karel Zak [Fri, 7 Sep 2012 10:15:39 +0000 (12:15 +0200)] 
lib/sysfs: more robust sysfs_opendir() [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomark expected fallthrough for static analysers
Karel Zak [Fri, 7 Sep 2012 10:05:56 +0000 (12:05 +0200)] 
mark expected fallthrough for static analysers

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotunelp: add missing break [coverity scan]
Karel Zak [Fri, 7 Sep 2012 10:00:53 +0000 (12:00 +0200)] 
tunelp: add missing break [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agogetopt: make the code more readable for analysers
Karel Zak [Fri, 7 Sep 2012 09:42:34 +0000 (11:42 +0200)] 
getopt: make the code more readable for analysers

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agonamei: remove dead code [coverity scan]
Karel Zak [Fri, 7 Sep 2012 09:39:38 +0000 (11:39 +0200)] 
namei: remove dead code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: check fchmod() return value [coverity scan]
Karel Zak [Fri, 7 Sep 2012 09:00:54 +0000 (11:00 +0200)] 
libblkid: check fchmod() return value [coverity scan]

12 years agolibblkid: improve DBG() macro
Karel Zak [Fri, 7 Sep 2012 08:58:49 +0000 (10:58 +0200)] 
libblkid: improve DBG() macro

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: add note about /etc/pam.d/su-l to ReleaseNotes
Karel Zak [Wed, 5 Sep 2012 12:06:28 +0000 (14:06 +0200)] 
docs: add note about /etc/pam.d/su-l to ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: fix man pahe typo in quota mount option names
Björn Jacke [Wed, 5 Sep 2012 11:39:48 +0000 (13:39 +0200)] 
mount: fix man pahe typo in quota mount option names

12 years agosu: move long options to main()
Karel Zak [Wed, 5 Sep 2012 09:26:20 +0000 (11:26 +0200)] 
su: move long options to main()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosu: verify writing to streams was successful
Karel Zak [Wed, 5 Sep 2012 09:21:07 +0000 (11:21 +0200)] 
su: verify writing to streams was successful

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosu: more robust getpwuid() for GNU Hurt [coreutils 71b7ddc]
Karel Zak [Wed, 5 Sep 2012 09:13:34 +0000 (11:13 +0200)] 
su: more robust getpwuid() for GNU Hurt [coreutils 71b7ddc]

Let's support GNU Hurd over-engineering where a process can exist
without UID and getuid() returns -1 and sets errno.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: install su.1 if building su
Dave Reisner [Wed, 5 Sep 2012 02:31:03 +0000 (22:31 -0400)] 
build-sys: install su.1 if building su

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agowdctl: treat aligned translatable strings in a uniform manner
Benno Schulenberg [Fri, 31 Aug 2012 10:51:50 +0000 (12:51 +0200)] 
wdctl: treat aligned translatable strings in a uniform manner

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agowdctl: gettextize one forgotten word
Benno Schulenberg [Thu, 30 Aug 2012 19:08:47 +0000 (21:08 +0200)] 
wdctl: gettextize one forgotten word

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: add missing comma and colon in some help texts
Benno Schulenberg [Wed, 29 Aug 2012 19:32:22 +0000 (21:32 +0200)] 
textual: add missing comma and colon in some help texts

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: fix typos in messages
Yuri Chornoivan [Sat, 18 Aug 2012 18:47:08 +0000 (21:47 +0300)] 
textual: fix typos in messages

12 years agolibmount: document LIBMOUNT_DEBUG users
Davidlohr Bueso [Tue, 4 Sep 2012 13:58:06 +0000 (15:58 +0200)] 
libmount: document LIBMOUNT_DEBUG users

Update the manpages of programs that use this environment variable for
extra debugging information.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agoblkid: document LIBBLKID_DEBUG users
Davidlohr Bueso [Tue, 4 Sep 2012 13:58:02 +0000 (15:58 +0200)] 
blkid: document LIBBLKID_DEBUG users

Update the manpages of programs that use this environment variable for
extra debugging information.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agolsblk: add add_random columns
Milan Broz [Fri, 17 Aug 2012 18:25:26 +0000 (20:25 +0200)] 
lsblk: add add_random columns

Allow printing of queue/add_random attribute which describes
if device adds randomness to kernel RNG pool.

Signed-off-by: Milan Broz <mbroz@redhat.com>
12 years agorunuser: add note about PAM to man page
Karel Zak [Tue, 4 Sep 2012 14:53:22 +0000 (16:53 +0200)] 
runuser: add note about PAM to man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: add list of expected PAM config files
Karel Zak [Wed, 29 Aug 2012 16:02:24 +0000 (18:02 +0200)] 
docs: add list of expected PAM config files

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agorunuser: new command (derived from su(1))
Karel Zak [Wed, 29 Aug 2012 15:34:26 +0000 (17:34 +0200)] 
runuser: new command (derived from su(1))

 This command is based on su(1), the differences:

 - based on Fedora runuser su(1) patch
 - not installed with suid rights
 - allowed for root users only
 - don't ask for password
 - uses PAM session, for example:

$ cat /etc/pam.d/runuser
auth sufficient pam_rootok.so
session optional pam_keyinit.so revoke
session required pam_limits.so
session required pam_unix.so

$ cat /etc/pam.d/runuser-l
auth include runuser
session optional pam_keyinit.so force revoke
session include runuser

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosu: move generic su code to su-common.c
Karel Zak [Tue, 28 Aug 2012 16:10:58 +0000 (18:10 +0200)] 
su: move generic su code to su-common.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosu: add --group and --supp-group options
Karel Zak [Tue, 28 Aug 2012 14:32:28 +0000 (16:32 +0200)] 
su: add --group and --supp-group options

These options allow to specify alternative groups. The command
su(1) has to be executed by root. The implementation is based on
Fedora runuser(1) command.

For example:

 # su --group=kzak --supp-group=uuidd -
 # id
 uid=0(root) gid=1000(kzak) groups=0(root),985(uuidd),1000(kzak)

non-root user:

 $ su --group=kzak -
 su: only root can specify alternative groups

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: add configure summary
Karel Zak [Wed, 29 Aug 2012 19:16:21 +0000 (21:16 +0200)] 
build-sys: add configure summary

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agocol: fix compiler warning [-Wstrict-prototypes]
Karel Zak [Wed, 29 Aug 2012 18:32:19 +0000 (20:32 +0200)] 
col: fix compiler warning [-Wstrict-prototypes]

text-utils/col.c:142:43: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck.cramfs: fix compiler warning [-Wpointer-arith]
Karel Zak [Wed, 29 Aug 2012 18:30:11 +0000 (20:30 +0200)] 
fsck.cramfs: fix compiler warning [-Wpointer-arith]

disk-utils/fsck.cramfs.c: In function ‘test_crc’:
disk-utils/fsck.cramfs.c:231:32: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
disk-utils/fsck.cramfs.c:233:24: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: add another compiler warnings
Karel Zak [Wed, 29 Aug 2012 18:26:21 +0000 (20:26 +0200)] 
build-sys: add another compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: use O_CLOEXEC everywhere
Karel Zak [Wed, 29 Aug 2012 18:08:18 +0000 (20:08 +0200)] 
libmount: use O_CLOEXEC everywhere

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: use O_CLOEXEC
Karel Zak [Wed, 29 Aug 2012 17:49:19 +0000 (19:49 +0200)] 
libblkid: use O_CLOEXEC

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: release++ (v2.22) v2.22
Karel Zak [Tue, 4 Sep 2012 12:57:28 +0000 (14:57 +0200)] 
build-sys: release++ (v2.22)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: update v2.22-ReleaseNotes
Karel Zak [Tue, 4 Sep 2012 12:36:16 +0000 (14:36 +0200)] 
docs: update v2.22-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agopo: merge changes
Karel Zak [Tue, 4 Sep 2012 12:23:25 +0000 (14:23 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Tue, 4 Sep 2012 11:51:16 +0000 (13:51 +0200)] 
po: update vi.po (from translationproject.org)

12 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Tue, 4 Sep 2012 11:51:15 +0000 (13:51 +0200)] 
po: update uk.po (from translationproject.org)

12 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 4 Sep 2012 11:51:15 +0000 (13:51 +0200)] 
po: update pl.po (from translationproject.org)

12 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Tue, 4 Sep 2012 11:51:15 +0000 (13:51 +0200)] 
po: update nl.po (from translationproject.org)

12 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Tue, 4 Sep 2012 11:51:15 +0000 (13:51 +0200)] 
po: update ja.po (from translationproject.org)

12 years agopo: update fr.po (from translationproject.org)
David Prévot [Tue, 4 Sep 2012 11:51:15 +0000 (13:51 +0200)] 
po: update fr.po (from translationproject.org)

12 years agopo: update da.po (from translationproject.org)
Joe Hansen [Tue, 4 Sep 2012 11:51:15 +0000 (13:51 +0200)] 
po: update da.po (from translationproject.org)

12 years agopo: update cs.po (from translationproject.org)
Petr Písař [Tue, 4 Sep 2012 11:51:15 +0000 (13:51 +0200)] 
po: update cs.po (from translationproject.org)

12 years agofdisk: document FDISK_DEBUG
Davidlohr Bueso [Wed, 22 Aug 2012 08:57:09 +0000 (10:57 +0200)] 
fdisk: document FDISK_DEBUG

Add the corresponding entry in the manpage.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: fix typo in comment
Bernhard Voelker [Wed, 22 Aug 2012 06:59:43 +0000 (08:59 +0200)] 
fdisk: fix typo in comment

* fdisks/utils.c: s/firts/first/: found by misspellings.
s/Zero's/Zeros/: denoted by Pádraig Brady <P@draigBrady.com>.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agofindmnt: use st.st_bavail for available column
Dave Reisner [Mon, 20 Aug 2012 10:06:17 +0000 (06:06 -0400)] 
findmnt: use st.st_bavail for available column

This matches more closely with what 'df -h' reports as space available.
Any remaining discrepancy between these 2 tools is a result of precision
and choices in rounding.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosu: cleanup man page
Karel Zak [Wed, 29 Aug 2012 16:05:31 +0000 (18:05 +0200)] 
su: cleanup man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: remount does not add entry to mtab file
Karel Zak [Mon, 27 Aug 2012 17:26:07 +0000 (19:26 +0200)] 
libmount: remount does not add entry to mtab file

 # mount -n -o ro /dev/sda1 /
 # mount -o remount,rw /dev/sda1 /

For the backward compatibility the command mount(8) should to add a
new entry to the file /etc/mtab on remount if the original entry not
found (because previous mount has been called with -n).

Reported-by: <frinnst> on IRC
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: rewrite ntfs prober
Karel Zak [Mon, 27 Aug 2012 15:38:24 +0000 (17:38 +0200)] 
libblkid: rewrite ntfs prober

 - use regular NTFS bios parameters block
 - don't care about mirror cluster location
 - remove unnecessary macros
 - add more checks (based on Linux kernel code)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: use unsigned ints in ntfs prober
Karel Zak [Mon, 27 Aug 2012 13:13:41 +0000 (15:13 +0200)] 
libblkid: use unsigned ints in ntfs prober

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: use less aggressive method to detect mounted devices
Karel Zak [Fri, 24 Aug 2012 16:41:50 +0000 (18:41 +0200)] 
fsck: use less aggressive method to detect mounted devices

We should not care about mountpoints in fsck if a device name
specified on command line, just check if the device is used somewhere
in /proc/self/mountinfo file.

Crazy people who use

fsck /mountpoint

have to specify the mountpoint by the same format as in their fstab --
symlinks canonicalization is not supported.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=850965
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: rewrite mnt_table_is_fs_mounted() to be less aggressive
Karel Zak [Fri, 24 Aug 2012 16:13:06 +0000 (18:13 +0200)] 
libmount: rewrite mnt_table_is_fs_mounted() to be less aggressive

The old implementation always canonicalizes target (mountpoint) path.
It's better to postpone this operation until the path is really
necessary (usually it's unnecessary), because readlink() on mountpoint
may trigger automounts.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: release++ (v2.22-rc2) v2.22-rc2
Karel Zak [Wed, 15 Aug 2012 16:05:00 +0000 (18:05 +0200)] 
build-sys: release++ (v2.22-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: update v2.22-ReleaseNotes
Karel Zak [Wed, 15 Aug 2012 16:02:53 +0000 (18:02 +0200)] 
docs: update v2.22-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: update AUTHORS file
Karel Zak [Wed, 15 Aug 2012 15:59:56 +0000 (17:59 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agopo: merge changes
Karel Zak [Wed, 15 Aug 2012 15:56:47 +0000 (17:56 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agopo: update fr.po (from translationproject.org)
David Prévot [Wed, 15 Aug 2012 15:09:47 +0000 (17:09 +0200)] 
po: update fr.po (from translationproject.org)

12 years agobuild-sys: add -Wmissing-declarations, sort warning options
Karel Zak [Wed, 15 Aug 2012 15:04:41 +0000 (17:04 +0200)] 
build-sys: add -Wmissing-declarations, sort warning options

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: update build-sys tests
Karel Zak [Wed, 15 Aug 2012 14:44:18 +0000 (16:44 +0200)] 
tests: update build-sys tests

 - remove tests programs (no more compiled by default)
 - add resizepart

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agouuidd: improve systemd unit files
Karel Zak [Wed, 15 Aug 2012 14:06:19 +0000 (16:06 +0200)] 
uuidd: improve systemd unit files

 - use $usrsbin_execdir
 - add [Install] section
 - use long options

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: expand paths at make time
Karel Zak [Tue, 14 Aug 2012 23:53:40 +0000 (01:53 +0200)] 
build-sys: expand paths at make time

autoconf docs about *dir variables (e.g bindir):

 ... A corollary is that you should not use these variables except in
 makefiles...

 ...you should not rely on AC_CONFIG_FILES to replace bindir and friends
 in your shell scripts and other files; instead, let make manage their
 replacement.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agocolumn: --separator segfaults
B Watson [Tue, 14 Aug 2012 16:27:09 +0000 (18:27 +0200)] 
column: --separator segfaults

The --separator and --columns long options in util-linux-2.21.2 and in
a git clone from 5 minutes ago, don't work:

$ echo foobar | column -s x
foobar

$ echo foobar | column -c 10
foobar

$ echo foobar | column --separator=x
column: option '--separator' doesn't allow an argument

$ echo foobar | column --separator x
Segmentation fault

$ echo foobar | column --columns 10
column: bad columns width value: '(null)': Invalid argument

$ echo foobar | column --columns=10
column: option '--columns' doesn't allow an argument

Looks like a simple case of missing has_arg flag in the "struct
option" initialization for these two options. The patch just adds the
flag. I haven't done thorough testing of the patched code, but it
seems to work OK and it no longer segfaults or tries to dereference a
null pointer.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/sysfs: make sysfs_partno_to_devno better readable
Bernhard Voelker [Tue, 14 Aug 2012 07:01:45 +0000 (09:01 +0200)] 
lib/sysfs: make sysfs_partno_to_devno better readable

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agolsblk: add WWN, improve udev support
Karel Zak [Tue, 14 Aug 2012 16:14:35 +0000 (18:14 +0200)] 
lsblk: add WWN, improve udev support

 * read WWN from udev DB

 * use *_ENC properties from udev DB to get original unmodified
   strings (otherwise for example blank space is replaced with '_' in
   ID_FS_LABEL)

 * always read from udev, libblkid is fallback solution only

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoresizepart: remove debug message
Karel Zak [Tue, 14 Aug 2012 06:33:39 +0000 (08:33 +0200)] 
resizepart: remove debug message

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoresizepart: add new command
Karel Zak [Mon, 13 Aug 2012 20:10:14 +0000 (22:10 +0200)] 
resizepart: add new command

This is a simple wrapper for BLKPG_RESIZE_PARTITION (since kernel 3.6).

Co-Author: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/sysfs; add sysfs_partno_to_devno()
Karel Zak [Mon, 13 Aug 2012 20:06:18 +0000 (22:06 +0200)] 
lib/sysfs; add sysfs_partno_to_devno()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/mangle: remove unused variable
Karel Zak [Mon, 13 Aug 2012 19:57:34 +0000 (21:57 +0200)] 
lib/mangle: remove unused variable

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/sysfs: expect p<N> suffix for partitions
Karel Zak [Mon, 13 Aug 2012 19:11:37 +0000 (21:11 +0200)] 
lib/sysfs: expect p<N> suffix for partitions

 ... so for example lsblk(8) will see partitioned loop devices

loop0       7:0    0    80G  0 loop
├─loop0p1 259:0    0   100M  0 loop
└─loop0p2 259:1    0  79.9G  0 loop

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: fix unmangle code
Karel Zak [Mon, 13 Aug 2012 14:25:01 +0000 (16:25 +0200)] 
libmount: fix unmangle code

old version:
  /mnt/ugly/te\134st\134 -> /mnt/ugly/te\st\134

fixed version:
  /mnt/ugly/te\134st\134 -> /mnt/ugly/te\st\

Reported-by: Naja Melan <najamelan@autistici.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodmesg: fix kmsg read if read returns EPIPE
Milan Broz [Mon, 13 Aug 2012 11:55:30 +0000 (13:55 +0200)] 
dmesg: fix kmsg read if read returns EPIPE

The /dev/kmsg can return EPIPE if current record has beed modified
while reading.

For init_kmsg, it cause switch to DMESG_METHOD_SYSLOG
(which is not expected) and later it can truncate output.

Signed-off-by: Milan Broz <mbroz@redhat.com>
12 years agoeject: return proper 0/1 from eject_cdrom()
Dave Reisner [Mon, 6 Aug 2012 15:16:12 +0000 (11:16 -0400)] 
eject: return proper 0/1 from eject_cdrom()

main() expects this method to return 0 for failure and 1 for success, as
the other eject_*() methods do. Add the missing comparison of ioctl() >= 0

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoFix non-Linux build
Samuel Thibault [Wed, 8 Aug 2012 15:19:43 +0000 (17:19 +0200)] 
Fix non-Linux build

loopdev.c, test_pager, and get_max_number_of_cpus() are linux-specific.
get_linux_version will only work on Linux, let's introduce
system_supports_ext4_ext2() which assumes that mounting ext2 with ext4
is not supported on non-Linux systems.

[kzak@redhat.com: - use #ifdef SYS_sched_getaffinity rather than __linux__]

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: aix: fix warning
Davidlohr Bueso [Wed, 8 Aug 2012 11:48:28 +0000 (13:48 +0200)] 
fdisk: aix: fix warning

Fixes:
 warning: no previous prototype for ‘aix_nolabel’

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agolscpu: limit options --all, --online, --offline to parsable and extended output
Heiko Carstens [Wed, 8 Aug 2012 08:52:47 +0000 (10:52 +0200)] 
lscpu: limit options --all, --online, --offline to parsable and extended output

Passing the --all, --online or --offline options for the output summary
doesn't make much sense. It should be limited to the two list output options.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
12 years agolib/tt: always escape '\' to simplify parsing in scripts
Karel Zak [Mon, 13 Aug 2012 12:23:04 +0000 (14:23 +0200)] 
lib/tt: always escape '\' to simplify parsing in scripts

The commands echo(1) and printf(1) are usable for escape sequences
decoding, for example

 for x in $(findmnt --noheading --raw --output TARGET); do
  printf "%b" $x
 done

but it's necessary to escape all '\' chars, otherwise for example \b
in foo\bar will be interpreted as backspace. It means that for example
findmnt(8) has to use \x5c for the backslash.

  # findmnt --noheading --raw --output TARGET /dev/sda1
  /mnt/ugly/foo\x5cbar

Reported-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/tt: fix \x%02x usage
Karel Zak [Wed, 8 Aug 2012 06:58:28 +0000 (08:58 +0200)] 
lib/tt: fix \x%02x usage

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoinclude/tt: improve work with non-utf8 chars
Karel Zak [Tue, 7 Aug 2012 09:19:54 +0000 (11:19 +0200)] 
include/tt: improve work with non-utf8 chars

Reported-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add files make check generates in gitignore
Sami Kerola [Sat, 4 Aug 2012 07:33:39 +0000 (09:33 +0200)] 
build-sys: add files make check generates in gitignore

The config/test-driver appears at automake stage, rest after running
'make check'.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agovipw: make vim writebackup mode work
Sami Kerola [Sat, 4 Aug 2012 07:33:40 +0000 (09:33 +0200)] 
vipw: make vim writebackup mode work

Some editors, such as Vim with 'writebackup' mode enabled, use "atomic
save" in which the old file is deleted and a new one with the same name
created in its place.  The vipw tries to detect if such happen by
looking hard temporary file link count, when it is zero reopen
temporary file by using it's path.

Reported-by: Mantas Mikulėnas <grawity@gmail.com>
References: http://www.spinics.net/lists/util-linux-ng/msg06666.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: add sys-utils/umount.8 manual page
Sami Kerola [Sat, 4 Aug 2012 07:33:38 +0000 (09:33 +0200)] 
docs: add sys-utils/umount.8 manual page

The man page is almost exact copy of mount-deprecated/umount.8.  This
version mentions long options, and has the options in same order as
they are mentioned in usage() output.  Rest of the minor changes make
groff slightly nicer e.g. use .PP instead of empty line for paragraph
marker.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: update TODO
Sami Kerola [Sat, 4 Aug 2012 07:33:37 +0000 (09:33 +0200)] 
docs: update TODO

Remove tasks that are done.

dmesg: --follow option
Reference: 0fd12a9697c2e01e3c2e1e558ff027cd2947ee94

build-sys: recursive build
Reference: 8772f8d7eeeb922bccee3376552c59d7148df7b4

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: ftp server does no longer support util-linux-ng
Sami Kerola [Sat, 4 Aug 2012 07:33:36 +0000 (09:33 +0200)] 
docs: ftp server does no longer support util-linux-ng

A symlink was probably removed from
  ftp://ftp.kernel.org/pub/linux/utils/

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolib/tt: count read cells, improve \x?? hex encoding
Karel Zak [Mon, 6 Aug 2012 10:50:09 +0000 (12:50 +0200)] 
lib/tt: count read cells, improve \x?? hex encoding

 * use wcwidth() to count real number of columns required for
   multibyte strings

 * encode control characters with \x?? in raw and export (NAME=data) outputs

 * use \x?? for controls and non-printable characters in the default outputs

 * use \x?? to encode already existing hex sequences, for example

/mnt/ugly\x20space  --->  /mnt/ugly\x5cx20space

   this is not used in the default output, but in raw/export outputs
   only (which is designed for scripts).

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomount: replace control chars in mountpoint name
Karel Zak [Mon, 6 Aug 2012 10:45:08 +0000 (12:45 +0200)] 
mount: replace control chars in mountpoint name

For compatibility with coreutils and to avoid complex solutions in
mount output mount replaces control characters with '?'.

Note that the listing mode in mount(8) is in maintenance mode --
findmnt(8) provides more robust and better solutions.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodocs: update tests docs
Karel Zak [Fri, 3 Aug 2012 19:33:32 +0000 (21:33 +0200)] 
docs: update tests docs

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: make compatible with autotools
Karel Zak [Fri, 3 Aug 2012 19:24:51 +0000 (21:24 +0200)] 
tests: make compatible with autotools

The command 'make check' is called from 'make distcheck' (which is
used to generate official util-linux tarballs).

It means that tests/ stuff has to be compatible with autotools and
differentiate between source and build directories.

 * remove run-nonroot.sh (merged into run.sh
 * remove commands.sh.in
 * all tests and top level run.sh accept --builddir and --srcdir
   command line options
 * functions.sh modified to use $top_builddir/tests for output files

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add tests/run-nonroot.sh to automake file
Karel Zak [Fri, 3 Aug 2012 14:24:51 +0000 (16:24 +0200)] 
build-sys: add tests/run-nonroot.sh to automake file

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: don't compile lib{mount,blkid} tests when --disable-static specified
Karel Zak [Thu, 2 Aug 2012 18:19:14 +0000 (20:19 +0200)] 
build-sys: don't compile lib{mount,blkid} tests when --disable-static specified

The tests often depend on private (non-API) library functions.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agowdctl: tiny change to man page
Karel Zak [Thu, 2 Aug 2012 17:25:00 +0000 (19:25 +0200)] 
wdctl: tiny change to man page

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agowdctl: add "--settimeout" to set the timeout
Harald Hoyer [Wed, 1 Aug 2012 11:39:06 +0000 (13:39 +0200)] 
wdctl: add "--settimeout" to set the timeout

[kzak@redhat.com: - fix usage() and man page]

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Harald Hoyer <harald@redhat.com>
13 years agodmesg: fix kmsg usability detection
Karel Zak [Thu, 2 Aug 2012 15:39:14 +0000 (17:39 +0200)] 
dmesg: fix kmsg usability detection

On old kernels (<3.5) kernel allows to open read-only /dev/kmsg for
root, but read() returns -EINVAL. It means that open() is not enough
to detect /dev/kmsg usability. We have to call read() (or epoll).

Reported-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: add libmount optstr deduplicate
Karel Zak [Wed, 1 Aug 2012 17:00:30 +0000 (19:00 +0200)] 
tests: add libmount optstr deduplicate

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: deduplicate SELinux mount options
Karel Zak [Wed, 1 Aug 2012 15:52:22 +0000 (17:52 +0200)] 
libmount: deduplicate SELinux mount options

We already have a clue about SELinux specific mount options in libmount, so
it makes sense to deduplicate the options as Linux kernel does not
support duplicate SELinux options. (SELinux kernel stuff somehow
ignores standard Linux mount conventions...)

Requested-by: Niels de Vos <ndevos@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: add mnt_optstr_deduplicate_option()
Karel Zak [Wed, 1 Aug 2012 15:51:43 +0000 (17:51 +0200)] 
libmount: add mnt_optstr_deduplicate_option()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: standardize fdisk headers in MBR tests
Karel Zak [Wed, 1 Aug 2012 09:16:00 +0000 (11:16 +0200)] 
tests: standardize fdisk headers in MBR tests

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: blkid/md-raid1-part fails
Bernhard Voelker [Wed, 1 Aug 2012 08:35:34 +0000 (10:35 +0200)] 
tests: blkid/md-raid1-part fails

[kzak@redhat.com: - I forgot to apply this part of the Bernhard's patch]

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: cleanup ts_is_mounted
Bernhard Voelker [Tue, 31 Jul 2012 06:24:13 +0000 (08:24 +0200)] 
tests: cleanup ts_is_mounted

* tests/functions.sh (ts_is_mounted): Remove check for canonicalization
failure again, because it is now done by ts_canonicalize.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
13 years agotests: make blkid/md-raid1-part more robust
Bernhard Voelker [Tue, 31 Jul 2012 14:36:35 +0000 (16:36 +0200)] 
tests: make blkid/md-raid1-part more robust

* tests/expected/blkid/mk-raid1-part: Replace major and minor number
of ID_PART_ENTRY_DISK by a special string. Add ID_FS_UUID and
ID_FS_UUID_ENC again, also with a special string.
* tests/ts/blkid/md-raid1-part: Before comparing the expected output
with the actual output, replace the values of ID_PART_ENTRY_DISK,
ID_FS_UUID and ID_FS_UUID_ENC with the speacial strings mentioned above.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
13 years agotests: add non-dos mode fdisk test
Karel Zak [Tue, 31 Jul 2012 17:57:46 +0000 (19:57 +0200)] 
tests: add non-dos mode fdisk test