]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
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>
11 years agosulogin: use dirent->d_type when scans /dev
Karel Zak [Tue, 12 Nov 2013 11:26:13 +0000 (12:26 +0100)] 
sulogin: use dirent->d_type when scans /dev

... it's more effective than call fstatat() for all device.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodocs: update links to http://git.kernel.org/ web repository views
Sami Kerola [Sun, 10 Nov 2013 20:06:10 +0000 (20:06 +0000)] 
docs: update links to http://git.kernel.org/ web repository views

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodocs: add patching process to howto-contribute.txt
Sami Kerola [Sun, 10 Nov 2013 20:06:09 +0000 (20:06 +0000)] 
docs: add patching process to howto-contribute.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agochsh, chfn: add info about non-local support to the man pages
Karel Zak [Mon, 11 Nov 2013 08:18:18 +0000 (09:18 +0100)] 
chsh, chfn: add info about non-local support to the man pages

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: update blkid swap tests
Karel Zak [Fri, 8 Nov 2013 13:22:35 +0000 (14:22 +0100)] 
tests: update blkid swap tests

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: catch memory leaks
Ondrej Oprala [Mon, 23 Sep 2013 13:39:38 +0000 (15:39 +0200)] 
hexdump: catch memory leaks

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: make addfile() variable names more hinting of their purpose
Ondrej Oprala [Mon, 23 Sep 2013 13:39:37 +0000 (15:39 +0200)] 
hexdump: make addfile() variable names more hinting of their purpose

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: use skip_space() in add()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:36 +0000 (15:39 +0200)] 
hexdump: use skip_space() in add()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agostrutils: add skip_space() function
Ondrej Oprala [Mon, 23 Sep 2013 13:39:34 +0000 (15:39 +0200)] 
strutils: add skip_space() function

[kzak@redhat.com: - add also skip_blank(),
                  - remove duplicate implementation from libmount]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: rename in() to first_letter()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:32 +0000 (15:39 +0200)] 
hexdump: rename in() to first_letter()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: get rid of redundant typecasts
Ondrej Oprala [Mon, 23 Sep 2013 13:39:31 +0000 (15:39 +0200)] 
hexdump: get rid of redundant typecasts

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: minor formatting improvements in display()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:30 +0000 (15:39 +0200)] 
hexdump: minor formatting improvements in display()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: rewrite cluttered case statements
Ondrej Oprala [Mon, 23 Sep 2013 13:39:29 +0000 (15:39 +0200)] 
hexdump: rewrite cluttered case statements

[kzak@redhat.com: - use strchr() for in() macro]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agohexdump: use xasprintf in conv_c()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:27 +0000 (15:39 +0200)] 
hexdump: use xasprintf in conv_c()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: delete redundant typecasts
Ondrej Oprala [Mon, 23 Sep 2013 13:39:26 +0000 (15:39 +0200)] 
hexdump: delete redundant typecasts

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: use GNU case ranges where possible
Ondrej Oprala [Mon, 23 Sep 2013 13:39:24 +0000 (15:39 +0200)] 
hexdump: use GNU case ranges where possible

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: use xstrncpy in add()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:23 +0000 (15:39 +0200)] 
hexdump: use xstrncpy in add()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: simplify newsyntax arguments
Ondrej Oprala [Mon, 23 Sep 2013 13:39:22 +0000 (15:39 +0200)] 
hexdump: simplify newsyntax arguments

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: minor formatting improvements
Ondrej Oprala [Mon, 23 Sep 2013 13:39:21 +0000 (15:39 +0200)] 
hexdump: minor formatting improvements

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rename next{fs,fu,pr} to {fs,fu,pr}list
Ondrej Oprala [Mon, 23 Sep 2013 13:39:20 +0000 (15:39 +0200)] 
hexdump: rename next{fs,fu,pr} to {fs,fu,pr}list

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rewrite addfile() to use getline()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:19 +0000 (15:39 +0200)] 
hexdump: rewrite addfile() to use getline()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: formatting and variable name cleanup
Ondrej Oprala [Mon, 23 Sep 2013 13:39:18 +0000 (15:39 +0200)] 
hexdump: formatting and variable name cleanup

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rewrite() formatting improvements
Ondrej Oprala [Mon, 23 Sep 2013 13:39:17 +0000 (15:39 +0200)] 
hexdump: rewrite() formatting improvements

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rewrite escape()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:16 +0000 (15:39 +0200)] 
hexdump: rewrite escape()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rewrite rewrite()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:15 +0000 (15:39 +0200)] 
hexdump: rewrite rewrite()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump:rewrite add()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:14 +0000 (15:39 +0200)] 
hexdump:rewrite add()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rewrite next()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:13 +0000 (15:39 +0200)] 
hexdump: rewrite next()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rewrite get()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:12 +0000 (15:39 +0200)] 
hexdump: rewrite get()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: rewrite addfile()
Ondrej Oprala [Mon, 23 Sep 2013 13:39:11 +0000 (15:39 +0200)] 
hexdump: rewrite addfile()

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: cleanup of redundant symbols/repeating literals
Ondrej Oprala [Mon, 23 Sep 2013 13:39:10 +0000 (15:39 +0200)] 
hexdump: cleanup of redundant symbols/repeating literals

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: use list.h queues and rewrite redundant for cycles
Ondrej Oprala [Mon, 23 Sep 2013 13:39:09 +0000 (15:39 +0200)] 
hexdump: use list.h queues and rewrite redundant for cycles

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
11 years agohexdump: add basic tests
Ondrej Oprala [Mon, 23 Sep 2013 13:39:40 +0000 (15:39 +0200)] 
hexdump: add basic tests

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoblkid: simple typo
Phillip Susi [Fri, 8 Nov 2013 09:12:17 +0000 (10:12 +0100)] 
blkid: simple typo

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodocs: add note about make distcheck
Karel Zak [Fri, 8 Nov 2013 09:00:43 +0000 (10:00 +0100)] 
docs: add note about make distcheck

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoblkid: escape quotes in the output
Karel Zak [Thu, 7 Nov 2013 13:07:17 +0000 (14:07 +0100)] 
blkid: escape quotes in the output

 # e2label /dev/loop0 'La"bel'
 # blkid -p /dev/loop0
 /dev/loop0: LABEL="La"bel"  ....

