]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
11 years agocolumn: fix mem leak [coverity scan]
Karel Zak [Tue, 14 Jan 2014 16:53:22 +0000 (17:53 +0100)] 
column: fix mem leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agomore: fix mem leak [coverity scan]
Karel Zak [Tue, 14 Jan 2014 16:49:34 +0000 (17:49 +0100)] 
more: fix mem leak [coverity scan]

... the code is so soo ugly.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agopylibmount: import directly from pylibmount in tests
Karel Zak [Tue, 14 Jan 2014 16:34:08 +0000 (17:34 +0100)] 
pylibmount: import directly from pylibmount in tests

This change does not have any impact to in a standard way installed
libmount impact. It's simplification for in-tree tests.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agopylibmount: remove unncessary subdirectory
Karel Zak [Tue, 14 Jan 2014 13:57:44 +0000 (14:57 +0100)] 
pylibmount: remove unncessary subdirectory

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: update lscpu tests
Karel Zak [Tue, 14 Jan 2014 12:58:38 +0000 (13:58 +0100)] 
tests: update lscpu tests

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolscpu: sort NUMA nodes to keep output human readable
Karel Zak [Tue, 14 Jan 2014 12:56:27 +0000 (13:56 +0100)] 
lscpu: sort NUMA nodes to keep output human readable

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodocs: add lslogins(1) to TODO
Karel Zak [Tue, 14 Jan 2014 09:17:16 +0000 (10:17 +0100)] 
docs: add lslogins(1) to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: add partx --update test
Karel Zak [Tue, 14 Jan 2014 08:51:02 +0000 (09:51 +0100)] 
tests: add partx --update test

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: update partx sgi test
Karel Zak [Tue, 14 Jan 2014 08:41:04 +0000 (09:41 +0100)] 
tests: update partx sgi test

Since commit 4253275490926cf533bfd0bc33279729e9ff427a the libblkid
lists system partitions for SGI label.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agopartx: fix --update ranges and out of order tables
Scott Moser [Mon, 13 Jan 2014 20:32:49 +0000 (15:32 -0500)] 
partx: fix --update ranges and out of order tables

partx --update DEVICE NUMBER
was broken in 2 cases:
 * if NUMBER != 1
 * if the partition table was "out of order".
   Ie, where sda2 came after sda3.

References: https://bugs.launchpad.net/ubuntu/+source/cloud-utils/+bug/1244662
Signed-off-by: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agomount: update man page ext3/4 mount options
Carlos Maiolino [Mon, 13 Jan 2014 14:05:49 +0000 (15:05 +0100)] 
mount: update man page ext3/4 mount options

Add missing mount options to ext3 and ext4 filesystems. This also
remove resize option information from the man page.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofallocate: prefer FALLOC_FL_* flags from libc headers
Karel Zak [Mon, 13 Jan 2014 13:53:18 +0000 (14:53 +0100)] 
fallocate: prefer FALLOC_FL_* flags from libc headers

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibblkid: (nilfs2) check also backup superblock
Karel Zak [Mon, 13 Jan 2014 13:30:51 +0000 (14:30 +0100)] 
libblkid: (nilfs2) check also backup superblock

* read also backup superblock
* check which superblock is newer
* set minimal device size to 1MiB

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodmesg: fix --raw zero timestamp for kmsg
Karel Zak [Tue, 7 Jan 2014 16:41:42 +0000 (17:41 +0100)] 
dmesg: fix --raw zero timestamp for kmsg

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1049438
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agouuidd: use pkg-config to find systemd-deamon support
Sami Kerola [Mon, 6 Jan 2014 23:39:08 +0000 (23:39 +0000)] 
uuidd: use pkg-config to find systemd-deamon support

[kzak@redhat.com: - remove USE_SOCKET_ACTIVATION and use
                    HAVE_* as we use for another libs]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agounshare: Add possibility to add mapping into root user in user namespace
Lubomir Rintel [Fri, 27 Dec 2013 21:14:48 +0000 (22:14 +0100)] 
unshare: Add possibility to add mapping into root user in user namespace

