]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agoblkid: use strtosize_or_err()
Karel Zak [Fri, 30 Mar 2012 14:17:36 +0000 (16:17 +0200)] 
blkid: use strtosize_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/strutils: add strtosize_or_err, clean up
Karel Zak [Fri, 30 Mar 2012 14:11:31 +0000 (16:11 +0200)] 
lib/strutils: add strtosize_or_err, clean up

 * add strtosize_or_err(), we use strtosize() + err() on many places

 * add STRTOXX_EXIT_CODE to overwrite the default EXIT_FAILURE

 * remove else-after-noreturn (e.g. if (foo) err(...); else err(...))

 * clean up indent...

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: clarify KiB vs. KB in man pages
Bernhard Voelker [Mon, 26 Mar 2012 09:30:16 +0000 (11:30 +0200)] 
docs: clarify KiB vs. KB in man pages

Update the man pages of blkid, wipefs, fallocate, fstrim, losetup
and hexdump to clarify the suffixes for the numerical values of the
offset and size/length arguments regarding KiB=1024 vs KB=1000.
Also mention the ZiB/YiB and ZB/YB suffixes supported by strtosize().

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agotools: improve ko-release-* scripts
Karel Zak [Fri, 30 Mar 2012 11:43:45 +0000 (13:43 +0200)] 
tools: improve ko-release-* scripts

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoblkid: add note about variable tags and devices order.
Karel Zak [Thu, 29 Mar 2012 13:06:49 +0000 (15:06 +0200)] 
blkid: add note about variable tags and devices order.

Reported-by: Michael Conrad <mconrad@intellitree.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: move obsolete lib/fsprobe to mount/
Karel Zak [Tue, 27 Mar 2012 10:23:07 +0000 (12:23 +0200)] 
build-sys: move obsolete lib/fsprobe to mount/

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoswapon: use directly blkid rather than fsprobe wrapper
Karel Zak [Tue, 27 Mar 2012 10:13:24 +0000 (12:13 +0200)] 
swapon: use directly blkid rather than fsprobe wrapper

 * remove dependence on lib/fsprobe.c

 * reuse already read swap header for --fixpgsz (don't re-read the
   header by libblkid)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add swapon tests for --fixpgsz and fix signature
Karel Zak [Tue, 27 Mar 2012 10:11:53 +0000 (12:11 +0200)] 
tests: add swapon tests for --fixpgsz and fix signature

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: mark udev and list blkid(8) output formats deprecated
Karel Zak [Mon, 26 Mar 2012 11:09:27 +0000 (13:09 +0200)] 
docs: mark udev and list blkid(8) output formats deprecated

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: update
Karel Zak [Mon, 26 Mar 2012 08:25:19 +0000 (10:25 +0200)] 
tests: update

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoRevert "lib/canonicalize: always remove tailing slash"
Karel Zak [Mon, 26 Mar 2012 08:08:48 +0000 (10:08 +0200)] 
Revert "lib/canonicalize: always remove tailing slash"

It's overkill to modify unknown paths in a generic function like
canonicalize_path().

for example:

 mount -t fuse 'sshfs#marty@thee:/' /media/thee

will be canonicalized to

 mount -t fuse 'sshfs#marty@thee:' /media/thee

and this obvious bug.

Reported-by: Martin Panter <vadmium+floss@gmail.com>
This reverts commit 28074a0952469aebf021821d95238cfb964d13ff.

12 years agohexdump: update man page for -n and -s
Karel Zak [Fri, 23 Mar 2012 17:17:10 +0000 (18:17 +0100)] 
hexdump: update man page for -n and -s

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: update iso tests
Karel Zak [Wed, 21 Mar 2012 18:43:49 +0000 (19:43 +0100)] 
tests: update iso tests

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agohexdump: use strtosize() for -n and -s
Karel Zak [Wed, 21 Mar 2012 18:35:22 +0000 (19:35 +0100)] 
hexdump: use strtosize() for -n and -s

strtosize() is based on uintmax_t and supports all possible suffixes
(B,M,G,T ...)

