]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agofindmnt: add -P, --pairs to the man page
Bill Pemberton [Sat, 17 Mar 2012 00:30:46 +0000 (20:30 -0400)] 
findmnt: add -P, --pairs to the man page

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
12 years agosetsid: cleanup usage()
Karel Zak [Tue, 20 Mar 2012 08:28:38 +0000 (09:28 +0100)] 
setsid: cleanup usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosetsid: add option "-c" to set the controlling terminal
Harald Hoyer [Wed, 14 Mar 2012 09:07:18 +0000 (10:07 +0100)] 
setsid: add option "-c" to set the controlling terminal

[kzak@redhat.com: - use STDIN_FILENO rather than 0]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: make the crosscompile path for scanf_cv_alloc_modifier clever
Sebastian Andrzej Siewior [Wed, 29 Feb 2012 21:26:19 +0000 (22:26 +0100)] 
build-sys: make the crosscompile path for scanf_cv_alloc_modifier clever

My earlier assumption was that scanf_cv_alloc_modifier is unused. This
is not true as pointed out by Karel since it used befoe checking for
libmount. Argh. So instead saying no I add a test to check for glibc
>= 2.7 which provides %m. As of uClibc v0.9.32-rc3 the situation looks
the following:
| git grep _M_SPEC__
|libc/stdio/_vfprintf.c:/* #define __UCLIBC_HAS_PRINTF_M_SPEC__ */
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:# ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:# endif /* __UCLIBC_HAS_PRINTF_M_SPEC__ */
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/old_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/perror.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__

And other libc user have to bring their own stuff.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
12 years agomount: (new) add missing xalloc.h
Karel Zak [Tue, 20 Mar 2012 08:06:09 +0000 (09:06 +0100)] 
mount: (new) add missing xalloc.h

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofileutils: differentiate xmkstemp and xfmkstemp
Sami Kerola [Sat, 10 Mar 2012 11:29:35 +0000 (12:29 +0100)] 
fileutils: differentiate xmkstemp and xfmkstemp

Let developer to choose, case by case, what sort of return value is
best in her code.  The xmkstemp() is for users who want file
descriptor as return value of the function, xfmkstemp() will return
FILE pointer.

Proposed-By: Karel Zak <kzak@redhat.com>
CC: Davidlohr Bueso <dave@gnu.org>
Reference: http://marc.info/?l=util-linux-ng&m=133129570124003&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolslocks: use xasprintf for safe allocation
Sami Kerola [Mon, 5 Mar 2012 20:39:57 +0000 (21:39 +0100)] 
lslocks: use xasprintf for safe allocation

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotools: add asprintf to checkxalloc script
Sami Kerola [Mon, 5 Mar 2012 20:28:41 +0000 (21:28 +0100)] 
tools: add asprintf to checkxalloc script

Reported-By: Dave Reisner <d@falconindy.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agobuild-sys: fix chkdupexe regression
Sami Kerola [Sat, 3 Mar 2012 19:06:13 +0000 (20:06 +0100)] 
build-sys: fix chkdupexe regression

Commit 2897f50a6a6d1aab653c7017f7542d26ac2a8a0b resulted breaking
shebang substitution for chkdupexe.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoxalloc: use xasprintf in all files
Sami Kerola [Wed, 29 Feb 2012 14:54:24 +0000 (15:54 +0100)] 
xalloc: use xasprintf in all files

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoinclude: add asprintf wrapper
Sami Kerola [Wed, 29 Feb 2012 14:49:47 +0000 (15:49 +0100)] 
include: add asprintf wrapper

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: TODO removal, ldattach usage is done
Sami Kerola [Wed, 29 Feb 2012 13:24:18 +0000 (14:24 +0100)] 
docs: TODO removal, ldattach usage is done

Done at Nov 2011.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopathnames: clean up various user database paths
Sami Kerola [Sat, 3 Mar 2012 19:50:55 +0000 (20:50 +0100)] 
pathnames: clean up various user database paths

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agovipw: use xmkstemp() and lckpwdf()
Sami Kerola [Wed, 29 Feb 2012 13:09:56 +0000 (14:09 +0100)] 
vipw: use xmkstemp() and lckpwdf()

Get rid private locking schema and use libc instead.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agosetpwnam: use xmkstemp() and lckpwdf()
Sami Kerola [Wed, 29 Feb 2012 11:37:51 +0000 (12:37 +0100)] 
setpwnam: use xmkstemp() and lckpwdf()