This makes it very convenient to use make use of privileged actions
on CONFIG_USER_NS enabled kernels, without having to manually tinker
with uid_map and gid_map to obtain required credentials (as those
given upon unshare() vanish with call to execve() and lot of userspace
checks for euid==0 anyway).

Usage example:

$ unshare --uts
unshare: unshare failed: Operation not permitted

$ unshare --user --uts
[nfsnobody@odvarok ~]$ hostname swag
hostname: you must be root to change the host name

$ unshare -r --uts
[root@odvarok util-linux]# hostname swag
[root@odvarok util-linux]#

[kzak@redhat.com: - move code to map_id()
                  - use all-io.h
                  - add paths to pathnames.h]

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agocal: in man page improve grammar and wording of the reformation limitation
Benno Schulenberg [Mon, 6 Jan 2014 20:43:44 +0000 (21:43 +0100)] 
cal: in man page improve grammar and wording of the reformation limitation

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agolscpu: support discontinuous NUMA nodes
Karel Zak [Mon, 6 Jan 2014 15:48:44 +0000 (16:48 +0100)] 
lscpu: support discontinuous NUMA nodes

lscpu fails to print proper NUMA node values in a system with
discontinuous nodes. This patch adds support by creating a nodeidx
array to map node numbers.

Based on patch from Madhavan Srinivasan <maddy@linux.vnet.ibm.com>.

Reported-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/path: add path_strdup()
Karel Zak [Mon, 6 Jan 2014 15:48:13 +0000 (16:48 +0100)] 
lib/path: add path_strdup()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: convert a variable type according with fmt
Andrew Vagin [Fri, 27 Dec 2013 13:45:57 +0000 (17:45 +0400)] 
hexdump: convert a variable type according with fmt

hexdump works uncorrectly on Rassberry Pi (raspbian wheezy):
0000000 3200000000 3400000000 3600000000 3800000000 a00000000
000000a

The problem is that the %qx format is used for printing
the (short int) variable.

Here is the output from hexdump with this patch:
0000000 3231 3433 3635 3837 0a39
000000a

Currently raspbian uses hexdump from bsdmainutils.
bsdmainutils: /usr/bin/hexdump

Signed-off-by: Andrew Vagin <avagin@openvz.org>
11 years agohexdump: don't access hex after freeing it
Andrew Vagin [Mon, 6 Jan 2014 12:58:51 +0000 (13:58 +0100)] 
hexdump: don't access hex after freeing it

[kzak@redhat.com: - remove unnecessary code]

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: use xcalloc()
Karel Zak [Mon, 6 Jan 2014 12:54:48 +0000 (13:54 +0100)] 
hexdump: use xcalloc()

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: libmount: skip tabfiles-py when pylibmount is disabled
Mike Frysinger [Mon, 23 Dec 2013 00:01:32 +0000 (19:01 -0500)] 
tests: libmount: skip tabfiles-py when pylibmount is disabled

The default configure disables python support, so this test fails by
default.  Add a simple check for module availability.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agotests: last: skip when last is not enabled
Mike Frysinger [Sun, 22 Dec 2013 23:20:29 +0000 (18:20 -0500)] 
tests: last: skip when last is not enabled

References: https://bugs.gentoo.org/489794
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agocal: in man page admit that any week has just one Sunday
Benno Schulenberg [Mon, 6 Jan 2014 11:40:13 +0000 (12:40 +0100)] 
cal: in man page admit that any week has just one Sunday

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agocal: mention where Gregorian reformation happen in September 1752
Sami Kerola [Sun, 22 Dec 2013 18:06:04 +0000 (18:06 +0000)] 
cal: mention where Gregorian reformation happen in September 1752

In September 1752 the Gregorian reformation happen in Great Britain and
Dominions (including what is now the USA).  One could argue the cal(1)
should consider locale when determining the reformation, but such is
nearly impossible implement correctly.

