]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agoblkid: introduce symbolic names for different blkid exit codes
Petr Uzel [Wed, 16 May 2012 08:38:32 +0000 (10:38 +0200)] 
blkid: introduce symbolic names for different blkid exit codes

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agoblkid: use symbolic exit code
Petr Uzel [Wed, 16 May 2012 08:38:31 +0000 (10:38 +0200)] 
blkid: use symbolic exit code

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agoMerge branch 'master' of https://github.com/jhuntwork/util-linux
Karel Zak [Wed, 23 May 2012 07:39:40 +0000 (09:39 +0200)] 
Merge branch 'master' of https://github.com/jhuntwork/util-linux

12 years agowdctl: add --oneline
Karel Zak [Tue, 22 May 2012 11:31:46 +0000 (13:31 +0200)] 
wdctl: add --oneline

 * remove --pairs, it was usable for flags table only

 * one line for each watchdog device

For example:

 # wdctl --noident --noflags --oneline
 /dev/watchdog: TIMEOUT="30" TIMELEFT="2"

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/tt: export tt_fputs_{quoted,nonblank} function
Karel Zak [Tue, 22 May 2012 11:27:46 +0000 (13:27 +0200)] 
lib/tt: export tt_fputs_{quoted,nonblank} function

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agowdctl: allow to specify more than one device
Karel Zak [Tue, 22 May 2012 09:39:26 +0000 (11:39 +0200)] 
wdctl: allow to specify more than one device

 * remove -d <device> option

 * support wdctl [options] [<device> ...] usage

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologin: fix segmentation fault in log_utmp
Karel Zak [Mon, 21 May 2012 07:58:42 +0000 (09:58 +0200)] 
login: fix segmentation fault in log_utmp

 ctx->tty_number is optional...

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=822705
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agowdctl: add --flags-only and optional column DEVICE
Karel Zak [Fri, 18 May 2012 13:08:31 +0000 (15:08 +0200)] 
wdctl: add --flags-only and optional column DEVICE

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoeject: allow to address device by LABEL/UUID
Karel Zak [Fri, 18 May 2012 10:01:10 +0000 (12:01 +0200)] 
eject: allow to address device by LABEL/UUID

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: don't canonicalize target
Karel Zak [Thu, 17 May 2012 10:10:43 +0000 (12:10 +0200)] 
libmount: don't canonicalize target

Note that mountpoint (target_ paths in /proc/mounts and /proc/self/mountinfo
are always canonicalized by kernel.

 * for umount we don't have to canonicalize target
   by default if the mountpoint is found in /proc/self/mountinfo

 * in mnt_table_find_target() is unnecessary to canonicalize target paths
   if the table of the filesystems is read from /proc/self/mountinfo

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=820707
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotext-utils: cleanup strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:46:20 +0000 (17:46 +0200)] 
text-utils: cleanup strtoxx_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoterm-utils: cleanup strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:46:05 +0000 (17:46 +0200)] 
term-utils: cleanup strtoxx_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosys-utils: cleanup strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:45:17 +0000 (17:45 +0200)] 
sys-utils: cleanup strtoxx_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoschedutils: cleanup strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:45:05 +0000 (17:45 +0200)] 
schedutils: cleanup strtoxx_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agopartx: cleanup strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:44:51 +0000 (17:44 +0200)] 
partx: cleanup strtoxx_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomisc-utils: cleanup strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:44:37 +0000 (17:44 +0200)] 
misc-utils: cleanup strtoxx_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: cleanup strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:44:19 +0000 (17:44 +0200)] 
sulogin: cleanup strtoxx_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agohwclock: cleanup strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:44:02 +0000 (17:44 +0200)] 
hwclock: cleanup strtoxx_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: cleanup strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:43:49 +0000 (17:43 +0200)] 
fdisk: cleanup strtoxx_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodisk-utils: cleanup strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:43:32 +0000 (17:43 +0200)] 
disk-utils: cleanup strtoxx_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/strutils: create type specific strtoxx_or_err()
Karel Zak [Tue, 15 May 2012 15:40:03 +0000 (17:40 +0200)] 
lib/strutils: create type specific strtoxx_or_err()