Get rid private locking schema and use libc instead.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agowall: use xmkstemp for temporary file
Sami Kerola [Wed, 29 Feb 2012 14:59:42 +0000 (15:59 +0100)] 
wall: use xmkstemp for temporary file

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolib: add fileutils function collection
Sami Kerola [Wed, 29 Feb 2012 14:58:51 +0000 (15:58 +0100)] 
lib: add fileutils function collection

The fileutils contains xmkstemp function will create temporary file
safe and reusable manner.

Reference: http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO.html#TEMPORARY-FILES
CC: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agochsh: use pathnames.h for paths
Sami Kerola [Wed, 29 Feb 2012 01:05:22 +0000 (02:05 +0100)] 
chsh: use pathnames.h for paths

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agochfn: use pathnames.h for paths
Sami Kerola [Wed, 29 Feb 2012 01:03:51 +0000 (02:03 +0100)] 
chfn: use pathnames.h for paths

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: TODO removal, rpmatch task is done
Sami Kerola [Tue, 28 Feb 2012 23:50:52 +0000 (00:50 +0100)] 
docs: TODO removal, rpmatch task is done

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agovipw: use rpmatch to yes/no question
Sami Kerola [Tue, 28 Feb 2012 23:49:43 +0000 (00:49 +0100)] 
vipw: use rpmatch to yes/no question

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agomesg: use rpmatch to yes/no question
Sami Kerola [Tue, 28 Feb 2012 23:42:16 +0000 (00:42 +0100)] 
mesg: use rpmatch to yes/no question

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agosfdisk: use rpmatch to yes/no question
Sami Kerola [Tue, 28 Feb 2012 23:27:04 +0000 (00:27 +0100)] 
sfdisk: use rpmatch to yes/no question

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: TODO removal, login-utils error printing
Sami Kerola [Tue, 28 Feb 2012 22:24:01 +0000 (23:24 +0100)] 
docs: TODO removal, login-utils error printing

Error printing was fixed at November 2010.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: add deprecation comments
Sami Kerola [Tue, 28 Feb 2012 22:05:59 +0000 (23:05 +0100)] 
docs: add deprecation comments

Markup deprecation to command header to avoid people wasting time in
fixing these utilities.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agologin: add USER to initial environment
Dave Reisner [Sun, 11 Mar 2012 04:54:14 +0000 (23:54 -0500)] 
login: add USER to initial environment

Add this value from the passwd struct to the environment, as it is
expected by shells, and generally useful to users.

This also clarifies a poorly worded sentence in the vicinity of the
manpage change.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agolsblk: RQ-SIZE is part of the --topology output (man page bugfix)
Dave Reisner [Fri, 9 Mar 2012 18:32:43 +0000 (13:32 -0500)] 
lsblk: RQ-SIZE is part of the --topology output (man page bugfix)

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agolosetup: Fix setting of sizelimit on new loop devices
Daniel Drake [Fri, 9 Mar 2012 17:56:50 +0000 (17:56 +0000)] 
losetup: Fix setting of sizelimit on new loop devices

"losetup --offset 10 --sizelimit 20 foo.img" was producing
a loop device with offset 20 and no sizelimit. Looks like a typo,
fix it.

Signed-off-by: Daniel Drake <dsd@laptop.org>
12 years agobuild-sys: add --diable-sulogin (enabled by default)
Karel Zak [Mon, 12 Mar 2012 14:16:09 +0000 (15:16 +0100)] 
build-sys: add --diable-sulogin (enabled by default)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: note sulogin in configure help
Karel Zak [Mon, 12 Mar 2012 13:53:18 +0000 (14:53 +0100)] 
build-sys: note sulogin in configure help

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: share vc initialization with agetty
Karel Zak [Mon, 12 Mar 2012 13:41:00 +0000 (14:41 +0100)] 
sulogin: share vc initialization with agetty

The virtual console initialization has been removed by Dave's
commit 5ec4a799c2a8d25c4c8260772363392f805b0a54.

We already use this tty initialization for agetty, so reuse the same
code.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoagetty: move vc initialization to ttyutils.h
Karel Zak [Mon, 12 Mar 2012 13:39:32 +0000 (14:39 +0100)] 
agetty: move vc initialization to ttyutils.h