The dates when reformation happen are split by areas that cannot be
expressed with current locales, for example the Netherlands is split to
two and Germany three categories depending on where in the modern country
one is.  Secondly the track when reformation happen is lost for some
countries, Lithuania or Japan are good examples of such.

One of the worst for a programmer is Sweden.  They got gradual calendar
change which made Swedish calendar to be completely out of sync.  Later
the Swedish calendar jumped in 1753 to be in sync with everyone else.

Notice that some countries, including Saudi Arabia, Ethiopia, Nepal, Iran
and Afghanistan, still have not adopted the Gregorian calendar.  Hence
the output of the cal(1) cannot be considered to be correct for everyone.

References: http://calendopedia.com/gregory.htm
References: http://en.wikipedia.org/wiki/Gregorian_calendar#Gregorian_reform
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agolosetup: remove warning for unsupported -e and -E
Karel Zak [Mon, 6 Jan 2014 08:08:40 +0000 (09:08 +0100)] 
losetup: remove warning for unsupported -e and -E

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolosetup, mount: remove --pass-fd at all
Karel Zak [Mon, 6 Jan 2014 08:02:36 +0000 (09:02 +0100)] 
losetup, mount: remove --pass-fd at all

The option is unsupported since v2.23, let's cleanup man pages and
code to remove it at all.

Reported-by: "Dale R. Worley" <worley@alum.mit.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoman: Syntax and spelling fixes.
Ville Skyttä [Wed, 18 Dec 2013 22:13:48 +0000 (00:13 +0200)] 
man: Syntax and spelling fixes.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
11 years agopo: add '--no-wrap' to msgmerge, to not wrap long message lines
Benno Schulenberg [Mon, 16 Dec 2013 21:41:56 +0000 (22:41 +0100)] 
po: add '--no-wrap' to msgmerge, to not wrap long message lines

This avoids unneeded churn during POT-file renewal and PO-file updates,
as the PO files at the TP are made with '--no-wrap'.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Acked-by: Sami Kerola <kerolasa@iki.fi>
11 years agomount: add note about "noauto" to --all description
Karel Zak [Thu, 12 Dec 2013 10:41:07 +0000 (11:41 +0100)] 
mount: add note about "noauto" to --all description

References: https://bugzilla.redhat.com/show_bug.cgi?id=1039905
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibblkid: Identify extN file system properly
Lukas Czerner [Tue, 3 Dec 2013 15:24:44 +0000 (16:24 +0100)] 
libblkid: Identify extN file system properly

Currently when trying to identify extN file system we're playing games
with searching for kernel modules and parsing /proc/filesystem. All of
this just because ext4 module can be used to mount ext3 and ext2 file
systems on recent kernel and also because of ext4dev.

However all of this is not necessary. Ext4 module which does support
mounting ext2 and ext3 file system is able to recognize and mount ext2
and ext3 type so there is no need to disguise it and ext4dev should only
be ever used for testing and not as fallback when other modules are
missing (use -t instead).

This also introduces a bug when in situation that we only have ext4
modules with ext2/ext3 support which is not loaded and we try to mount
ext2 file system we will mount it incorrectly as ext4. This will not
happen if the ext4 module is already loaded.

With this patch we remove all the unnecessary checks and return the real
type of the file system which is on the device. This fixes the issue.
However on the kernel which was not compiled with EXT4_USE_FOR_EXT23
support one would have to provide file system type (-t) to be able to
mount the file system with ext4 driver.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotextual: small inprovements to usage and man page of fstrim
Benno Schulenberg [Wed, 11 Dec 2013 11:40:14 +0000 (12:40 +0100)] 
textual: small inprovements to usage and man page of fstrim

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
11 years agofstrim: de-duplicate list of filesystems
Karel Zak [Wed, 11 Dec 2013 16:01:23 +0000 (17:01 +0100)] 
fstrim: de-duplicate list of filesystems