We need [un]signed int ([u]int32_t) on many places. It's also more
readable and robust to use uintXX_t types than for example "long long".

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/ttyutils: more robust get_terminal_width()
Karel Zak [Tue, 15 May 2012 09:58:20 +0000 (11:58 +0200)] 
include/ttyutils: more robust get_terminal_width()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoblkid: use get_terminal_width() from ttyutils.h
Petr Uzel [Tue, 15 May 2012 08:49:04 +0000 (10:49 +0200)] 
blkid: use get_terminal_width() from ttyutils.h

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agoinclude: move get_terminal_width() to ttyutils.h
Petr Uzel [Tue, 15 May 2012 08:49:03 +0000 (10:49 +0200)] 
include: move get_terminal_width() to ttyutils.h

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolibuuid: move read_all to include/all-io.h
Petr Uzel [Tue, 15 May 2012 08:49:02 +0000 (10:49 +0200)] 
libuuid: move read_all to include/all-io.h

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agoinclude: rename writeall.h to all-io.h
Petr Uzel [Tue, 15 May 2012 08:49:01 +0000 (10:49 +0200)] 
include: rename writeall.h to all-io.h

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolib/mangle: check for end of string on every iteration
Dave Reisner [Sun, 13 May 2012 19:14:49 +0000 (15:14 -0400)] 
lib/mangle: check for end of string on every iteration

Checking for the null byte at the end of the string only conditionally
leads to segfaults, evidenced by mount helpers crashing on writes to
/run/mount/utab. Simply check for the null on each iteration, and append
a null byte to the mangled string before breaking.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agorev: mention tac(1) in 'SEE ALSO' man page section
Petr Uzel [Sun, 13 May 2012 11:57:46 +0000 (13:57 +0200)] 
rev: mention tac(1) in 'SEE ALSO' man page section

Cc: James R. Van Zandt <jrv@debian.org>
From: James R. Van Zandt <jrv@debian.org>
Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568709
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agomkswap: improve diagnostics message if the device is mounted
Petr Uzel [Sun, 13 May 2012 11:44:32 +0000 (13:44 +0200)] 
mkswap: improve diagnostics message if the device is mounted

Currently, attempt to create swap on mounted partition results
with "/dev/sdXy: Device or resource busy" message being printed.
Change this to explicitly telling the user that the device is mounted.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agomkswap: allow creating swap on /dev/hd[ab]
Petr Uzel [Sun, 13 May 2012 11:44:31 +0000 (13:44 +0200)] 
mkswap: allow creating swap on /dev/hd[ab]

Currently, mkswap does not allow swap to be created on /dev/hda and
/dev/hdb. There is no reason why /dev/hda and /dev/hdb should be treated
differently.

Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=491021
Cc: Russell Coker <russell@coker.com.au>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agomkswap: use is_mounted() instead of check_mount()
Petr Uzel [Sun, 13 May 2012 11:44:30 +0000 (13:44 +0200)] 
mkswap: use is_mounted() instead of check_mount()

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolsblk: improve man page wording
Petr Uzel [Sun, 13 May 2012 09:08:20 +0000 (11:08 +0200)] 
lsblk: improve man page wording

Cc: Regid Ichira <regid23@yahoo.com>
From: Regid Ichira <regid23@yahoo.com>
Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672702
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agoUse POSIX regcomp and regexec over obsolete BSD re_comp and re_exec
Jeremy Huntwork [Sun, 13 May 2012 17:28:32 +0000 (17:28 +0000)] 
Use POSIX regcomp and regexec over obsolete BSD re_comp and re_exec