... to make the code usable for sulogin.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: add note about port to util-linux to the man page
Karel Zak [Mon, 12 Mar 2012 11:55:26 +0000 (12:55 +0100)] 
sulogin: add note about port to util-linux to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: fix selinux build
Karel Zak [Mon, 12 Mar 2012 11:47:37 +0000 (12:47 +0100)] 
sulogin: fix selinux build

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: parse timeout more carefully
Karel Zak [Mon, 12 Mar 2012 11:43:53 +0000 (12:43 +0100)] 
sulogin: parse timeout more carefully

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: initialize nls stuff
Karel Zak [Mon, 12 Mar 2012 11:36:39 +0000 (12:36 +0100)] 
sulogin: initialize nls stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: check chdir and getcwd return values [-Wunused-result]
Karel Zak [Mon, 12 Mar 2012 11:32:03 +0000 (12:32 +0100)] 
sulogin: check chdir and getcwd return values [-Wunused-result]

sulogin.c: In function ‘sushell’:
sulogin.c:338:7: warning: ignoring return value of ‘chdir’, declared
with attribute warn_unused_result [-Wunused-result]
sulogin.c:359:8: warning: ignoring return value of ‘getcwd’, declared
with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: add long options
Karel Zak [Mon, 12 Mar 2012 11:23:29 +0000 (12:23 +0100)] 
sulogin: add long options

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: use EXIT_*
Karel Zak [Mon, 12 Mar 2012 10:51:19 +0000 (11:51 +0100)] 
sulogin: use EXIT_*

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: use err.h stuff
Karel Zak [Mon, 12 Mar 2012 10:48:33 +0000 (11:48 +0100)] 
sulogin: use err.h stuff

 and print "Login incorrect" to stderr like login(1).

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: replace perror() with warx()
Karel Zak [Mon, 12 Mar 2012 10:38:12 +0000 (11:38 +0100)] 
sulogin: replace perror() with warx()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: cleanup comments
Karel Zak [Mon, 12 Mar 2012 10:29:09 +0000 (11:29 +0100)] 
sulogin: cleanup comments

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: add i18n strings
Dave Reisner [Tue, 28 Feb 2012 16:45:21 +0000 (11:45 -0500)] 
sulogin: add i18n strings

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin: use a more standard usage output
Dave Reisner [Tue, 28 Feb 2012 16:45:20 +0000 (11:45 -0500)] 
sulogin: use a more standard usage output

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin: header/include cleanup
Dave Reisner [Tue, 28 Feb 2012 16:45:19 +0000 (11:45 -0500)] 
sulogin: header/include cleanup

- use our own crypt.h compile time check
- remove ttydefaults.h include -- get this via termios.h, the same as
  agetty

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin: use pathnames.h for file locations
Dave Reisner [Tue, 28 Feb 2012 16:45:18 +0000 (11:45 -0500)] 
sulogin: use pathnames.h for file locations

This covers /etc/shadow and /etc/passwd. We don't have a define for
/bin/sh -- just replace the macro with the hardcoded string as done
elsewhere.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin: get rid of calls to /bin/sash
Dave Reisner [Tue, 28 Feb 2012 16:45:17 +0000 (11:45 -0500)] 
sulogin: get rid of calls to /bin/sash

This probably doesn't exist on most systems, and if the root's shell and
/bin/sh fail to execute, it seems unlikely that /bin/sash will save us.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin: use size_t for iterator to avoid cast
Dave Reisner [Tue, 28 Feb 2012 16:45:16 +0000 (11:45 -0500)] 
sulogin: use size_t for iterator to avoid cast

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin: remove USE_ONELINE and SANE_TIO defines
Dave Reisner [Tue, 28 Feb 2012 16:45:15 +0000 (11:45 -0500)] 
sulogin: remove USE_ONELINE and SANE_TIO defines

This was only ever compiled in for a single distro, with no clear
indication of why.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin: remove CHECK_{DES,MD5} defines
Dave Reisner [Tue, 28 Feb 2012 16:45:14 +0000 (11:45 -0500)] 
sulogin: remove CHECK_{DES,MD5} defines

Remove these always-true defines along with their #ifdef statements.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin: replace older signal() with sigaction()
Dave Reisner [Tue, 28 Feb 2012 16:45:13 +0000 (11:45 -0500)] 
sulogin: replace older signal() with sigaction()

