]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agobuild-sys: move hwclock to sys-utils/
Karel Zak [Thu, 31 May 2012 09:15:07 +0000 (11:15 +0200)] 
build-sys: move hwclock to sys-utils/

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert sys-utils/ to module
Karel Zak [Tue, 26 Jun 2012 16:06:21 +0000 (18:06 +0200)] 
build-sys: convert sys-utils/ to module

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotools: cleanup config-gen.d
Karel Zak [Thu, 31 May 2012 08:55:14 +0000 (10:55 +0200)] 
tools: cleanup config-gen.d

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: cleanup mount stuff in configure.am
Karel Zak [Thu, 31 May 2012 08:03:35 +0000 (10:03 +0200)] 
build-sys: cleanup mount stuff in configure.am

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: add UL_CONFLICTS_BUILD m4 macro
Karel Zak [Thu, 31 May 2012 08:02:52 +0000 (10:02 +0200)] 
build-sys: add UL_CONFLICTS_BUILD m4 macro

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: (old) remove hybrid libmount code
Karel Zak [Wed, 30 May 2012 15:36:44 +0000 (17:36 +0200)] 
mount: (old) remove hybrid libmount code

The hybrid version with old mount and new mtab management from
libmount is not more supported.

Only two versions are supported:

  1/ old mount in mount-deprecated/, --enable-deprecated-mount

  2/ new sys-utils/mount.c, enabled by default

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: default to new sys-utils/mount.c, add --enable-deprecated-mount
Karel Zak [Wed, 30 May 2012 15:29:01 +0000 (17:29 +0200)] 
build-sys: default to new sys-utils/mount.c, add --enable-deprecated-mount

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: (old) remove mtab lock test
Karel Zak [Wed, 30 May 2012 15:17:49 +0000 (17:17 +0200)] 
mount: (old) remove mtab lock test

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert mount/ to module, rename to mount-deprecated/
Karel Zak [Wed, 30 May 2012 15:16:11 +0000 (17:16 +0200)] 
build-sys: convert mount/ to module, rename to mount-deprecated/

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert login-utils/ to module
Karel Zak [Wed, 30 May 2012 14:10:11 +0000 (16:10 +0200)] 
build-sys: convert login-utils/ to module

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert term-utils/ to module
Karel Zak [Tue, 26 Jun 2012 15:53:09 +0000 (17:53 +0200)] 
build-sys: convert term-utils/ to module

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert text-utils/ to module
Karel Zak [Wed, 30 May 2012 13:02:33 +0000 (15:02 +0200)] 
build-sys: convert text-utils/ to module

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert libmount/ to module
Karel Zak [Tue, 26 Jun 2012 15:49:37 +0000 (17:49 +0200)] 
build-sys: convert libmount/ to module

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert libblkid/ to module
Karel Zak [Tue, 26 Jun 2012 15:44:15 +0000 (17:44 +0200)] 
build-sys: convert libblkid/ to module

 - create module
 - remove unused libblkid/src/tst_types.c test

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert libuuid/ to module
Karel Zak [Wed, 23 May 2012 07:37:38 +0000 (09:37 +0200)] 
build-sys: convert libuuid/ to module

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert schedutils/ to module
Karel Zak [Tue, 22 May 2012 13:57:23 +0000 (15:57 +0200)] 
build-sys: convert schedutils/ to module

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: define per-test -DTEST_PROGRAM in lib/
Karel Zak [Tue, 22 May 2012 13:56:29 +0000 (15:56 +0200)] 
build-sys: define per-test -DTEST_PROGRAM in lib/

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert lib/ to module
Karel Zak [Wed, 16 May 2012 22:54:26 +0000 (00:54 +0200)] 
build-sys: convert lib/ to module

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: convert include/ to module
Karel Zak [Wed, 16 May 2012 13:05:11 +0000 (15:05 +0200)] 
build-sys: convert include/ to module

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-system: enable automake subdir-objects
Karel Zak [Wed, 16 May 2012 13:02:27 +0000 (15:02 +0200)] 
build-system: enable automake subdir-objects

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: ignore .dirstamp file
Karel Zak [Wed, 16 May 2012 12:37:28 +0000 (14:37 +0200)] 
build-sys: ignore .dirstamp file

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agowhereis: cleanup man page, add note about $PATH
Karel Zak [Tue, 26 Jun 2012 07:53:51 +0000 (09:53 +0200)] 
whereis: cleanup man page, add note about $PATH

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=835211
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotunelp: check fstat return code [coverity scan]
Karel Zak [Thu, 21 Jun 2012 11:11:08 +0000 (13:11 +0200)] 
tunelp: check fstat return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: check sysfs_read_u64 return code [coverity scan]
Karel Zak [Thu, 21 Jun 2012 11:08:18 +0000 (13:08 +0200)] 
lsblk: check sysfs_read_u64 return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoswaplabel: check blkid_probe_lookup_value() result [coverity scan]
Karel Zak [Thu, 21 Jun 2012 10:54:31 +0000 (12:54 +0200)] 
swaplabel: check blkid_probe_lookup_value() result [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoscript: remove unused code
Karel Zak [Thu, 21 Jun 2012 10:14:34 +0000 (12:14 +0200)] 
script: remove unused code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoagetty: more robust debug() macro, check ioctl result [coverity scan]
Karel Zak [Thu, 21 Jun 2012 10:03:27 +0000 (12:03 +0200)] 
agetty: more robust debug() macro, check ioctl result [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: check ioctl result [coverity scan]
Karel Zak [Thu, 21 Jun 2012 09:58:39 +0000 (11:58 +0200)] 
lsblk: check ioctl result [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add lscpu test for box with 64 CPUs
Karel Zak [Thu, 21 Jun 2012 09:35:45 +0000 (11:35 +0200)] 
tests: add lscpu test for box with 64 CPUs

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                64
On-line CPU(s) list:   0-63
Thread(s) per core:    2
Core(s) per socket:    8
Socket(s):             4
Vendor ID:             GenuineIntel
...

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/loopdev: use warn_unused_result forimportant functions
Karel Zak [Thu, 21 Jun 2012 08:40:43 +0000 (10:40 +0200)] 
lib/loopdev: use warn_unused_result forimportant functions

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/sysfs: use warn_unused_result for sysfs_init()
Karel Zak [Thu, 21 Jun 2012 06:28:49 +0000 (08:28 +0200)] 
lib/sysfs: use warn_unused_result for sysfs_init()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/mangle: fix a memory leak in the test case
Cong Wang [Wed, 20 Jun 2012 08:42:05 +0000 (16:42 +0800)] 
lib/mangle: fix a memory leak in the test case

Marek reported there is a memory leak in lib/mangle.c

  CC       mangle.o
mangle.c:160:9: warning: Memory is never released; potential leak of memory pointed to by 'ss'

This patch fixes it.

Reported-by: Marek Otahal <markotahal@gmail.com>
Cc: Karel Zak <kzak@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
12 years agolib/sysfs: check if cxt->dir_path is NULL in sysfs_readlink()
Cong Wang [Wed, 20 Jun 2012 08:32:00 +0000 (16:32 +0800)] 
lib/sysfs: check if cxt->dir_path is NULL in sysfs_readlink()

cxt->dir_path could be NULL, for example, when sysfs_init() fails,
check this before calling readlink()/readlink_at().

Cc: Karel Zak <kzak@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
12 years agofdisk: add some debug messages
Karel Zak [Thu, 21 Jun 2012 06:17:50 +0000 (08:17 +0200)] 
fdisk: add some debug messages

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: use memset() rather than bzero()
Karel Zak [Thu, 21 Jun 2012 06:09:45 +0000 (08:09 +0200)] 
fdisk: use memset() rather than bzero()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: API: add geometry
Davidlohr Bueso [Sun, 17 Jun 2012 16:10:33 +0000 (18:10 +0200)] 
fdisk: API: add geometry

Add device geometry to the fdisk API. While it maintains traditional behaviour, the cylinders
are changed to sector_t instead of unsigned int in order to avoid dealing with truncated cylinders.
A new helper is added to compute the amount of cylinders based on the heads and sectors - if a user passed
-H or -S to the program, it must call this function to update the corresponding values.

This patch passes regression tests.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: mark dos compatibility/CHS options deprecated in manpage
Davidlohr Bueso [Sun, 17 Jun 2012 16:10:28 +0000 (18:10 +0200)] 
fdisk: mark dos compatibility/CHS options deprecated in manpage

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: sun: remove unused function
Davidlohr Bueso [Sun, 17 Jun 2012 16:10:26 +0000 (18:10 +0200)] 
fdisk: sun: remove unused function

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: sgi: remove unused function
Davidlohr Bueso [Sun, 17 Jun 2012 16:10:22 +0000 (18:10 +0200)] 
fdisk: sgi: remove unused function

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: sgi: remove unused code
Davidlohr Bueso [Sun, 17 Jun 2012 16:10:15 +0000 (18:10 +0200)] 
fdisk: sgi: remove unused code

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: tests: update oddinput test
Davidlohr Bueso [Sun, 17 Jun 2012 16:10:11 +0000 (18:10 +0200)] 
fdisk: tests: update oddinput test

Adding mbr to the API breaks this test, specifically when reading the first 512 bytes
of the MBR, update the expected output for oddinput.toosmall. Also let the test create
and remove the test file instead of having it in the expected directory.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: API: add mbr
Davidlohr Bueso [Sun, 17 Jun 2012 16:10:07 +0000 (18:10 +0200)] 
fdisk: API: add mbr

This patch adds to the fdisk API the relevant logic to buffers that have MBR. This also serves for
future GPT support for the protective MBR. All labels have been updated to have access to the cxt
structure for the corresponding buffer.

An important observation is that SGI no longer uses the standard qsort(3) function to sort partitions,
as it needs access to cxt. To address this, a heap sort implementation from the kernel was added to
the label code and adapted to fdisk.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: API: add topology debug
Davidlohr Bueso [Sun, 17 Jun 2012 16:10:04 +0000 (18:10 +0200)] 
fdisk: API: add topology debug

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: extend comments for fdisk_new_context()
Davidlohr Bueso [Sun, 17 Jun 2012 16:09:59 +0000 (18:09 +0200)] 
fdisk: extend comments for fdisk_new_context()

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agolsblk: fix usage, improve exclude/include lists parsing
Karel Zak [Tue, 19 Jun 2012 15:41:35 +0000 (17:41 +0200)] 
lsblk: fix usage, improve exclude/include lists parsing

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: improve ifdef HAVE_LIBSELINUX stuff
Karel Zak [Tue, 19 Jun 2012 14:19:18 +0000 (16:19 +0200)] 
libmount: improve ifdef HAVE_LIBSELINUX stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: add --include option
Karel Zak [Tue, 19 Jun 2012 14:06:22 +0000 (16:06 +0200)] 
lsblk: add --include option

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolscpu: fix compiler warning [-Wsign-compare]
Karel Zak [Tue, 19 Jun 2012 11:14:20 +0000 (13:14 +0200)] 
lscpu: fix compiler warning [-Wsign-compare]

lscpu.c: In function â€˜has_pci_device’:
lscpu.c:425:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
lscpu.c:425:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoMerge branch '2012wk24' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Tue, 19 Jun 2012 11:01:29 +0000 (13:01 +0200)] 
Merge branch '2012wk24' of git://github.com/kerolasa/lelux-utiliteetit

* '2012wk24' of git://github.com/kerolasa/lelux-utiliteetit: (24 commits)
  more: fix pointer wrap around compiler warnings
  more: fix search repetition regression
  lscpu: values in /proc/bus/pci/devices are always unsigned
  scriptreplay: fix compiler format warning
  lib/mbsalign: abort() when non-expected case is encountered
  mkfs.cramfs: disallow unknown command line options
  fsck.cramfs: disallow unknown command line options
  setarch: disallow unknown command line options
  hexdump: print sensible message when all input file arguments fail
  mount: (new) use exclusive_option()
  dmesg: use exclusive_option()
  wipefs: use exclusive_option()
  wdctl: correct manual section reference
  wdctl: use exclusive_option()
  prlimit: use exclusive_option()
  lscpu: use exclusive_option()
  losetup: use exclusive_option()
  chcpu: use exclusive_option()
  lsblk: use exclusive_option()
  findmnt: use exclusive_option()
  ...

12 years agopo: add *.h stuff to POTFILES
Karel Zak [Tue, 19 Jun 2012 10:50:10 +0000 (12:50 +0200)] 
po: add *.h stuff to POTFILES

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: (new) add note about unsupported 'ignore' fstype to fstab.5
Karel Zak [Tue, 19 Jun 2012 10:04:03 +0000 (12:04 +0200)] 
mount: (new) add note about unsupported 'ignore' fstype to fstab.5

Reported-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: permit option --exclude more than once
Bernhard Voelker [Fri, 15 Jun 2012 13:40:35 +0000 (15:40 +0200)] 
lsblk: permit option --exclude more than once

Previously, `lsblk -e 8 -e 11` did not exlude maj:8 as requested.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agouuidd: move from /var/run/uuidd to /run/uuidd
Karel Zak [Mon, 18 Jun 2012 13:46:20 +0000 (15:46 +0200)] 
uuidd: move from /var/run/uuidd to /run/uuidd

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibuuid: move clock.txt path to header file
Karel Zak [Mon, 18 Jun 2012 13:36:00 +0000 (15:36 +0200)] 
libuuid: move clock.txt path to header file

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomore: fix pointer wrap around compiler warnings
Sami Kerola [Sun, 17 Jun 2012 13:01:34 +0000 (15:01 +0200)] 
more: fix pointer wrap around compiler warnings

more.c:318:5: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
more.c:362:3: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agomore: fix search repetition regression
Sami Kerola [Sun, 17 Jun 2012 12:34:30 +0000 (14:34 +0200)] 
more: fix search repetition regression

Commit 596007ef6a37b708f44286932eed667b316e5f70 introduced a bug
crashing more always when a text search was repeated with 'n' command.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolscpu: values in /proc/bus/pci/devices are always unsigned
Sami Kerola [Sat, 16 Jun 2012 21:34:30 +0000 (23:34 +0200)] 
lscpu: values in /proc/bus/pci/devices are always unsigned

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoscriptreplay: fix compiler format warning
Sami Kerola [Sat, 16 Jun 2012 21:27:28 +0000 (23:27 +0200)] 
scriptreplay: fix compiler format warning

scriptreplay.c:210:3: warning: format '%zd' expects argument of type 'signed size_t *', but argument 4 has type 'size_t *' [-Wformat]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolib/mbsalign: abort() when non-expected case is encountered
Sami Kerola [Sat, 16 Jun 2012 21:09:54 +0000 (23:09 +0200)] 
lib/mbsalign: abort() when non-expected case is encountered

Fixes the following compiler warning (9 occurrences), and makes program
to crash if mbsaligh() is called with unexpected align value (which
would be programming error).

../lib/mbsalign.c:260:7: warning: switch missing default case [-Wswitch-default]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agomkfs.cramfs: disallow unknown command line options
Sami Kerola [Sat, 16 Jun 2012 21:06:03 +0000 (23:06 +0200)] 
mkfs.cramfs: disallow unknown command line options

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agofsck.cramfs: disallow unknown command line options
Sami Kerola [Sat, 16 Jun 2012 21:05:42 +0000 (23:05 +0200)] 
fsck.cramfs: disallow unknown command line options

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agosetarch: disallow unknown command line options
Sami Kerola [Sat, 16 Jun 2012 20:59:47 +0000 (22:59 +0200)] 
setarch: disallow unknown command line options

Exit with instruction to run --help if unknown option is encountered.
Before the following example printed error, but resulted to an attempt
to run argument.

$ x86_64 -x ls

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agohexdump: print sensible message when all input file arguments fail
Sami Kerola [Sat, 16 Jun 2012 20:30:04 +0000 (22:30 +0200)] 
hexdump: print sensible message when all input file arguments fail

Earlier hexdump printed unnecessary, and perhaps even misleading, 'bad
file descriptor' message.

$ hexdump foobar
hexdump: foobar: No such file or directory
hexdump: foobar: Bad file descriptor

The message is changed to

$ hexdump foobar
hexdump: foobar: No such file or directory
hexdump: all input file arguments failed

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agomount: (new) use exclusive_option()
Sami Kerola [Sat, 16 Jun 2012 09:47:07 +0000 (11:47 +0200)] 
mount: (new) use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodmesg: use exclusive_option()
Sami Kerola [Sat, 16 Jun 2012 09:31:47 +0000 (11:31 +0200)] 
dmesg: use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agowipefs: use exclusive_option()
Sami Kerola [Fri, 15 Jun 2012 22:06:20 +0000 (00:06 +0200)] 
wipefs: use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agowdctl: correct manual section reference
Sami Kerola [Fri, 15 Jun 2012 21:55:19 +0000 (23:55 +0200)] 
wdctl: correct manual section reference

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agowdctl: use exclusive_option()
Sami Kerola [Fri, 15 Jun 2012 21:54:41 +0000 (23:54 +0200)] 
wdctl: use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoprlimit: use exclusive_option()
Sami Kerola [Fri, 15 Jun 2012 21:40:49 +0000 (23:40 +0200)] 
prlimit: use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolscpu: use exclusive_option()
Sami Kerola [Fri, 15 Jun 2012 21:16:21 +0000 (23:16 +0200)] 
lscpu: use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolosetup: use exclusive_option()
Sami Kerola [Fri, 15 Jun 2012 20:56:45 +0000 (22:56 +0200)] 
losetup: use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agochcpu: use exclusive_option()
Sami Kerola [Fri, 15 Jun 2012 15:17:49 +0000 (17:17 +0200)] 
chcpu: use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolsblk: use exclusive_option()
Sami Kerola [Thu, 14 Jun 2012 19:46:16 +0000 (21:46 +0200)] 
lsblk: use exclusive_option()

This commit fixes exclusions which where meant to happen, but where not
successful.  For example

lsblk -r -l # did exclude
lsblk -l -r # did not exclude

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agofindmnt: use exclusive_option()
Sami Kerola [Thu, 14 Jun 2012 19:31:09 +0000 (21:31 +0200)] 
findmnt: use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoblkid: use exclusive_option()
Sami Kerola [Thu, 14 Jun 2012 19:07:28 +0000 (21:07 +0200)] 
blkid: use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agohwclock: use exclusive_option()
Sami Kerola [Thu, 14 Jun 2012 18:58:12 +0000 (20:58 +0200)] 
hwclock: use exclusive_option()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopartx: use exclusive_option()
Sami Kerola [Thu, 14 Jun 2012 18:22:02 +0000 (20:22 +0200)] 
partx: use exclusive_option()

Earlier option combinations such as below behaved unexpected way.

partx -l -l /dev/sda
partx -r -s /dev/sda

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoinclude [optutils]: add exclusive_option() inline function
Sami Kerola [Thu, 14 Jun 2012 18:17:51 +0000 (20:17 +0200)] 
include [optutils]: add exclusive_option() inline function

The exclusive_option() will unify how exclusive options are
determined.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopartx: use -s option for default output
Davidlohr Bueso [Tue, 12 Jun 2012 12:50:06 +0000 (14:50 +0200)] 
partx: use -s option for default output

It's been around a year and a half now that partx was rewritten,
and the legacy output should no longer be default.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agolib/blkdev: return static strings by blkdev_scsi_type_to_name()
Karel Zak [Fri, 15 Jun 2012 11:14:30 +0000 (13:14 +0200)] 
lib/blkdev: return static strings by blkdev_scsi_type_to_name()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: use fallback for TYPE
Karel Zak [Fri, 15 Jun 2012 11:13:40 +0000 (13:13 +0200)] 
lsblk: use fallback for TYPE

 ... bug introduced by 1edd8af70b4794c796d0faed0cf763ff3474b92e

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/blkdev: cleanup up
Karel Zak [Fri, 15 Jun 2012 11:01:51 +0000 (13:01 +0200)] 
include/blkdev: cleanup up

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoMerge branch '2012wk23' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Fri, 15 Jun 2012 10:44:17 +0000 (12:44 +0200)] 
Merge branch '2012wk23' of git://github.com/kerolasa/lelux-utiliteetit

* '2012wk23' of git://github.com/kerolasa/lelux-utiliteetit:
  lsblk: use blkdev_scsi_type_to_name()
  blkdev: add blkdev_scsi_type_to_name()
  wipefs: use symbolic value for markup mode
  eject: inform if CD-ROM drive is not ready
  docs: clean up partx.8 manual
  include: fix void pointer arithmetics warnings
  sysfs: fix printf format warnings
  build: fix unused parameter warnings
  build: fix redundant redeclaration warnings
  include: fix spurious list.h warnings
  uuidd: use output redirection which works [checkbashisms]
  blkid: fix realloc memory leak [cppcheck]
  setarch: do not use -1 as array index [cppcheck]

12 years agolibmount: make some string operations more robust
Karel Zak [Fri, 15 Jun 2012 10:26:05 +0000 (12:26 +0200)] 
libmount: make some string operations more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: fix trivial typos
Petr Uzel [Thu, 14 Jun 2012 14:13:03 +0000 (16:13 +0200)] 
libmount: fix trivial typos

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolibmount: fix read before allocated buffer
Petr Uzel [Thu, 14 Jun 2012 14:13:02 +0000 (16:13 +0200)] 
libmount: fix read before allocated buffer

valgrind --leak-check=full ./sys-utils/mount -t cifs //127.0.0.1/users /mnt/smb -o user=root,password=linux
....
==21359== Invalid read of size 1
==21359==    at 0x415AC6: mnt_optstr_remove_option_at (optstr.c:310)
==21359==    by 0x416358: mnt_optstr_apply_flags (optstr.c:716)
==21359==    by 0x40DFBF: mnt_context_prepare_mount (context_mount.c:86)
==21359==    by 0x40EB5A: mnt_context_mount (context_mount.c:782)
==21359==    by 0x4058B0: main (mount.c:918)
==21359==  Address 0x51cd5bf is 1 bytes before a block of size 10 alloc'd
==21359==    at 0x4C297CD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21359==    by 0x4C29957: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21359==    by 0x415780: __mnt_optstr_append_option (optstr.c:188)
==21359==    by 0x412822: mnt_fs_append_options (fs.c:764)
==21359==    by 0x409288: mnt_context_append_options (context.c:733)
==21359==    by 0x4053F0: main (mount.c:776)

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolibmount: plug a memory leak in exec_helper()
Petr Uzel [Thu, 14 Jun 2012 14:13:01 +0000 (16:13 +0200)] 
libmount: plug a memory leak in exec_helper()

valgrind --leak-check=full ./sys-utils/mount -t cifs //127.0.0.1/users /mnt/smb -o user=root,password=linux
....
==21359== 28 bytes in 1 blocks are definitely lost in loss record 1 of 1
==21359==    at 0x4C298B2: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21359==    by 0x415780: __mnt_optstr_append_option (optstr.c:188)
==21359==    by 0x415CB5: mnt_optstr_set_option (optstr.c:387)
==21359==    by 0x40D778: do_mount (context_mount.c:192)
==21359==    by 0x40E6A9: mnt_context_do_mount (context_mount.c:685)
==21359==    by 0x40EB7B: mnt_context_mount (context_mount.c:786)
==21359==    by 0x4058B0: main (mount.c:918)

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
12 years agolibblkid: update dm-verity scan
Milan Broz [Tue, 12 Jun 2012 11:18:02 +0000 (13:18 +0200)] 
libblkid: update dm-verity scan

New superblock now contains UUID. Old version is not going to be used.

Signed-off-by: Milan Broz <mbroz@redhat.com>
12 years agosetsid: fix off-by-one error in execvp call
Bernhard Voelker [Wed, 6 Jun 2012 14:34:55 +0000 (16:34 +0200)] 
setsid: fix off-by-one error in execvp call

Bug introduced during --ctty implementation by v2.21-112-g8a2f04d.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agosu: remove unimplemented options -u and -v
Bernhard Voelker [Wed, 6 Jun 2012 13:30:52 +0000 (15:30 +0200)] 
su: remove unimplemented options -u and -v

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agoflock: user-configurable exit code
Jan \"Yenya\" Kasprzak [Tue, 5 Jun 2012 14:26:58 +0000 (16:26 +0200)] 
flock: user-configurable exit code

When locking the file fails with -n or -w option, caller has no way
to distinguish between the exit code 1 of the -c command,
and the exit code 1 of flock(1) caused by the conflicting lock.

Add a new -E <exitcode> (--conflict-exit-code) option to set
the exit code for the case of locking failure to any value.

12 years agomount: (new) allow sloppy for non-root
Karel Zak [Thu, 14 Jun 2012 12:43:21 +0000 (14:43 +0200)] 
mount: (new) allow sloppy for non-root

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=825836
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: don't use nosuid,noexec,nodev for cifs user=foo
Karel Zak [Thu, 14 Jun 2012 12:19:26 +0000 (14:19 +0200)] 
libmount: don't use nosuid,noexec,nodev for cifs user=foo

   mount -t cifs //127.0.0.1/users /mnt/smb -o user=root,password=linux

is incorrectly translated to

   mount.cifs -o noexec,nosuid,nodev,user=root,password=linux ...

The command mount(8) should be sensitive to "user" (without "=<name>")
only. The correct cifs command line is:

   mount.cifs -o user=root,password=linux

Addresses: https://bugzilla.novell.com/show_bug.cgi?id=766157
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: don't generate empty option strings
Karel Zak [Thu, 14 Jun 2012 09:38:53 +0000 (11:38 +0200)] 
libmount: don't generate empty option strings

 mount -t foo something /mnt/test -o user=root,password=linux

generates

 "rw,noexec,nosuid,nodev,password=linux,,user=root"

options string for /sbin/mount.foo, the ",," is incorrect.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoeject: cleanup umount code
Karel Zak [Wed, 13 Jun 2012 13:58:16 +0000 (15:58 +0200)] 
eject: cleanup umount code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoeject: don't try to use non-device path
Karel Zak [Wed, 13 Jun 2012 11:55:49 +0000 (13:55 +0200)] 
eject: don't try to use non-device path

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoeject: add --no-partitions-unmount
Karel Zak [Wed, 13 Jun 2012 11:46:24 +0000 (13:46 +0200)] 
eject: add --no-partitions-unmount

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotools: add small and stupid script to check HAVE_DECL_
Karel Zak [Wed, 13 Jun 2012 09:59:29 +0000 (11:59 +0200)] 
tools: add small and stupid script to check HAVE_DECL_

 use 'make checkdecl' to run the script

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: trust in udev symlinks, don't verify
Karel Zak [Tue, 12 Jun 2012 14:31:39 +0000 (16:31 +0200)] 
libblkid: trust in udev symlinks, don't verify

The libblkid always verify that /dev/disk/by-* symlinks match with
on-device LABELs/UUIDs. It means that all requests (e.g. mount -L |
-U) generates extra superblocks scans on the device.

Currently, many users and tools (GNOME, systemd, ...etc) use the
symlink directly and udev maintains the symlinks by inotify (+watch
rule). It seems better for system performance to disable the extra
paranoid mode and trust in udev.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolosetup: improve -a to report loopdevs < 512 bytes
Karel Zak [Tue, 12 Jun 2012 13:41:47 +0000 (15:41 +0200)] 
losetup: improve -a to report loopdevs < 512 bytes

 # ll ~/xxx2
  -rw-r--r-- 1 root root 500 Jun 12 14:30 /root/xxx2

 old version:
  # losetup -a

 new version:
  # losetup -a
  /dev/loop0: [2052]:535312 (/root/xxx2)

The new version scans /sys/block/loopN, kernel >= 2.6.37 is required
otherwise fallback to the original not-so-smart /proc/partitions scan.

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