Reported-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofindmnt: add -U to de-deplicate filesystems
Karel Zak [Wed, 11 Dec 2013 16:01:15 +0000 (17:01 +0100)] 
findmnt: add -U to de-deplicate filesystems

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibmount: add mnt_table_uniq_fs()
Karel Zak [Wed, 11 Dec 2013 15:59:57 +0000 (16:59 +0100)] 
libmount: add mnt_table_uniq_fs()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofindmnt: cleanup usage()
Karel Zak [Wed, 11 Dec 2013 13:47:06 +0000 (14:47 +0100)] 
findmnt: cleanup usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofstrim: add --all to discard all filesystem
Karel Zak [Tue, 10 Dec 2013 14:49:49 +0000 (15:49 +0100)] 
fstrim: add --all to discard all filesystem

 * read /proc/self/mountinfo to get filesystems
 * ignore net and pseudo filesystems
 * ignore unaccessible filesystems (over mounted by another FS)
 * read disk sysfs queue/discard_granularity to detect is discard support
 * call FITRIM ioctl
 * silently ignore EOPNOTSUPP (for example LUKS without discard) and ENOTTY
   (for example vfat) errors

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibmount: add efivarfs to the list of pseudo filesystems
Karel Zak [Tue, 10 Dec 2013 13:05:22 +0000 (14:05 +0100)] 
libmount: add efivarfs to the list of pseudo filesystems

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofstrim: cleanup usage()
Karel Zak [Tue, 10 Dec 2013 10:36:50 +0000 (11:36 +0100)] 
fstrim: cleanup usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotaskset: fix PERMISSIONS section of taskset man page
Rik van Riel [Fri, 6 Dec 2013 21:07:54 +0000 (16:07 -0500)] 
taskset: fix PERMISSIONS section of taskset man page

A user is always allowed to change the CPU affinity of his or her
own processes. CAP_SYS_NICE is only required to change the affinity
of another user's process.

Signed-off-by: Rik van Riel <riel@redhat.com>
Reported-by: Joe Mario <jmario@redhat.com>
11 years agocal: use month contents structure for --year printing
Sami Kerola [Sun, 10 Nov 2013 18:23:40 +0000 (18:23 +0000)] 
cal: use month contents structure for --year printing

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocal: use month contents structure for --three printing
Sami Kerola [Sun, 10 Nov 2013 18:23:39 +0000 (18:23 +0000)] 
cal: use month contents structure for --three printing

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocal: add month contents structure
Sami Kerola [Sun, 10 Nov 2013 18:23:38 +0000 (18:23 +0000)] 
cal: add month contents structure

This changes determination of calendar month content completely, as well
as outputing.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocal: determine how many header lines are needed at initialization
Sami Kerola [Sun, 10 Nov 2013 18:23:37 +0000 (18:23 +0000)] 
cal: determine how many header lines are needed at initialization

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: cal: do not let --week=<num> to adjust requested month
Sami Kerola [Sun, 10 Nov 2013 18:23:36 +0000 (18:23 +0000)] 
tests: cal: do not let --week=<num> to adjust requested month

The previous commit made --week=<number> to have smaller weight value
than a month supplied by user.  The commit started to print the month
that has more days at the week when a week is split to two months, and
only one month output is requested.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocal: make user request to be part of read-only control struct
Sami Kerola [Sun, 10 Nov 2013 18:23:35 +0000 (18:23 +0000)] 
cal: make user request to be part of read-only control struct

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agotests: cal: take account week numbers when determing month lenght
Sami Kerola [Sun, 10 Nov 2013 18:23:34 +0000 (18:23 +0000)] 
tests: cal: take account week numbers when determing month lenght

The month header does not need to wrap if month width with week number
allows printing to single line.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocal: determine output width at beginning of run and reuse result
Sami Kerola [Sun, 10 Nov 2013 18:23:33 +0000 (18:23 +0000)] 
cal: determine output width at beginning of run and reuse result

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocal: simplify ascii_weeknum() function
Sami Kerola [Sun, 10 Nov 2013 18:23:32 +0000 (18:23 +0000)] 
cal: simplify ascii_weeknum() function