This provides a more reliable means of saving and restoring signal
handlers and avoids ugly (invalid) function pointer assignments. This
also removes the #ifdef blocking usage of a GCC attribute, which is
widely used in the rest of the codebase.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin: whitespace fixes
Dave Reisner [Tue, 28 Feb 2012 16:45:12 +0000 (11:45 -0500)] 
sulogin: whitespace fixes

Use a code style more inline with the rest of the project.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin.8: refactor manpage
Dave Reisner [Tue, 28 Feb 2012 16:45:11 +0000 (11:45 -0500)] 
sulogin.8: refactor manpage

- Use a more standard layout using .IP macros for options
- Avoid direct references to sysvinit

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agosulogin: initial import from sysvinit
Dave Reisner [Tue, 28 Feb 2012 16:45:10 +0000 (11:45 -0500)] 
sulogin: initial import from sysvinit

Import the source and manpage of sulogin. Only the selinux #ifdef is
changed to match our autotool setup.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agofstab.5: fix misspelling of deprecated
Dave Reisner [Tue, 28 Feb 2012 16:45:09 +0000 (11:45 -0500)] 
fstab.5: fix misspelling of deprecated

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agolibmount: fix "already mounted" detection on systems with mtab
Karel Zak [Fri, 9 Mar 2012 12:11:24 +0000 (13:11 +0100)] 
libmount: fix "already mounted" detection on systems with mtab

For systems with regular mtab the fs->root should be ignored in
"already mounted" heuristic.

Reported-by: Matt Burgess <matthew@linuxfromscratch.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: add --version switch
Milan Broz [Mon, 5 Mar 2012 21:07:10 +0000 (22:07 +0100)] 
lsblk: add --version switch

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

Signed-off-by: Milan Broz <mbroz@redhat.com>
12 years agowipefs: Fix mismatch if more -o options used.
Milan Broz [Mon, 5 Mar 2012 21:07:09 +0000 (22:07 +0100)] 
wipefs: Fix mismatch if more -o options used.

If there are more offset options specified, some could be lost.

Try
pvcreate /dev/sd[bcde]
mdadm -C -l 5 -n4 /dev/md0 /dev/sd[bcde]
mdadm --stop /dev/md0

wipefs -n -o 0x1000 -o 0x218 /dev/sdb
- LVM2 signature remains there

wipefs -n -o 0x218 -o 0x1010 /dev/sdb
- no report about ignored signature

Signed-off-by: Milan Broz <mbroz@redhat.com>
12 years agolibmount: avoid infinite loop in child fs iteration
Dave Reisner [Sun, 4 Mar 2012 21:08:39 +0000 (16:08 -0500)] 
libmount: avoid infinite loop in child fs iteration

In early userspace, the rootfs is mounted with itself as its parent.
Example /proc/self/mountinfo:

1 1 0:1 / / rw - rootfs rootfs rw
14 1 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw
15 1 0:13 / /sys rw,nosuid,nodev,noexec,relatime - sysfs sys rw
16 1 0:5 / /dev rw,nosuid,relatime - devtmpfs dev rw,size=506956k
17 1 0:14 / /run rw,nosuid,nodev,relatime - tmpfs run rw,mode=755

This causes an infinite loop in mnt_table_next_child_fs, and is
evidenced by a crash via infinite recursion in findmnt. Simply catch the
condition where the ID of the parent is the ID of the current fs we're
examining and skip over it to the next mount in the table.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agolsblk: escape unsafe chars in parsable output
Karel Zak [Thu, 8 Mar 2012 15:04:45 +0000 (16:04 +0100)] 
lsblk: escape unsafe chars in parsable output

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoscript: play well with csh when invoked from within /etc/csh.login
Karel Zak [Thu, 8 Mar 2012 15:02:28 +0000 (16:02 +0100)] 
script: play well with csh when invoked from within /etc/csh.login

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797888
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: fix to build for IA32
Christian Wiese [Wed, 15 Feb 2012 12:39:22 +0000 (13:39 +0100)] 
fdisk: fix to build for IA32

Tested architectures:
- i486 using gcc -march=i486
- i586 using gcc -march=pentium-mmx
- i686 using gcc -march={pentiumpro,pentium2,pentium3,pentium-m,pentium4}