Reported-by: Simon de Vlieger <simon@ikanobori.jp>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: generate pseudo-UUID for ISO9660 image file
Andreas Vogel [Wed, 21 Mar 2012 12:43:35 +0000 (13:43 +0100)] 
libblkid: generate pseudo-UUID for ISO9660 image file

The UUID is generated from the modification date in the ISO volume
descriptor. As GRUB 2 is using this definition for the pseudo UUID for
ISO9660 files libblkid would be perfectly compatible with GRUB 2.

Signed-off-by: Andreas Vogel <Andreas.Vogel@anvo-it.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: fix recursively propagation mounting
Dong Hao [Wed, 21 Mar 2012 05:50:14 +0000 (13:50 +0800)] 
mount: fix recursively propagation mounting

Provide the recursive flag of propagation mounting. Recursive flag could
be used together with propagation flag.

[kzak@redhat.com: - add MS_SILENT to acceptable propagation flags,
                  - fix new code in libmount too]

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Dong Hao <haodong@linux.vnet.ibm.com>
12 years agofsck: tiny coding style fix
Karel Zak [Tue, 6 Mar 2012 12:56:54 +0000 (13:56 +0100)] 
fsck: tiny coding style fix

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: use gettimeofday() for real elapsed time statistic
Karel Zak [Tue, 6 Mar 2012 12:36:28 +0000 (13:36 +0100)] 
fsck: use gettimeofday() for real elapsed time statistic

 and use shorter "rss" rather than "maxrss" keyword in stats output

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: Add a -r option to report memory and runtime statistics
Frank Mayhar [Tue, 6 Mar 2012 12:23:08 +0000 (13:23 +0100)] 
fsck: Add a -r option to report memory and runtime statistics

This patch adds a "-r" option to report statistics for each fsck run.
It gathers the statistics via wait4() and rusage and reports exit
status, system and user CPU time, elapsed wall-clock time and the max
RSS.

[kzak@redhat.com: - rebase to the latest code,
                  - report all on one line,
                  - use "real" rather than "elapsed"]

Signed-off-by: Frank Mayhar <fmayhar@google.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: move to disk-utils directory
Karel Zak [Tue, 6 Mar 2012 11:36:03 +0000 (12:36 +0100)] 
fsck: move to disk-utils directory

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: coding stype fixes (calloc, err, ...)
Karel Zak [Mon, 20 Feb 2012 21:37:56 +0000 (22:37 +0100)] 
fsck: coding stype fixes (calloc, err, ...)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: don't try to call fsck for undefined fs type
Karel Zak [Mon, 20 Feb 2012 21:22:58 +0000 (22:22 +0100)] 
fsck: don't try to call fsck for undefined fs type

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: fix coding style
Karel Zak [Mon, 20 Feb 2012 16:44:51 +0000 (17:44 +0100)] 
fsck: fix coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: remove unnecessary fsck.h
Karel Zak [Mon, 20 Feb 2012 16:36:54 +0000 (17:36 +0100)] 
fsck: remove unnecessary fsck.h

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: use libmount to check for mounted filesystems
Karel Zak [Mon, 20 Feb 2012 16:28:53 +0000 (17:28 +0100)] 
fsck: use libmount to check for mounted filesystems

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: improve mnt_tables_is_mounted
Karel Zak [Mon, 20 Feb 2012 16:18:11 +0000 (17:18 +0100)] 
libmount: improve mnt_tables_is_mounted

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: remove string_copy()
Karel Zak [Mon, 20 Feb 2012 15:39:59 +0000 (16:39 +0100)] 
fsck: remove string_copy()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: replace fsprobe with libmount utils
Karel Zak [Wed, 15 Feb 2012 23:20:02 +0000 (00:20 +0100)] 
fsck: replace fsprobe with libmount utils

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: use libmount for filesystem list
Karel Zak [Wed, 15 Feb 2012 13:07:06 +0000 (14:07 +0100)] 
fsck: use libmount for filesystem list

libmount provides all necessary functionality required in fsck for
work with filesystems descriptions.