Either the week is or isn't highlighted, there is no need to over
complicate printing of that.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocal: make day_in_week() use same variable names as other functions
Sami Kerola [Sun, 10 Nov 2013 18:23:31 +0000 (18:23 +0000)] 
cal: make day_in_week() use same variable names as other functions

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocal: add input variable names to function prototypes
Sami Kerola [Sun, 10 Nov 2013 18:23:30 +0000 (18:23 +0000)] 
cal: add input variable names to function prototypes

While prototypes such as 'function(int, int, char, int);' are legal they
do not help when trying to understand how the function is expected to be
used.  Adding variable names gives at least a hint when looking the
prototypes.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocal: rename ascii_wnum() to ascii_weeknum()
Sami Kerola [Sun, 10 Nov 2013 18:23:29 +0000 (18:23 +0000)] 
cal: rename ascii_wnum() to ascii_weeknum()

Week is not long word, so it does not need to be enshorted and made more
difficult to understand.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocal: use control structure for run time configuration
Sami Kerola [Sun, 10 Nov 2013 18:23:28 +0000 (18:23 +0000)] 
cal: use control structure for run time configuration

Runtime configuration is set at the time of command line option parsing,
and other initialization.  Later the configuration is read-only.  This
should make code a little bit more understandable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoscript: script input redirection / eof handling
Karel Zak [Tue, 3 Dec 2013 12:32:55 +0000 (13:32 +0100)] 
script: script input redirection / eof handling

  echo "ps uf" | script

does not work because script assume that stdin is terminal and
it does not forward EOF to the pty.