Without this fix building fdisk fails for for all tested arch/cpu types
emiting following error:
------------------------------------------------------------------------------
In file included from fdiskbsdlabel.c:62:0:
fdiskbsdlabel.h:61:2: error: #error unknown architecture
fdiskbsdlabel.c: In function 'bselect':
fdiskbsdlabel.c:180:44: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c:180:44: note: each undeclared identifier is reported only once for each function it appears in
fdiskbsdlabel.c: In function 'xbsd_write_bootstrap':
fdiskbsdlabel.c:539:24: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c: In function 'xbsd_readlabel':
fdiskbsdlabel.c:744:28: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c:744:60: error: 'BSD_LABELOFFSET' undeclared (first use in this function)
fdiskbsdlabel.c: In function 'xbsd_writelabel':
fdiskbsdlabel.c:769:32: error: 'BSD_LABELSECTOR' undeclared (first use in this function)
fdiskbsdlabel.c:780:61: error: 'BSD_LABELOFFSET' undeclared (first use in this function)
make[2]: *** [fdisk-fdiskbsdlabel.o] Error 1
------------------------------------------------------------------------------

This fix was tested with following major toolchain components:

binutils 2.21.53.0.2
gcc 4.6.2
glibc 2.14.1

12 years agolsblk: use readlink_at from at.c
Karel Zak [Wed, 7 Mar 2012 13:28:52 +0000 (14:28 +0100)] 
lsblk: use readlink_at from at.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: add inverse tree support (-s)
Peter Rajnoha [Tue, 14 Feb 2012 08:53:16 +0000 (09:53 +0100)] 
lsblk: add inverse tree support (-s)

$ lsblk --inverse -o NAME /dev/dm-0
NAME
luks-10d813de-fa82-4f67-a86c-23d5d0e7c30e (dm-0)
└─sda6
  └─sda

Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: remove (dm-N) from NAME for raw/pair output format
Karel Zak [Wed, 7 Mar 2012 12:11:54 +0000 (13:11 +0100)] 
lsblk: remove (dm-N) from NAME for raw/pair output format

 $ lsblk -P -o NAME /dev/dm-0
 NAME="luks-10d813de-fa82-4f67-a86c-23d5d0e7c30e (dm-0)"

the (dm-0) sucks in the parsable output...

Reported-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: cleanup flags usage
Karel Zak [Wed, 7 Mar 2012 09:45:48 +0000 (10:45 +0100)] 
libmount: cleanup flags usage

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: add TYPE column
Davidlohr Bueso [Fri, 2 Mar 2012 13:00:06 +0000 (14:00 +0100)] 
lslocks: add TYPE column

By knowing the lock's type (flock or posix), the user can have more
information about the lock and how it was created.

[kzak@redhat.com: - rename PERSONALITY to TYPE,
                  - rename ACCESS to MODE]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add lslocks to build-sys tests
Karel Zak [Tue, 6 Mar 2012 11:17:05 +0000 (12:17 +0100)] 
tests: add lslocks to build-sys tests

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologin: minor spelling fixes
Karel Zak [Tue, 6 Mar 2012 10:38:51 +0000 (11:38 +0100)] 
login: minor spelling fixes

Reported-by: Elan Ruusamäe <glen@delfi.ee>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologin: minor spelling fixes
Elan Ruusamäe [Tue, 6 Mar 2012 10:32:37 +0000 (11:32 +0100)] 
login: minor spelling fixes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: fix sysfs context usage
Karel Zak [Tue, 6 Mar 2012 10:24:54 +0000 (11:24 +0100)] 
libblkid: fix sysfs context usage

Reported-by: Elan Ruusamäe <glen@delfi.ee>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologin: fix LOGIN_CHOWN_VCS code
Karel Zak [Mon, 5 Mar 2012 15:48:38 +0000 (16:48 +0100)] 
login: fix LOGIN_CHOWN_VCS code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: search for "none" by findmnt
Karel Zak [Fri, 2 Mar 2012 14:59:10 +0000 (15:59 +0100)] 
tests: search for "none" by findmnt

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: add mnt_fs_streq_target() and export all mnt_fs_streq_*
Karel Zak [Fri, 2 Mar 2012 14:53:55 +0000 (15:53 +0100)] 
libmount: add mnt_fs_streq_target() and export all mnt_fs_streq_*

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoblkid: add DEVNAME= to export output format
Karel Zak [Fri, 2 Mar 2012 13:05:26 +0000 (14:05 +0100)] 
blkid: add DEVNAME= to export output format