12 years agoRemove use of __P. Its intended usage was to support pre-ANSI C compilers, but that...
Jeremy Huntwork [Sun, 13 May 2012 16:31:48 +0000 (16:31 +0000)] 
Remove use of __P. Its intended usage was to support pre-ANSI C compilers, but that is not even possible with the modern-day codebase. Moreover, it breaks compiling on libcs that do not define this legacy implementation-internal macro.

12 years agotests: update fdisk test
Karel Zak [Thu, 10 May 2012 09:58:32 +0000 (11:58 +0200)] 
tests: update fdisk test

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibuuid: avoid double open and leaking fd (reworked)
Petr Uzel [Sun, 6 May 2012 19:55:53 +0000 (21:55 +0200)] 
libuuid: avoid double open and leaking fd (reworked)

This reverts commit 6126f7a53c57485a9a29ddd772765695f23c92e6
and fixes the double open and leaking descriptor in a different way,
that is by using newly introduced function 'have_random_source()'
to check whether good random source is available while deciding
which uuid type to generate (random/time).

This is better than calling random_get_fd() twice, passing the file
descriptor down the stack and reusing it in next call to
random_get_fd().

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolslocks: fix bracket indentation
Davidlohr Bueso [Sun, 6 May 2012 19:06:01 +0000 (21:06 +0200)] 
lslocks: fix bracket indentation

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: sgi: abort on HDIO_GETGEO failure
Davidlohr Bueso [Sun, 6 May 2012 12:10:25 +0000 (14:10 +0200)] 
fdisk: sgi: abort on HDIO_GETGEO failure

When the HDIO_GETGEO ioctl fails on non IRIX/MIPS platforms (ie: inappropriate
ioctl for device) the variables that describe the geometry are compromissed.
One clear example is a division by 0 bug because the cylinder size is 0 is
verify_sgi():

$> fdisk sgi.img
Welcome to fdisk (util-linux 2.21.392-4b1c).

...

Command (m for help): x

Expert command (m for help): g
Building a new SGI disklabel.
Partition 11 of type SGI volume and of size 7.9 MiB is set
Floating point exception

Fix this by simply exiting the program instead of leaving it in a vulnerable
state.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: remove unused function declaration
Davidlohr Bueso [Sun, 6 May 2012 12:10:23 +0000 (14:10 +0200)] 
fdisk: remove unused function declaration

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: create DOS specific write table function
Davidlohr Bueso [Sun, 6 May 2012 19:02:45 +0000 (21:02 +0200)] 
fdisk: create DOS specific write table function

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: move DOS new/add partition code
Davidlohr Bueso [Sun, 6 May 2012 12:10:18 +0000 (14:10 +0200)] 
fdisk: move DOS new/add partition code

Since this is DOS specific logic, it belongs in its own label file.
Additionally, a dos_new_partition() function is created that asks the user for
partition type and then calls the actual dos_add_partition().

This patch passed fdisk regression tests, builds without problems and it was
locally tested against adding and removing DOS partitions.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: remove unused hsc2sector macro
Davidlohr Bueso [Sun, 6 May 2012 18:53:14 +0000 (20:53 +0200)] 
fdisk: remove unused hsc2sector macro

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: fix segfault on bsd label
Davidlohr Bueso [Fri, 4 May 2012 11:35:32 +0000 (13:35 +0200)] 
fdisk: fix segfault on bsd label

Commit 8db8295d824cd0c8cba9385e4635d6e311d69d3f added a regression that causes the program to crash when
touching the partition structure (pte) for BSD/OSF labels. Since DOS has its own initialization function,
allow BSD labels to use it as well.

Steps to reproduce:

$> fdisk bsd.img (obtained from blkid regression test files)
Command (m for help): p
...
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Segmentation fault

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agouuidd: remove unnecessary variables
Karel Zak [Fri, 4 May 2012 14:20:04 +0000 (16:20 +0200)] 
uuidd: remove unnecessary variables

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibuuid: avoid double open and leaking descriptor
Petr Uzel [Thu, 3 May 2012 19:02:01 +0000 (21:02 +0200)] 
libuuid: avoid double open and leaking descriptor