This patch:

  * make non-tty use-case more robust (don't call tty ioclts to
    non-tty file descriptors.

  * send EOF (CTL('D') control char) to the master channel when
    detected eof by read() on stdin

  * wait for empty master and slave file descriptors to be sure that
    we don't miss date for typescript. This is also necessary to be
    sure that slave channel (shell) is completely initialized otherwise
    EOF is ignored.

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: Create struct hexdump containing previously global variables.
Ondrej Oprala [Fri, 8 Nov 2013 16:13:14 +0000 (17:13 +0100)] 
hexdump: Create struct hexdump containing previously global variables.

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: add __attribute__ ((__noreturn__)) to bad*() functions
Ondrej Oprala [Fri, 8 Nov 2013 16:13:13 +0000 (17:13 +0100)] 
hexdump: add __attribute__ ((__noreturn__)) to bad*() functions

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rename struct _fs to struct hexdump_fs and remove its typedef
Ondrej Oprala [Fri, 8 Nov 2013 16:13:12 +0000 (17:13 +0100)] 
hexdump: rename struct _fs to struct hexdump_fs and remove its typedef

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rename struct _fu to struct hexdump_fu and remove its typedef
Ondrej Oprala [Fri, 8 Nov 2013 16:13:11 +0000 (17:13 +0100)] 
hexdump: rename struct _fu to struct hexdump_fu and remove its typedef

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: Rename struct _pr to struct hexdump_pr and remove it's typedef
Ondrej Oprala [Fri, 8 Nov 2013 16:13:10 +0000 (17:13 +0100)] 
hexdump: Rename struct _pr to struct hexdump_pr and remove it's typedef

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rename rewrite to rewrite_rules
Ondrej Oprala [Fri, 8 Nov 2013 16:13:09 +0000 (17:13 +0100)] 
hexdump: rename rewrite to rewrite_rules

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rename add to add_fmt
Ondrej Oprala [Fri, 8 Nov 2013 16:13:08 +0000 (17:13 +0100)] 
hexdump: rename add to add_fmt

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: Merge hexsyntax.c into hexdump.c
Ondrej Oprala [Fri, 8 Nov 2013 16:13:07 +0000 (17:13 +0100)] 
hexdump: Merge hexsyntax.c into hexdump.c

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: add the prefix 'hexdump-' to {conv,display,parse}.c
Ondrej Oprala [Fri, 8 Nov 2013 16:13:06 +0000 (17:13 +0100)] 
hexdump: add the prefix 'hexdump-' to {conv,display,parse}.c

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agoscript: check that stdin is a terminal
Karel Zak [Mon, 2 Dec 2013 12:42:01 +0000 (13:42 +0100)] 
script: check that stdin is a terminal

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agosetterm: fix -dump man page info
Karel Zak [Mon, 2 Dec 2013 11:21:47 +0000 (12:21 +0100)] 
setterm: fix -dump man page info

It seems that setterm -dump does not dump terminal attributes, but
the man page says -dump includes the attributes. Let's fix the man
page.

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoagetty: support the special terminal on first serial line on a S/390
Werner Fink [Fri, 29 Nov 2013 15:44:25 +0000 (16:44 +0100)] 
agetty: support the special terminal on first serial line on a S/390

which is due legacy reasons a block terminal of type 3270 or higher.
Whereas the second serial line on a S/390(x) is a real character
terminal which is compatible with VT220.

Signed-off-by: Werner Fink <werner@suse.de>
11 years agomount man page cleanups
Phillip Susi [Mon, 25 Nov 2013 15:35:40 +0000 (10:35 -0500)] 
mount man page cleanups

Fowarding this patch submitted by Bjarni Ingi Gislason
<bjarniig@rhi.hi.is> to deb bug #674595.

11 years agomount.8: fix grammar
Phillip Susi [Mon, 25 Nov 2013 15:23:26 +0000 (10:23 -0500)] 
mount.8: fix grammar

Switch "A unbindable" to "An unbindable"

Reported-by: Regid Ichira <regid23@nt1.in>
Signed-off-by: Phillip Susi <psusi@ubuntu.com>
11 years agopylibmount: correctly import from pylibmount.so
Dave Reisner [Thu, 21 Nov 2013 17:25:27 +0000 (12:25 -0500)] 
pylibmount: correctly import from pylibmount.so

Without this, python is unable to find the module:

$ python -c 'import libmount'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.3/site-packages/libmount/__init__.py", line 1, in <module>
    from pylibmount import *
ImportError: No module named 'pylibmount'

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
11 years agonamei: align missing files with rest of the print out
Sami Kerola [Wed, 20 Nov 2013 00:57:04 +0000 (00:57 +0000)] 
namei: align missing files with rest of the print out

This change should make namei output more readable when multiple
arguments are supplied.

The old:

$ namei -l /usr/foo
f: /usr/foo
drwxr-xr-x root root /
drwxr-xr-x root root usr
foo - No such file or directory

The new:

$ namei -l /usr/foo
f: /usr/foo
drwxr-xr-x root root /
drwxr-xr-x root root usr
                     foo - No such file or directory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agolosetup, agetty: remove unnecessary if's before free()
Sami Kerola [Wed, 20 Nov 2013 00:57:03 +0000 (00:57 +0000)] 
losetup, agetty: remove unnecessary if's before free()

Reference: http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/useless-if-before-free
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agolibfdisk: (dos) warn on type 0
Karel Zak [Wed, 27 Nov 2013 21:04:10 +0000 (22:04 +0100)] 
libfdisk: (dos) warn on type 0

This is old warning, but somehow lost during rewrite to libfdisk. Sorry.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibfdisk: (dos) fix free part counter
Karel Zak [Wed, 27 Nov 2013 20:42:18 +0000 (21:42 +0100)] 
libfdisk: (dos) fix free part counter

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibblkid: fix sgi PT parser to report system partitions
Karel Zak [Wed, 27 Nov 2013 15:55:08 +0000 (16:55 +0100)] 
libblkid: fix sgi PT parser to report system partitions

... to be compatible with Linux kernel.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofdisk: (gpt) more human readable info about free space
Karel Zak [Mon, 25 Nov 2013 12:18:02 +0000 (13:18 +0100)] 
fdisk: (gpt) more human readable info about free space

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofdisk: don't care about partition type
Karel Zak [Mon, 25 Nov 2013 11:00:55 +0000 (12:00 +0100)] 
fdisk: don't care about partition type

fdisk allows to overwrite existing partition if the partition has
partition type set to zero (very unusual, but possible).

This is incorrect because such partition is pretty valid (and Linux
kernel does not care about the type at all). For example:

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048       22527       10240   83  Linux
/dev/sdb2           22528      227327      102400    0  Empty
                    ^^^^^                            ^^^^^^^^

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p):
Using default response p
Partition number (3,4, default 3):
First sector (22528-1228799, default 22528):
                                    ^^^^^^^