Reported-by: Balamurugan Arumugam <barumuga@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: wait a moment between mount and umount
Karel Zak [Fri, 2 Mar 2012 12:33:46 +0000 (13:33 +0100)] 
tests: wait a moment between mount and umount

It seems that without sleep between mount and umount are the test
unstable, because kernel is not able to provide updated
/proc/self/mountinfo so quickly (really?).

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: add mnt_fs_streq_srcpath()
Karel Zak [Fri, 2 Mar 2012 12:29:39 +0000 (13:29 +0100)] 
libmount: add mnt_fs_streq_srcpath()

We have to be careful with "none" or another dummy sources for pseudo
filesystems. These strings should be canonicalized or compared as a
paths.

The function is not exported by library API.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: cosmetic changes around "none"
Karel Zak [Fri, 2 Mar 2012 10:23:34 +0000 (11:23 +0100)] 
libmount: cosmetic changes around "none"

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: update libmount tests
Karel Zak [Fri, 2 Mar 2012 08:57:49 +0000 (09:57 +0100)] 
tests: update libmount tests

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: don't treat "none" differently
Dave Reisner [Fri, 2 Mar 2012 03:47:00 +0000 (22:47 -0500)] 
libmount: don't treat "none" differently

This causes more problems than it solves. In the latest edition:

  # mount -t proc none foo
  mount: foo: mount failed: Invalid argument

A check for source and target fails in mnt_context_apply_fstab()
because, even though they were indeed specified on the cmdline,
__mnt_fs_set_source_ptr() altered this and NULL'd out the source.

If you're able to mount this device via other means, other tools start
reporting oddities, such as mount's output:

  (null) on /foo type proc (rw,relatime)

or findmnt:

  TARGET      SOURCE FSTYPE OPTIONS
  /foo               proc   rw,relatime

Simply treat "none" like any other source when passed in.