new version:

 /dev/loop0: LABEL="La\"bel" ....

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: add sparc64 lscpu test
Karel Zak [Tue, 5 Nov 2013 11:49:20 +0000 (12:49 +0100)] 
tests: add sparc64 lscpu test

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolscpu: support non sequentially numbering of CPUs
Alexander Troosh [Tue, 5 Nov 2013 09:16:38 +0000 (10:16 +0100)] 
lscpu: support non sequentially numbering of CPUs

lscpu don't work correctly on my system with:

 $ cat /sys/devices/system/cpu/possible
 0-1,4-5,8-9,12-13

[kzak@redhat.com: - coding style,
                  - add commit message
                  - add real_cpu_num() macro,
                  - fix functions where we need idx as well as CPU number]

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoblockdev: don't use HDIO_GETGEO
Phillip Susi [Fri, 1 Nov 2013 17:37:05 +0000 (13:37 -0400)] 
blockdev: don't use HDIO_GETGEO

blockdev was still using this depreciated ioctl and that was
causing blockdev --report to fail on loop and nbd devices.
Switch to reading the partition start from sysfs instead.
This also allows it to correctly report > 2^32 sector counts.

[kzak@redhat.com: - check sysfs_init() return,
                  - use uint64_t rather than unsigned long long]

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoblkdiscard: BLKSSZGET fills in an int, not a uint64
Theodore Ts'o [Sat, 2 Nov 2013 23:46:06 +0000 (19:46 -0400)] 
blkdiscard: BLKSSZGET fills in an int, not a uint64

Reported-by: Jason Cipriani <jason.cipriani@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibmount: update utab after successful extern helper mount
Karel Zak [Mon, 4 Nov 2013 11:45:33 +0000 (12:45 +0100)] 
libmount: update utab after successful extern helper mount

This patch allows to maintain private utab libmount file also for
external mount/umount helpers that are not linked with libmount.

The libmount check if utab has been updated after successful extern
helper execution (status=0). If not then the file is updated.

This patch affects only 'user' fstab mount option. So, for example
with suid mount.cifs you can use:

 //server/foo    /mnt  cifs   username=foo,noauto,user

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibmount: allow to use -s (sloppy) for all external helpers
Karel Zak [Mon, 4 Nov 2013 09:50:48 +0000 (10:50 +0100)] 
libmount: allow to use -s (sloppy) for all external helpers

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibblkid: fix swap-area version
Karel Zak [Mon, 4 Nov 2013 08:59:54 +0000 (09:59 +0100)] 
libblkid: fix swap-area version

 * v1: hdr->version = 1, magic string = SWAPSPACE2
 * v0: no versio in header, magic string = SWAP-SPACE

The mistake has been introduced in the old udev volume_id
binary where the version was set according to magic string.

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibfdisk: (sun) fix end sectors with +1 error
Karel Zak [Fri, 1 Nov 2013 11:15:25 +0000 (12:15 +0100)] 
libfdisk: (sun) fix end sectors with +1 error

partx (or parted, etc.):

NR     START       END   SECTORS   SIZE NAME UUID
 1         0    410047    410048 200.2M
 2    410048  82329055  81919008  39.1G
 4  82329056 102807615  20478560   9.8G
 5 102807616 110999039   8191424   3.9G
 6 110999040 312580543 201581504  96.1G

and the same with fdisk:

     Device Flag    Start       End    Blocks   Id  System
/dev/loop0p1             0    410048    205024    1  Boot
/dev/loop0p2        410048  82329056  40959504   83  Linux native
/dev/loop0p3             0 312580544 156290272    5  Whole disk
/dev/loop0p4      82329056 102807616  10239280   83  Linux native
/dev/loop0p5     102807616 110999040   4095712   83  Linux native
/dev/loop0p6     110999040 312580544 100790752   8e  Linux LVM

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agomount: improve -s man mage info
Karel Zak [Thu, 31 Oct 2013 09:44:33 +0000 (10:44 +0100)] 
mount: improve -s man mage info

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibfdisk: (gpt) add /home GUID
Karel Zak [Thu, 31 Oct 2013 07:53:03 +0000 (08:53 +0100)] 
libfdisk: (gpt) add /home GUID

Reported-by: andreas.hanke@gmx-topmail.de
References: http://cgit.freedesktop.org/systemd/systemd/commit/?id=1a14a53cfded6e78c6e8dfb73fdff0039971d642
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibfdisk: (gpt) allow to work with hybrid GPT
Karel Zak [Wed, 23 Oct 2013 14:59:45 +0000 (16:59 +0200)] 
libfdisk: (gpt) allow to work with hybrid GPT

Notes:

 * fdisk don't sync hybrid MBR with GPT
 * hybrid MBR is ignored and not overwritten by PBMR
 * users is informed about expert command 'M' to toggle between MBR
   and GPT mode. It's possible to manually modify hybrid MBR.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibfdisk: (gpt) improve and cleanup recovery code
Karel Zak [Wed, 23 Oct 2013 10:06:47 +0000 (12:06 +0200)] 
libfdisk: (gpt) improve and cleanup recovery code

 * use AlternativeLBA rather than hardcoded offset to backup GPT
 * create gpt_copy_header()

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