We are opening /dev/urandom twice in uuid_generate(): first to check if
the file is available and then later __uuid_generate_random() again to
actually get the random data. Moreover, descriptor from the first open
is leaking.

Fix by passign the descriptor down the stack and reusing it there.

References: http://marc.info/?l=util-linux-ng&m=133406051131131&w=2

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: introduce uuidd_cxt to pass arguments to server loop
Petr Uzel [Thu, 3 May 2012 19:02:00 +0000 (21:02 +0200)] 
uuidd: introduce uuidd_cxt to pass arguments to server loop

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolibuuid: don't exec uuidd
Petr Uzel [Thu, 3 May 2012 19:01:59 +0000 (21:01 +0200)] 
libuuid: don't exec uuidd

Executing the daemon from the shared library is not quite elegant
solution. Drop this functionality and require uuidd (should it be
needed) to be started from the initscript or by socket-activation.

References: http://www.spinics.net/lists/util-linux-ng/msg05967.html

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: add systemd unit files
Petr Uzel [Thu, 3 May 2012 19:01:58 +0000 (21:01 +0200)] 
uuidd: add systemd unit files

Add systemd unit files which use the socket activation mechanism
of systemd. The uuidd deamon is started upon first request on the
socket and quits after 1 minute of inactivity.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolibuuid: use EXIT_FAILURE
Petr Uzel [Thu, 3 May 2012 19:01:57 +0000 (21:01 +0200)] 
libuuid: use EXIT_FAILURE

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: do not drop privileges
Petr Uzel [Thu, 3 May 2012 19:01:56 +0000 (21:01 +0200)] 
uuidd: do not drop privileges

libuuid can (for now) spawn uuidd on-demand. To support this scenario,
uuidd should be installed setuid/setgid to have access to
/var/lib/libuuid/clock.txt. Therefore, dropping the privileges is
not functional, so removing this ability.

Moreover, the ability to spawn uuidd on-demand will be removed anyway.

References: http://www.spinics.net/lists/util-linux-ng/msg05934.html

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: print all debugging information to stderr
Petr Uzel [Thu, 3 May 2012 19:01:55 +0000 (21:01 +0200)] 
uuidd: print all debugging information to stderr

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: implement --socket-activation option
Petr Uzel [Thu, 3 May 2012 19:01:54 +0000 (21:01 +0200)] 
uuidd: implement --socket-activation option

Implement --socket-activation option, which is supposed to be used
with systemd (or equivalent init system) socket activation mechanism.
With this option, the UUID daemon does not create the socket on its own,
but instead expect the connection fd to be provided by the calling
process.

This option is only available if util-linux is configured with
--enable-socket-activation option. With this configure
option, the uuidd is compiled with sd-daemon.c.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: factor out socket creation into separate function
Petr Uzel [Thu, 3 May 2012 19:01:53 +0000 (21:01 +0200)] 
uuidd: factor out socket creation into separate function

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: implement --no-fork option
Petr Uzel [Thu, 3 May 2012 19:01:52 +0000 (21:01 +0200)] 
uuidd: implement --no-fork option

With this option, uuidd does not daemonize itself but stays
in the foreground.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: use ignore_result helper
Petr Uzel [Thu, 3 May 2012 19:01:51 +0000 (21:01 +0200)] 
uuidd: use ignore_result helper

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: implement --no-pid option
Petr Uzel [Thu, 3 May 2012 19:01:50 +0000 (21:01 +0200)] 
uuidd: implement --no-pid option

With this option, uuidd does not create the PID file.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: factor out pidfile creation into separate function
Petr Uzel [Thu, 3 May 2012 19:01:49 +0000 (21:01 +0200)] 
uuidd: factor out pidfile creation into separate function