This patch seems large and invasive, because removes fsck_fs struct,
changes:

  - use libmnt to parse fstab
  - use libmnt_fs from libmount
  - replace "fs->" with mnt_fs_* or fs_* functions

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: don't duplicate exit code macros
Karel Zak [Mon, 13 Feb 2012 14:55:45 +0000 (15:55 +0100)] 
fsck: don't duplicate exit code macros

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/exitcodes: clean up names, add _EX_ suffix
Karel Zak [Mon, 13 Feb 2012 14:52:15 +0000 (15:52 +0100)] 
include/exitcodes: clean up names, add _EX_ suffix

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/exitcodes: add FSCK_DESTRUCT alias
Karel Zak [Mon, 13 Feb 2012 14:37:58 +0000 (15:37 +0100)] 
include/exitcodes: add FSCK_DESTRUCT alias

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck: cosmetic changes in coding style
Karel Zak [Mon, 13 Feb 2012 14:30:30 +0000 (15:30 +0100)] 
fsck: cosmetic changes in coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: don't print confusing warning on non-partitioned disks
Karel Zak [Tue, 20 Mar 2012 10:13:28 +0000 (11:13 +0100)] 
fdisk: don't print confusing warning on non-partitioned disks

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=740163
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomisc: clenaup SIZE columns in lsblk and findmnt
Karel Zak [Tue, 20 Mar 2012 10:04:48 +0000 (11:04 +0100)] 
misc: clenaup SIZE columns in lsblk and findmnt

Note that lib/tt.c will never truncate columns without TT_FL_TRUNC or
relative column width. So it's fine to set small width for columns
with SIZEs, the defined width is minimal width.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: improve --df output
Karel Zak [Tue, 20 Mar 2012 09:43:29 +0000 (10:43 +0100)] 
findmnt: improve --df output

 * don't print pseudo-filesystems (except tmpfs)
 * add --all to disable built-in filters
 * don't overwrite --df --output=<list> with default columns

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: add configfs to pseudofs list
Karel Zak [Tue, 20 Mar 2012 09:42:47 +0000 (10:42 +0100)] 
libmount: add configfs to pseudofs list

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/tt: work more sensitive with large columns
Karel Zak [Tue, 20 Mar 2012 09:42:03 +0000 (10:42 +0100)] 
lib/tt: work more sensitive with large columns

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: use xasprintf()
Karel Zak [Tue, 20 Mar 2012 08:55:24 +0000 (09:55 +0100)] 
findmnt: use xasprintf()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/ttyutils.h: add include guards
Dave Reisner [Sun, 18 Mar 2012 03:36:31 +0000 (23:36 -0400)] 
include/ttyutils.h: add include guards

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agofindmnt: add -D, --df option to imitate df(1)
Dave Reisner [Sun, 18 Mar 2012 03:36:33 +0000 (23:36 -0400)] 
findmnt: add -D, --df option to imitate df(1)

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agotunelp: remove old, now unneeded header
Dave Reisner [Sun, 18 Mar 2012 03:36:30 +0000 (23:36 -0400)] 
tunelp: remove old, now unneeded header

malloc and friends are provided by stdlib.h.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agofindmnt: add FS size, avail, used, and use% columns
Dave Reisner [Sun, 18 Mar 2012 03:36:32 +0000 (23:36 -0400)] 
findmnt: add FS size, avail, used, and use% columns

Provide display of filesystem attributes from statvfs(3). These are all
displayed in human readable format.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agocheckxalloc: nudge regex, fix newfound instances
Dave Reisner [Tue, 20 Mar 2012 08:44:40 +0000 (09:44 +0100)] 
checkxalloc: nudge regex, fix newfound instances

Using the -w flag with grep actually fought against us here, and hid
some instances where xalloc functions weren't used. Discard it in
favor of an explicit word boundary as a prefix to the function name,
and extend our requirements on the trailing side of the pattern.

This also fixes the few new instances that were overlooked because of
the regex's deficiency.

[kzak@redhat.com: - fix also newfound in findmnt
                  - remove unnecessary checks after xallocs]

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
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>