.. if user follows the default then the result are overlapping
partitions:

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048       22527       10240   83  Linux
/dev/sdb2           22528      227327      102400    0  Empty
/dev/sdb3           22528     1228799      603136   83  Linux
                    ^^^^^

... and if you call "mkfs /dev/sdb3" then you lost data on sdb2. Sad
thing.

Reported-by: Marc MERLIN <marc@merlins.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofdisk: fix nasty coding style
Karel Zak [Mon, 25 Nov 2013 09:58:18 +0000 (10:58 +0100)] 
fdisk: fix nasty coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofdisk: fix usage(), -l [<disk>]
Karel Zak [Tue, 19 Nov 2013 17:30:40 +0000 (18:30 +0100)] 
fdisk: fix usage(), -l [<disk>]

Add square brackets, <disk> is optional for -l.

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoumount: fix umount by tag for non-roots
Karel Zak [Tue, 19 Nov 2013 16:55:12 +0000 (17:55 +0100)] 
umount: fix umount by tag for non-roots

 $ umount LABEL=foo

currently does not work for non-root users as umount uses the
LABEL= as a path in sanitize_path().

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibblkid: fix memory leak in blkid_parse_tag_string()
Karel Zak [Tue, 19 Nov 2013 16:52:56 +0000 (17:52 +0100)] 
libblkid: fix memory leak in blkid_parse_tag_string()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agomount: make NAME=value tags usable for non-root
Karel Zak [Tue, 19 Nov 2013 16:44:21 +0000 (17:44 +0100)] 
mount: make NAME=value tags usable for non-root

The libmount does not care if we set source or target, it's able to
swap it, but the mount.c function sanitize_paths() does not work as
expected if we set NAME=value as target. It means that

 $ mount LABEL=foo

does not work for non-root users (since 51e3530cdcb1d4f3ab91ae953ebc5adcdc5f9239, v2.24).

This patch also checks if source or target is specified more
than once.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibmount: add mnt_tag_is_valid()
Karel Zak [Tue, 19 Nov 2013 16:41:28 +0000 (17:41 +0100)] 
libmount: add mnt_tag_is_valid()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofsck: add ext4 to list of filesystems with progress bars in fsck man page
Phillip Susi [Mon, 18 Nov 2013 19:15:50 +0000 (14:15 -0500)] 
fsck: add ext4 to list of filesystems with progress bars in fsck man page

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
11 years agomount: fix man mount page type
Phillip Susi [Mon, 18 Nov 2013 19:00:17 +0000 (14:00 -0500)] 
mount: fix man mount page type

Slight grammatical error in the mount man page

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
11 years agosetpriv: simplify usage()
Karel Zak [Tue, 19 Nov 2013 13:42:22 +0000 (14:42 +0100)] 
setpriv: simplify usage()

Let's keep usage() simple and details in the man page. The current
brief description in usage() seems confusing for some users.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'fixes' of https://github.com/rudimeier/util-linux
Karel Zak [Tue, 19 Nov 2013 12:17:34 +0000 (13:17 +0100)] 
Merge branch 'fixes' of https://github.com/rudimeier/util-linux

* 'fixes' of https://github.com/rudimeier/util-linux:
  tests: fix fdisk GPT test

11 years agolibfdisk: (sgi) generate partname according to partition position
Karel Zak [Tue, 19 Nov 2013 12:02:39 +0000 (13:02 +0100)] 
libfdisk: (sgi) generate partname according to partition position