Introduce create_pidfile() function.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: remove useless initialization of cleanup_socket
Petr Uzel [Thu, 3 May 2012 19:01:48 +0000 (21:01 +0200)] 
uuidd: remove useless initialization of cleanup_socket

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agouuidd: use UUIDD_OP_GETPID instead of magic number
Petr Uzel [Thu, 3 May 2012 19:01:47 +0000 (21:01 +0200)] 
uuidd: use UUIDD_OP_GETPID instead of magic number

Make parameters passed to call_daemon() more descriptive:
- use UUIDD_OP_GETPID instead of magic number 0
- call_daemon() takes pointer as a last argument, so pass NULL instead
  of 0

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolibblkid: support UFS UUID
Vladimir 'φ-coder/phcoder' Serbinenko [Fri, 4 May 2012 09:49:16 +0000 (11:49 +0200)] 
libblkid: support UFS UUID

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: accept small blocks for NTFS and Reiserfs in blkid
Vladimir 'φ-coder/phcoder' Serbinenko [Fri, 4 May 2012 09:48:07 +0000 (11:48 +0200)] 
libblkid: accept small blocks for NTFS and Reiserfs in blkid

libblkid is restrictive as to what it accepts as valid reiserfs or
valid NTFS.  One can mkfs an NTFS with 256B sectors and it's supported
by ntfs-3g Reiserfs can have 512B blocks and it works both with
mkfs.ntfs and Linux.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: add BUILD_WDCTL, check for linux/watchdog.h
Karel Zak [Fri, 4 May 2012 09:45:35 +0000 (11:45 +0200)] 
build-sys: add BUILD_WDCTL, check for linux/watchdog.h

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agowdctl: add man page
Karel Zak [Fri, 4 May 2012 09:04:35 +0000 (11:04 +0200)] 
wdctl: add man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agowdctl: make timeouts output more parsable
Karel Zak [Fri, 4 May 2012 09:02:47 +0000 (11:02 +0200)] 
wdctl: make timeouts output more parsable

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agowdctl: rewrite to use lib/tt
Karel Zak [Thu, 3 May 2012 15:29:31 +0000 (17:29 +0200)] 
wdctl: rewrite to use lib/tt

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/strutils: add string_to_bitmask()
Karel Zak [Thu, 3 May 2012 15:28:44 +0000 (17:28 +0200)] 
lib/strutils: add string_to_bitmask()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: fix /sys/.../ro usage
Karel Zak [Thu, 3 May 2012 14:24:12 +0000 (16:24 +0200)] 
lsblk: fix /sys/.../ro usage

Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslock: remove duplicate variable
Karel Zak [Thu, 3 May 2012 10:19:52 +0000 (12:19 +0200)] 
lslock: remove duplicate variable

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/tt: remove obsolete stuff
Karel Zak [Thu, 3 May 2012 10:13:29 +0000 (12:13 +0200)] 
include/tt: remove obsolete stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agowdctl: align with other util-linux commands
Sami Kerola [Thu, 19 Apr 2012 19:10:54 +0000 (21:10 +0200)] 
wdctl: align with other util-linux commands

* Add watchdog device path to pathnames.h
* Check output stream status at exit.
* Adjust usage() notation to follow howto file.
* Retire numeric return value.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agofdisk: fix fdiskdoslabel.c global variables
Karel Zak [Wed, 2 May 2012 12:05:51 +0000 (14:05 +0200)] 
fdisk: fix fdiskdoslabel.c global variables

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: isolate dos label logic
Davidlohr Bueso [Sat, 28 Apr 2012 22:02:45 +0000 (00:02 +0200)] 
fdisk: isolate dos label logic

DOS specific logic is currently embedded in the heart of fdisk code. This patch
separates DOS label specific code into its own file, just like the rest of the
labels, leaving a more generic fdisk.c file. Most changes are just moving code
from fdisk.c to fdisk.h and fdiskdoslabel.[c/h].