[kzak@redhat.com: - don't translate NULL to "none" in mnt_fs_set_source()]

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomountpoint: account for error from in mnt_fs_get_target
Dave Reisner [Fri, 2 Mar 2012 03:46:59 +0000 (22:46 -0500)] 
mountpoint: account for error from in mnt_fs_get_target

commit 04f087ec didn't take into consideration that mnt_fs_get_target()
could return an error, and would therefore show false positives, such
as:

$ mkdir foo; mountpoint foo
foo is a mountpoint

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agowipefs: always print devname
Karel Zak [Thu, 1 Mar 2012 14:44:04 +0000 (15:44 +0100)] 
wipefs: always print devname

It seems too smart to print devname according to number of devices.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agowipefs: support more device arguments for wipefs
Milan Broz [Wed, 29 Feb 2012 16:16:42 +0000 (17:16 +0100)] 
wipefs: support more device arguments for wipefs

[kzak@redhat.com: - print devname only if more devices specified]

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agowipefs: add quiet flag (-q)
Milan Broz [Wed, 29 Feb 2012 16:16:41 +0000 (17:16 +0100)] 
wipefs: add quiet flag (-q)

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: properly reset chain in probe_do_wipe()
Karel Zak [Thu, 1 Mar 2012 13:24:04 +0000 (14:24 +0100)] 
libblkid: properly reset chain in probe_do_wipe()

The command wipefs is not able to remove all signatures from the
device if the first detected signature is linux raid. The another
superblock signatures are ignored. For example:

  # pvcreate /dev/sdb1
  # mdadm --create md8 --metadata=0.90 --chunk=64 --level=0 \
        --raid-devices=2 /dev/sdb1 /dev/sdb2

  # wipefs -a /dev/sdb1

will delete the linux raid signature only.

Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add tests for mount --make-* stuff
Karel Zak [Thu, 1 Mar 2012 11:30:14 +0000 (12:30 +0100)] 
tests: add tests for mount --make-* stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomountpoint: fix a minor bug with 0:0 devno
Zhi Li [Wed, 29 Feb 2012 08:28:49 +0000 (16:28 +0800)] 
mountpoint: fix a minor bug with 0:0 devno

zhi@debian-lizhi:~$ mountpoint /sys
/sys is not a mountpoint
zhi@debian-lizhi:~$

The problem is in mountpoint.c, function dir_to_device(), which uses 0 as an
error return value, but for sysfs 0 is its device number:

zhi@debian-lizhi:~$ cat /proc/self/mountinfo
14 19 0:0 / /sys rw,nosuid,nodev,noexec,relatime - sysfs none rw
15 19 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc none rw

My change is on dir_to_device, seperating device number from return value.

Signed-off-by: Zhi Li <lizhi1215@gmail.com>
12 years agolslocks: add --notruncate, minor fixes in man page
Karel Zak [Wed, 29 Feb 2012 13:26:46 +0000 (14:26 +0100)] 
lslocks: add --notruncate, minor fixes in man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: add lslocks.8 man page
Davidlohr Bueso [Wed, 29 Feb 2012 13:15:01 +0000 (14:15 +0100)] 
lslocks: add lslocks.8 man page

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: new command
Davidlohr Bueso [Mon, 27 Feb 2012 17:26:40 +0000 (18:26 +0100)] 
lslocks: new command

The new lslocks(8) program is meant to replace the deprecated lslk(8). It is
designed for simplicity and removes unnecessary Unix legacy outputs and
options:

- Don't output inode number, whence and maj:min device numbers.
- Don't provide nonblocking syscall options stat(2) and readlink(2)
- Remove lslk's alternate default kernel name list file path (-k)

The option to use nonblocking calls was previously intended for NFS partitions;
however this should be transparent to utility programs considering that
timeouts can occur generically (fuse - sshfs, NFS, netdevs, etc).

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude: add /proc/locks path to pathnames
Davidlohr Bueso [Wed, 29 Feb 2012 11:27:41 +0000 (12:27 +0100)] 
include: add /proc/locks path to pathnames

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: s/ruman/ruman1/
Karel Zak [Tue, 28 Feb 2012 17:11:23 +0000 (18:11 +0100)] 
build-sys: s/ruman/ruman1/

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: do not overwrite ddate.1 manual
Sami Kerola [Sun, 26 Feb 2012 21:45:40 +0000 (22:45 +0100)] 
docs: do not overwrite ddate.1 manual

The following warning meant either english manual page overwrote ru
version, or otherway around.  Neither way that not intented.  This
patch will change ru version of the manual page to be installed to
<prefix><mandir>/ru/man1 directory.

man/ru/Makefile.am:4: warning: mandir was already defined in condition TRUE, which includes condition BUILD_DDATE ...
configure.ac:1: ... `mandir' previously defined here

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agomount: (new) add 'internal-only(i)' to non-root allowed options
Raghavendra D Prabhu [Sun, 26 Feb 2012 11:06:42 +0000 (16:36 +0530)] 
mount: (new) add 'internal-only(i)' to non-root allowed options

Commit ce433404 introduced the change, which causes something like mount -i
<user-mount-path> to break which worked well before util-linux-2.21, now it
gives message 'mount: only root can use "--internal-only" option' when that
shouldn't be the case when it is already in fstab.

Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
12 years agobuild-sys: add a crosscompile path for scanf_cv_alloc_modifier
Sebastian Andrzej Siewior [Fri, 24 Feb 2012 17:16:07 +0000 (18:16 +0100)] 
build-sys: add a crosscompile path for scanf_cv_alloc_modifier

This allows to building the package cross again. Since the return value
is not used I guess there is little loss.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
12 years agotests: make output and diff dirs usage more robust
Karel Zak [Tue, 28 Feb 2012 13:37:45 +0000 (14:37 +0100)] 
tests: make output and diff dirs usage more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: enhance readability of the autotools files
Sami Kerola [Wed, 8 Feb 2012 08:51:34 +0000 (09:51 +0100)] 
build-sys: enhance readability of the autotools files

Several horizontal lists are turned to vertical, and sorted to
alphabetical order. Additionally spaces are converted to tabs where
ever possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agobuild-sys: remove unused function and header checks
Sami Kerola [Wed, 8 Feb 2012 08:32:55 +0000 (09:32 +0100)] 
build-sys: remove unused function and header checks

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agologin: support crazy shadow-utils syntax in login.defs
Karel Zak [Tue, 28 Feb 2012 10:16:16 +0000 (11:16 +0100)] 
login: support crazy shadow-utils syntax in login.defs

standard syntax for FOO=data:

ENV_FOO   data

additional syntax:

ENV_FOO  FOO=data

Reported-by: Colin Guthrie colin@mageia.org
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotest: test 'none' source for mount(8)
Karel Zak [Mon, 27 Feb 2012 23:21:48 +0000 (00:21 +0100)] 
test: test 'none' source for mount(8)

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