The SGI drive currently counts only usable partitions, that's wrong as
Linux kernel counts all partition to generate partition number. For
example:

Kernel:
sdb                                             8:16   0   600M  0 disk
├─sdb9                                          8:25   0     2M  0 part
└─sdb11                                         8:27   0 596.2M  0 part

Fdisk:
Pt# Device    Info Start       End   Sectors Id System
 9: /dev/sdb1          0      4095      4096  0 SGI volhdr
11: /dev/sdb2          0   1220939   1220940  6 SGI volume

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agounshare: add more hints about mount namespaces to the man page
Karel Zak [Mon, 18 Nov 2013 11:50:27 +0000 (12:50 +0100)] 
unshare: add more hints about mount namespaces to the man page

There is also idea (by Lennart) to add --propagation=[shared|private|slave|off]
to unshare(1), but it seems unnecessary and too complex as everyone can call
mount(8) after unshare(1) to setup a proper namespace.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolsblk: fix -D segfault
Karel Zak [Mon, 18 Nov 2013 10:27:35 +0000 (11:27 +0100)] 
lsblk: fix -D segfault

References: https://bugzilla.redhat.com/show_bug.cgi?id=1031262
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agomkfs.minix: fix fscanf() format string [coverity scan]
Karel Zak [Mon, 18 Nov 2013 09:58:41 +0000 (10:58 +0100)] 
mkfs.minix: fix fscanf() format string [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: fix fdisk GPT test
Ruediger Meier [Thu, 14 Nov 2013 11:12:47 +0000 (12:12 +0100)] 
tests: fix fdisk GPT test

There was a missing newline since cd05de50.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agoscript: restore errno in signal handler
Karel Zak [Thu, 14 Nov 2013 13:38:06 +0000 (14:38 +0100)] 
script: restore errno in signal handler

References: https://plus.google.com/+LennartPoetteringTheOneAndOnly/posts/gHSscCJkakd
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoscript: don't call TIOCGWINSZ in signal handler
Karel Zak [Thu, 14 Nov 2013 13:34:15 +0000 (14:34 +0100)] 
script: don't call TIOCGWINSZ in signal handler

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agomkswap: remove cruft from the man page
Phillip Susi [Wed, 13 Nov 2013 15:30:52 +0000 (10:30 -0500)] 
mkswap: remove cruft from the man page

I don't think there's any reason to continue to mention behavior
of kernels older than 10 years.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
11 years agomount: correct mount man page default iso9660 permission
Phillip Susi [Wed, 13 Nov 2013 15:19:04 +0000 (10:19 -0500)] 
mount: correct mount man page default iso9660 permission

The mount man page said the default permissions are read for
everyone, but it is in fact, read and execute.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
11 years agolibmount: cleanup fix_optstr() regards to selinux and smack
Karel Zak [Tue, 12 Nov 2013 14:49:33 +0000 (15:49 +0100)] 
libmount: cleanup fix_optstr() regards to selinux and smack

It's better (more robust) to make the code based on datetypes
rather than on if(strcmp(...)).

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: add --with-smack to config-gen.d
Karel Zak [Tue, 12 Nov 2013 14:48:42 +0000 (15:48 +0100)] 
build-sys: add --with-smack to config-gen.d

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibmount: fix typo in smack path
Karel Zak [Tue, 12 Nov 2013 14:17:28 +0000 (15:17 +0100)] 
libmount: fix typo in smack path

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibmount: remove smackfs* option when SMACK not enabled
Karel Zak [Tue, 12 Nov 2013 14:07:12 +0000 (15:07 +0100)] 
libmount: remove smackfs* option when SMACK not enabled

If there is no /sys/fs/smackfs then libmount removes smackfs*= mount
options when compiled --with-smack.

Note that we do the same for SELinux.

References: http://www.mail-archive.com/systemd-devel@lists.freedesktop.org/msg13740.html
Signed-off-by: Karel Zak <kzak@redhat.com>