The only logical modification is calling dos_delete_partition() from
read_extended(), instead of the generic delete_partition.  This is ok since
read extended is only called from a DOS context.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agoMerge branch '2012wk17' of https://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Wed, 2 May 2012 07:34:39 +0000 (09:34 +0200)] 
Merge branch '2012wk17' of https://github.com/kerolasa/lelux-utiliteetit

* '2012wk17' of https://github.com/kerolasa/lelux-utiliteetit:
  build-sys: determine availability of __fpending()

12 years agofdisk: remove dummy function
Davidlohr Bueso [Fri, 27 Apr 2012 11:23:56 +0000 (13:23 +0200)] 
fdisk: remove dummy function

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: rework fatal errors
Davidlohr Bueso [Fri, 27 Apr 2012 11:23:51 +0000 (13:23 +0200)] 
fdisk: rework fatal errors

When the device cannot be opened, there's no point calling fatal() when we can
just use err(3). When any other kind of fatal error occurs it's Ok, in addition
we can also go ahead and close the descriptor before exiting the program as
it's currently leaking.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: remove listing variable
Davidlohr Bueso [Fri, 27 Apr 2012 11:23:47 +0000 (13:23 +0200)] 
fdisk: remove listing variable

useless global variable.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: remove stack jumping
Davidlohr Bueso [Fri, 27 Apr 2012 11:23:42 +0000 (13:23 +0200)] 
fdisk: remove stack jumping

This patch eliminates the long/setjmp code. The current logic does not do
anything with stack jumps as it only exits from
print_partition_table_from_option() when a fatal error occurs.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofindmnt: restrict within-device matching
Karel Zak [Fri, 27 Apr 2012 12:06:20 +0000 (14:06 +0200)] 
findmnt: restrict within-device matching

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: fix further typos found by misspellings
Bernhard Voelker [Tue, 24 Apr 2012 07:57:30 +0000 (09:57 +0200)] 
docs: fix further typos found by misspellings

Additionally to the fixes in commit v2.21-325-g455fe9a,
fix typos in release notes and NEWS.

Signed-off-by: Bernhard Voelker <mail@...>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: fix compiler warnings [-Wuninitialized]
Petr Uzel [Tue, 24 Apr 2012 08:21:01 +0000 (10:21 +0200)] 
findmnt: fix compiler warnings [-Wuninitialized]

findmnt.c:333:29: error: ‘vfs_attr’ may be used uninitialized in this function [-Werror=uninitialized]
findmnt.c:307:11: note: ‘vfs_attr’ was declared here

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agosfdisk: fix compiler warning [-Wunused-result]
Petr Uzel [Tue, 24 Apr 2012 08:21:00 +0000 (10:21 +0200)] 
sfdisk: fix compiler warning [-Wunused-result]

sfdisk.c: In function ‘do_fdisk’:
sfdisk.c:3212:11: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agofsck.minix.c: fix compiler warnings [-Wunused-result]
Petr Uzel [Tue, 24 Apr 2012 08:20:59 +0000 (10:20 +0200)] 
fsck.minix.c: fix compiler warnings [-Wunused-result]

fsck.minix.c: In function ‘ask’:
fsck.minix.c:263:7: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolibuuid: fix typo in uuid_compare manpage
Petr Uzel [Tue, 24 Apr 2012 08:20:58 +0000 (10:20 +0200)] 
libuuid: fix typo in uuid_compare manpage

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agobuild-sys: add fsprobe.h to dist
Petr Uzel [Tue, 24 Apr 2012 08:20:57 +0000 (10:20 +0200)] 
build-sys: add fsprobe.h to dist

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agobuild-sys: add swapon-common.h to swapon sources (fix distcheck)
Petr Uzel [Tue, 24 Apr 2012 08:20:56 +0000 (10:20 +0200)] 
build-sys: add swapon-common.h to swapon sources (fix distcheck)

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agobuild-sys: add ttyutils.h to dist
Petr Uzel [Tue, 24 Apr 2012 08:20:55 +0000 (10:20 +0200)] 
build-sys: add ttyutils.h to dist

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agobuild-sys: add randutils.h to dist
Petr Uzel [Tue, 24 Apr 2012 08:20:54 +0000 (10:20 +0200)] 
build-sys: add randutils.h to dist

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agobuild-sys: run distcheck with verbose make rules
Petr Uzel [Tue, 24 Apr 2012 08:20:53 +0000 (10:20 +0200)] 
build-sys: run distcheck with verbose make rules

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolibmount: close device fd (to avoid mount(2) EBUSY)
Karel Zak [Fri, 27 Apr 2012 08:30:08 +0000 (10:30 +0200)] 
libmount: close device fd (to avoid mount(2) EBUSY)

libmount uses libblkid to detect filesystem type. Unfortunately, the
blkid probe struct is not freed before mount(2), it means that the
device is still open and mount(2) may return EBUSY.

We don't need persistent blkid stuff in libmount, so let's close
all immediately after device probing.

Reported-by: David Zeuthen <zeuthen@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: add match_by_file to do within-device matching
Dave Reisner [Thu, 26 Apr 2012 00:30:52 +0000 (20:30 -0400)] 
findmnt: add match_by_file to do within-device matching

Use the newly exported mnt_get_mountpoint to determine the device that a
given file resides on, in case the supplied source or target is not
explicitly a mount point.

http://www.spinics.net/lists/util-linux-ng/msg06081.html

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agolibmount: expose mnt_get_mountpoint as external API
Dave Reisner [Thu, 26 Apr 2012 00:30:51 +0000 (20:30 -0400)] 
libmount: expose mnt_get_mountpoint as external API

12 years agolib/tt: check for non-printable chars for raw/export format
Karel Zak [Thu, 26 Apr 2012 07:28:44 +0000 (09:28 +0200)] 
lib/tt: check for non-printable chars for raw/export format

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/tt: encode data for RAW and EXPORT format
Karel Zak [Thu, 26 Apr 2012 07:22:19 +0000 (09:22 +0200)] 
lib/tt: encode data for RAW and EXPORT format

 * all tt based utils will properly encode blank chars for raw output
   format and quotes for export output format

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: remove private \x<hex> coding, decode data from udev
Karel Zak [Thu, 26 Apr 2012 07:19:36 +0000 (09:19 +0200)] 
lsblk: remove private \x<hex> coding, decode data from udev

 * remove private encoding code (all encoding will be in lib/tt.c)
 * decode LABELs from udev

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: add note about \x<hex> to man page
Karel Zak [Thu, 26 Apr 2012 07:19:07 +0000 (09:19 +0200)] 
findmnt: add note about \x<hex> to man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/mangle: cleanup, add unhexmangle
Karel Zak [Thu, 26 Apr 2012 07:17:44 +0000 (09:17 +0200)] 
lib/mangle: cleanup, add unhexmangle

 * use strchr() rather than for()
 * small refactoring in mangle code
 * add un-hex-mangle

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: add support for maj:min source
Karel Zak [Wed, 25 Apr 2012 07:51:26 +0000 (09:51 +0200)] 
findmnt: add support for maj:min source

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: add mnt_table_find_devno()
Karel Zak [Wed, 25 Apr 2012 07:49:50 +0000 (09:49 +0200)] 
libmount: add mnt_table_find_devno()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: fix mnt_context_guess_fstype()
Karel Zak [Wed, 25 Apr 2012 07:05:24 +0000 (09:05 +0200)] 
libmount: fix mnt_context_guess_fstype()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: (new) use MNT_ERR_ for error messages
Karel Zak [Tue, 24 Apr 2012 09:59:18 +0000 (11:59 +0200)] 
mount: (new) use MNT_ERR_ for error messages

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