]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
13 years agodocs: add hwclock -c to TODO file
Karel Zak [Fri, 9 Dec 2011 13:08:02 +0000 (14:08 +0100)] 
docs: add hwclock -c to TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agopartx: don't treat empty partition table as error
Karel Zak [Thu, 8 Dec 2011 13:22:04 +0000 (14:22 +0100)] 
partx: don't treat empty partition table as error

Phillip wrote:
 If a partition table was detected, but it had no partitions
 in it, a poorly worded error message was printed and further
 action halted.  For partx -a, this gave an unnecessary error.

Reported-by: Phillip Susi <psusi@cfl.rr.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agopartx: cleanup usage() and man page, add undocumented --verbose
Karel Zak [Thu, 8 Dec 2011 13:14:28 +0000 (14:14 +0100)] 
partx: cleanup usage() and man page, add undocumented --verbose

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agopartx: don't print error when partition already doesn't exist
Phillip Susi [Mon, 5 Dec 2011 20:02:51 +0000 (15:02 -0500)] 
partx: don't print error when partition already doesn't exist

If you run partx -d to delete partitions, and there are gaps
in the sequence ( partition 2 exists, but 1 doesn't ), then it
would complain that it had errors trying to remove the partitions
that already don't exist. Changed to ignore the error when
errno == ENXIO.

Signed-off-by: Phillip Susi <psusi@cfl.rr.com>
13 years agoagetty: don't use log_err() for non-fatal errors
Karel Zak [Thu, 8 Dec 2011 10:39:05 +0000 (11:39 +0100)] 
agetty: don't use log_err() for non-fatal errors

The TIOCSCTTY ioctl requires that caller is session leader -- so it
depends on initd (or we have to add setsid() to aggety). It seems that the
traditional way is to setup tty in agetty and session in login(1).

It means that all session related things (TIOCSCTTY, vhangup, ...) in the
command agetty should be optional. (Note that vhangup() is called when
--hangup is explicitly specified on command line, so log_err() makes
sense there.)

Reported-by: Andrew Walrond <andrew@walrond.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agologger: fix remote logging
Karel Zak [Thu, 8 Dec 2011 09:20:22 +0000 (10:20 +0100)] 
logger: fix remote logging

Reported-by: Hervé Quillévéré <herve_quillevere@herveq.tk>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add log_err to smatch non-return functions
Karel Zak [Fri, 2 Dec 2011 17:31:20 +0000 (18:31 +0100)] 
build-sys: add log_err to smatch non-return functions

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: check HAVE_ definitions with #ifdef [smatch scan]
Sami Kerola [Thu, 1 Dec 2011 22:10:21 +0000 (23:10 +0100)] 
build-sys: check HAVE_ definitions with #ifdef [smatch scan]

Fix to `warning: undefined preprocessor identifier' messages.

[kzak@redhat.com: replace "#ifdef XXX #ifdef YYY" with
                  "#if defined(XXX) && defined(YYY)"]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: check HAVE_ definitions with #ifdef [smatch scan]
Sami Kerola [Thu, 1 Dec 2011 22:10:21 +0000 (23:10 +0100)] 
build-sys: check HAVE_ definitions with #ifdef [smatch scan]

Fix to `warning: undefined preprocessor identifier' messages.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agobuild-sys: add missing headers to dist
Sami Kerola [Thu, 1 Dec 2011 22:10:20 +0000 (23:10 +0100)] 
build-sys: add missing headers to dist

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolibmount: add support for mount -a --fork
Karel Zak [Fri, 2 Dec 2011 17:20:34 +0000 (18:20 +0100)] 
libmount: add support for mount -a --fork

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: add "+" prefix for options pattern (e.g findmnt -O)
Karel Zak [Thu, 1 Dec 2011 17:28:42 +0000 (18:28 +0100)] 
libmount: add "+" prefix for options pattern (e.g findmnt -O)

Examples:

 * findmnt --fstab -O noauto
   Returns all entries where is not "auto" option (including entries
   with "noauto" option.

 * findmnt --fstab -O +noauto
   Returns all entries where is literally "noauto" option.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=758457
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: add -a to umount(8) sample
Karel Zak [Thu, 1 Dec 2011 15:47:26 +0000 (16:47 +0100)] 
libmount: add -a to umount(8) sample

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: add mnt_context_umount_next()
Karel Zak [Thu, 1 Dec 2011 15:45:53 +0000 (16:45 +0100)] 
libmount: add mnt_context_umount_next()

This is "umount -a" backend.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: improve verbose message
Karel Zak [Thu, 1 Dec 2011 15:42:42 +0000 (16:42 +0100)] 
libmount: improve verbose message

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoMerge branch 'login-utils' of https://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Tue, 29 Nov 2011 18:02:42 +0000 (19:02 +0100)] 
Merge branch 'login-utils' of https://github.com/kerolasa/lelux-utiliteetit

* 'login-utils' of https://github.com/kerolasa/lelux-utiliteetit: (23 commits)
  last: fix few compiler warnings
  setpwnam: remove non-ANSI definitions [smatch scan]
  last: possible buffer overflow fixed [smatch scan]
  vipw: fix coding style
  setpwnam: fix coding style
  selinux_utils: fix coding style
  newgrp: fix coding style
  logindefs: fix coding style
  islocal: fix coding style
  chsh: fix coding style
  chfn: fix coding style
  chfn, setpwnam: let config.h be in control of extensions in use
  chfn, chsh: new file pamfail.h for error printing
  chsh: build bug: do not override config.h definition
  chfn, chsh, setpwnam: get true/false from stdbool.h
  login: add version printing option
  newgrp: add version and help options
  vipw: stop printing non-sense version string
  vipw: use libc error printing facilities
  chsh: use libc error printing facilities
  ...

13 years agolibmount: add new exprimental umount(8)
Karel Zak [Tue, 29 Nov 2011 18:02:27 +0000 (19:02 +0100)] 
libmount: add new exprimental umount(8)

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoinclude,optutils: add option_to_longopt()
Karel Zak [Tue, 29 Nov 2011 17:21:49 +0000 (18:21 +0100)] 
include,optutils: add option_to_longopt()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: use USAGE_* from mount(8) sample
Karel Zak [Tue, 29 Nov 2011 17:06:21 +0000 (18:06 +0100)] 
libmount: use USAGE_* from mount(8) sample

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolast: fix few compiler warnings
Sami Kerola [Sat, 19 Nov 2011 20:52:38 +0000 (21:52 +0100)] 
last: fix few compiler warnings

Calling abort() as default seems appropriate as the default should be
impossible to reach.

last.c:355:3: warning: switch missing default case [-Wswitch-default]

And simple line removals.

last.c:110:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls]
last.c:111:15: warning: redundant redeclaration of 'optarg' [-Wredundant-decls]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agosetpwnam: remove non-ANSI definitions [smatch scan]
Sami Kerola [Sun, 13 Nov 2011 20:21:39 +0000 (21:21 +0100)] 
setpwnam: remove non-ANSI definitions [smatch scan]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolast: possible buffer overflow fixed [smatch scan]
Sami Kerola [Sun, 13 Nov 2011 20:20:13 +0000 (21:20 +0100)] 
last: possible buffer overflow fixed [smatch scan]

last.c +447 ttyconv(11) error: buffer overflow '(arg)' 3 <= 3

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agovipw: fix coding style
Sami Kerola [Sun, 13 Nov 2011 19:03:48 +0000 (20:03 +0100)] 
vipw: fix coding style

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agosetpwnam: fix coding style
Sami Kerola [Sun, 13 Nov 2011 18:54:14 +0000 (19:54 +0100)] 
setpwnam: fix coding style

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoselinux_utils: fix coding style
Sami Kerola [Sun, 13 Nov 2011 18:46:03 +0000 (19:46 +0100)] 
selinux_utils: fix coding style

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agonewgrp: fix coding style
Sami Kerola [Sun, 13 Nov 2011 18:40:23 +0000 (19:40 +0100)] 
newgrp: fix coding style

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agologindefs: fix coding style
Sami Kerola [Sun, 13 Nov 2011 18:34:46 +0000 (19:34 +0100)] 
logindefs: fix coding style

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoislocal: fix coding style
Sami Kerola [Sun, 13 Nov 2011 18:32:10 +0000 (19:32 +0100)] 
islocal: fix coding style

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agochsh: fix coding style
Sami Kerola [Wed, 23 Nov 2011 22:04:12 +0000 (23:04 +0100)] 
chsh: fix coding style

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agochfn: fix coding style
Sami Kerola [Wed, 23 Nov 2011 21:57:31 +0000 (22:57 +0100)] 
chfn: fix coding style

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agochfn, setpwnam: let config.h be in control of extensions in use
Sami Kerola [Wed, 23 Nov 2011 21:36:57 +0000 (22:36 +0100)] 
chfn, setpwnam: let config.h be in control of extensions in use

The autotools will set _GNU_SOURCE which removes necessity to have
any _*_SOURCE definition in *.c files.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agochfn, chsh: new file pamfail.h for error printing
Sami Kerola [Sun, 13 Nov 2011 17:18:33 +0000 (18:18 +0100)] 
chfn, chsh: new file pamfail.h for error printing

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolibmount: add sanitize_env() to mount(8) sample
Karel Zak [Tue, 29 Nov 2011 16:36:39 +0000 (17:36 +0100)] 
libmount: add sanitize_env() to mount(8) sample

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: remove magic constatnt from mount(8)
Karel Zak [Tue, 29 Nov 2011 15:58:44 +0000 (16:58 +0100)] 
libmount: remove magic constatnt from mount(8)

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodocs: add x-mount-mkdir to TODO file
Karel Zak [Tue, 29 Nov 2011 13:57:28 +0000 (14:57 +0100)] 
docs: add x-mount-mkdir to TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoagetty: map NL to CR-NL on output in initial termiossettings
Dennis Jensen [Thu, 24 Nov 2011 17:55:57 +0000 (18:55 +0100)] 
agetty: map NL to CR-NL on output in initial termiossettings

From: Jacoby Hickerson <hickersonjl@gmail.com>
Signed-off-by: Dennis Jensen <dennis.h.jensen@siemens.com>
13 years agoMerge branch 'master' of https://github.com/maurizio-lombardi/util-linux
Karel Zak [Mon, 28 Nov 2011 09:23:04 +0000 (10:23 +0100)] 
Merge branch 'master' of https://github.com/maurizio-lombardi/util-linux

* 'master' of https://github.com/maurizio-lombardi/util-linux:
  mkfs.minix: The total number of zones is limited to 65536 only on V1 filesystems
  mkfs.minix: Some bug fixes:
  mkfs.minix: The s_blocksize field of the MinixV3 superblock must be initialized with a valid block size, not the total number of blocks of the device!
  mkfs.minix: inode numbers are 32-bit wide in V3 filesystems
  mkfs.minix: In Minix V3 filesystems the maximum filename lenght is 60 chars and the dirsize is 64 bytes.
  mkfs.minix: Fix super_set_nzones()
  mkfs.minix: remove redundant code

13 years agolibmount: fix compiler warning [-Wimplicit-function-declaration]
Karel Zak [Mon, 28 Nov 2011 09:19:32 +0000 (10:19 +0100)] 
libmount: fix compiler warning [-Wimplicit-function-declaration]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodo: fix czech LABEL= translation
Karel Zak [Fri, 25 Nov 2011 09:38:16 +0000 (10:38 +0100)] 
do: fix czech LABEL= translation

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agochsh: build bug: do not override config.h definition
Sami Kerola [Sun, 13 Nov 2011 16:47:00 +0000 (17:47 +0100)] 
chsh: build bug: do not override config.h definition

The ONLY_LISTED_SHELLS is defined by --disable-chsh-only-listed
configuration option.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agochfn, chsh, setpwnam: get true/false from stdbool.h
Sami Kerola [Sun, 13 Nov 2011 16:36:55 +0000 (17:36 +0100)] 
chfn, chsh, setpwnam: get true/false from stdbool.h

Requires C99, which should not be a problem.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agologin: add version printing option
Sami Kerola [Sun, 13 Nov 2011 16:14:51 +0000 (17:14 +0100)] 
login: add version printing option

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agonewgrp: add version and help options
Sami Kerola [Sun, 13 Nov 2011 14:56:20 +0000 (15:56 +0100)] 
newgrp: add version and help options

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agovipw: stop printing non-sense version string
Sami Kerola [Sun, 13 Nov 2011 14:14:33 +0000 (15:14 +0100)] 
vipw: stop printing non-sense version string

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agovipw: use libc error printing facilities
Sami Kerola [Sun, 13 Nov 2011 14:12:44 +0000 (15:12 +0100)] 
vipw: use libc error printing facilities

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agochsh: use libc error printing facilities
Sami Kerola [Sun, 13 Nov 2011 13:41:38 +0000 (14:41 +0100)] 
chsh: use libc error printing facilities

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agochsh: align with howto-usage-function.txt
Sami Kerola [Sun, 13 Nov 2011 13:31:03 +0000 (14:31 +0100)] 
chsh: align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agochfn: use libc error printing facilities
Sami Kerola [Sun, 13 Nov 2011 13:17:25 +0000 (14:17 +0100)] 
chfn: use libc error printing facilities

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agochfn: align with howto-usage-function.txt
Sami Kerola [Sun, 13 Nov 2011 13:06:24 +0000 (14:06 +0100)] 
chfn: align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofallocate: clean up fallbacks for FALLOC_FL_* flags
Karel Zak [Wed, 23 Nov 2011 14:19:20 +0000 (15:19 +0100)] 
fallocate: clean up fallbacks for FALLOC_FL_* flags

Reported-by: Voelker, Bernhard <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: add mkfs.carmfs test for small FS with duplicate files
Karel Zak [Wed, 23 Nov 2011 13:10:51 +0000 (14:10 +0100)] 
tests: add mkfs.carmfs test for small FS with duplicate files

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agosmall bug in mkfs.cramfs + patch
Arnaud Mouiche [Thu, 17 Nov 2011 17:03:04 +0000 (18:03 +0100)] 
small bug in mkfs.cramfs + patch

mkfs.cramfs on version v2.17.2 has a small bug when dealing with very small
filesystems.  look at upstream code on git, and the issue is still here.
ex:

         $ cd /tmp
         $ mkdir content
         $ echo hello > content/a
         $ echo hello > content/b
         $ mkfs.cramfs content content.cramfs
         not enough space allocated for ROM image (4090 allocated, 4096 used)

Here is a patch for fixing (simply rounding to page size AFTER eleminating
doubles).

Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofallocate: add FALLOC_FL_PUNCH_HOLE support
Cong Wang [Fri, 18 Nov 2011 08:51:37 +0000 (16:51 +0800)] 
fallocate: add FALLOC_FL_PUNCH_HOLE support

Recent Linux kernel supports FALLOC_FL_PUNCH_HOLE in fallocate(2).
This patch adds FALLOC_FL_PUNCH_HOLE support to fallocate utility,
by introducing a new option -p|--punch-hole.

[kzak@redhat.com: - fix merge conflict in fallocate.1]

Cc: Karel Zak <kzak@redhat.com>
Cc: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoprlimit: s/amount/number/
Jim Meyering [Thu, 17 Nov 2011 07:44:48 +0000 (08:44 +0100)] 
prlimit: s/amount/number/

13 years agoprlimit: add support for executing a command
Bernhard Voelker [Wed, 16 Nov 2011 16:57:27 +0000 (17:57 +0100)] 
prlimit: add support for executing a command

prlimit.c: Alternatively to applying the limits to an existing process via the
--pid option, allow a command to be executed. Adapted usage() accordingly.

prlimit.1: mention new syntax.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
13 years agolibblkid: fix mac partition detection
Francesco Cosoleto [Tue, 22 Nov 2011 15:12:42 +0000 (16:12 +0100)] 
libblkid: fix mac partition detection

This fixes the buffer length passed to blkid_probe_get_buffer() calls,
and the block size byte order (on little-endian systems).

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agomount: enable fstab.d
Masatake YAMATO [Mon, 14 Nov 2011 13:47:53 +0000 (22:47 +0900)] 
mount: enable fstab.d

This patch makes mount command read fstab.d/*.fstab if the command
is built with --enable-libmount-mount.

[kzak@redhat.com: - add some info to fstab.5 and mount.8 man pages
                  - use error callback for tab parser]

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomkfs.minix: The total number of zones is limited to 65536 only on V1 filesystems
Maurizio Lombardi [Mon, 21 Nov 2011 19:30:40 +0000 (20:30 +0100)] 
mkfs.minix: The total number of zones is limited to 65536 only on V1 filesystems

13 years agomkfs.minix: Some bug fixes:
Maurizio Lombardi [Mon, 21 Nov 2011 19:16:57 +0000 (20:16 +0100)] 
mkfs.minix: Some bug fixes:

- Fix root inode initialization
- In V3 filesystems the maximum number of inodes is not 65536 but 2^32.

13 years agomkfs.minix: The s_blocksize field of the MinixV3 superblock must be
Maurizio Lombardi [Mon, 21 Nov 2011 19:00:48 +0000 (20:00 +0100)] 
mkfs.minix: The s_blocksize field of the MinixV3 superblock must be
initialized with a valid block size, not the total number of blocks
of the device!

13 years agomkfs.minix: inode numbers are 32-bit wide in V3 filesystems
Maurizio Lombardi [Mon, 21 Nov 2011 18:52:03 +0000 (19:52 +0100)] 
mkfs.minix: inode numbers are 32-bit wide in V3 filesystems

13 years agomkfs.minix: In Minix V3 filesystems the maximum filename lenght is 60
Maurizio Lombardi [Mon, 21 Nov 2011 18:46:26 +0000 (19:46 +0100)] 
mkfs.minix: In Minix V3 filesystems the maximum filename lenght is 60
chars and the dirsize is 64 bytes.

13 years agomkfs.minix: Fix super_set_nzones()
Maurizio Lombardi [Mon, 21 Nov 2011 18:42:42 +0000 (19:42 +0100)] 
mkfs.minix: Fix super_set_nzones()

Write the total number of zones in Super3.n_zones when
dealing with v3 filesystems.

13 years agomkfs.minix: remove redundant code
Maurizio Lombardi [Mon, 21 Nov 2011 18:35:40 +0000 (19:35 +0100)] 
mkfs.minix: remove redundant code

13 years agoflock: use O_RDWR as fallback if O_RDONLY returns EIO
Karel Zak [Mon, 21 Nov 2011 16:12:33 +0000 (17:12 +0100)] 
flock: use O_RDWR as fallback if O_RDONLY returns EIO

The commit 75aaee08f06b92d119ed827c53d1af5474eb16ff introduces
regression:

     $ echo '#!/bin/sh' > test.sh
     $ chmod a+rx test.sh
     $ flock -eon ./test.sh ./test.sh
     flock: ./test.sh: Text file busy

The lock file cannot be opened in read-write mode by default, because
then we cannot use flock(1) to lock executable files.

The read-write mode for lock files is necessary on NFSv4 where
flock(2) is emulated by by fcntl() -- this situation is possible to
detect by flock(2) EIO error.

This patch reverts the default to O_RDONLY and use O_RDWR only if EIO
error is detected.

Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoflock: timer code refactoring
Karel Zak [Mon, 21 Nov 2011 14:02:56 +0000 (15:02 +0100)] 
flock: timer code refactoring

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agologin: fix compiler warning [-Wreturn-type]
Karel Zak [Fri, 18 Nov 2011 12:19:21 +0000 (13:19 +0100)] 
login: fix compiler warning [-Wreturn-type]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add missing BUILD_PRLIMIT
Karel Zak [Fri, 18 Nov 2011 12:12:18 +0000 (13:12 +0100)] 
build-sys: add missing BUILD_PRLIMIT

Reported-by: Thorsten Kukuk <kukuk@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agologin: improve pam_setcred() usage
Karel Zak [Fri, 18 Nov 2011 11:26:19 +0000 (12:26 +0100)] 
login: improve pam_setcred() usage

Reported-by: Thorsten Kukuk <kukuk@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agocolumn: avoid memory overrun and/or use of uninitialized buffer
Jim Meyering [Wed, 16 Nov 2011 19:10:39 +0000 (20:10 +0100)] 
column: avoid memory overrun and/or use of uninitialized buffer

* text-utils/column.c (maketbl): Use the right starting point
and the right length when zeroing new memory after xrealloc.

13 years agoprlimit: don't share pointer for old and new in prlimit(2)
Karel Zak [Wed, 16 Nov 2011 12:30:05 +0000 (13:30 +0100)] 
prlimit: don't share pointer for old and new in prlimit(2)

This patch makes the code more robust. We should not share the same
pointer for old and new arguments for prlimit(2) syscall.

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoprlimit: avoid segfault due to array-out-of-bounds error
Karel Zak [Wed, 16 Nov 2011 12:21:40 +0000 (13:21 +0100)] 
prlimit: avoid segfault due to array-out-of-bounds error

Example:
$ prlimit -l -l -l -l -l -l -l -l -l -l -l -l -l -l -l -l -l -l -l
RESOURCE DESCRIPTION                         SOFT   HARD UNITS
MEMLOCK  max locked-in-memory address space 65536 262144 bytes
MEMLOCK  max locked-in-memory address space 65536 262144 bytes
...
Segmentation fault

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoprlimit: fix typo in man page, option --verbose
Bernhard Voelker [Mon, 14 Nov 2011 01:48:33 +0000 (02:48 +0100)] 
prlimit: fix typo in man page, option --verbose

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
13 years agoprlimit: replace lims[i] with pointer
Karel Zak [Wed, 16 Nov 2011 11:04:52 +0000 (12:04 +0100)] 
prlimit: replace lims[i] with pointer

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoprlimit: fix case when PID is given later
Bernhard Voelker [Wed, 16 Nov 2011 10:55:43 +0000 (11:55 +0100)] 
prlimit: fix case when PID is given later

 # prlimit --nofile=:4000 --pid $$

When the PID is given later than a partially given limit, then prlimit
used the current PID for getting the missing part (hard, soft) of the
limit.

Factored out the retrieval of the unknown limit from parse_prlim() to
new get_unknown_hardsoft() which is to be called by do_prlimit() based
on the struct prlimit member 'modify' set by add_prlim().

[kzak@redhat.com: - use prlimit->mofify as mask
                  - add soft vs. hard limit check from another
                    Bernhard's patch]

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoprlimit: fix error message
Karel Zak [Wed, 16 Nov 2011 09:54:07 +0000 (10:54 +0100)] 
prlimit: fix error message

 - differentiate between set and get operations
 - add limit name to the error message
 - remove PID from the message (whole util works always with only one
   PID, so this info is superfluous)

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoprlimit: show all limits if called without options
Bernhard Voelker [Mon, 14 Nov 2011 01:47:57 +0000 (02:47 +0100)] 
prlimit: show all limits if called without options

Fix option parsing: prlimit ran into usage() if called
without arguments which should only be done for surplus
arguments. Instead, it should display all limits.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
13 years agowipefs: add -t <list> option
Karel Zak [Tue, 15 Nov 2011 14:19:28 +0000 (15:19 +0100)] 
wipefs: add -t <list> option

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolib,match: split match_fstype() from libmount
Karel Zak [Tue, 15 Nov 2011 14:17:19 +0000 (15:17 +0100)] 
lib,match: split match_fstype() from libmount

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibblkid: export PTMAGIC also if only PTTYPE requested
Karel Zak [Tue, 15 Nov 2011 11:49:31 +0000 (12:49 +0100)] 
libblkid: export PTMAGIC also if only PTTYPE requested

Reported-by: David Zeuthen <davidz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: split delete_partition() off from dos_delete_partition()
Francesco Cosoleto [Mon, 14 Nov 2011 13:47:19 +0000 (14:47 +0100)] 
fdisk: split delete_partition() off from dos_delete_partition()

This accidentally fixes a mistake printing the "Partition n is deleted"
message as the 'i' variable get decremented or incremented in case of
logical partitions.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: avoid segfault validating a sgi label (boot/swap not set)
Francesco Cosoleto [Mon, 14 Nov 2011 13:47:18 +0000 (14:47 +0100)] 
fdisk: avoid segfault validating a sgi label (boot/swap not set)

swap_part or boot_part can be set to -1 when they don't exist.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: use ngettext() in str_units() for plural forms
Francesco Cosoleto [Mon, 14 Nov 2011 13:47:17 +0000 (14:47 +0100)] 
fdisk: use ngettext() in str_units() for plural forms

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agoswitch_root: umount mount points we cannot move with MNT_DETACH
Harald Hoyer [Mon, 14 Nov 2011 13:11:01 +0000 (14:11 +0100)] 
switch_root: umount mount points we cannot move with MNT_DETACH

If a mount point cannot be moved to the new root, umount it with
MNT_DETACH, so that it is lazy umounted and does not show up in
/proc/mounts anymore.

[kzak@redhat.com: - add MNT_DETACH macro fallback]

Signed-off-by: Harald Hoyer <harald@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: enable expert menu with SGI label
Francesco Cosoleto [Fri, 11 Nov 2011 10:12:11 +0000 (11:12 +0100)] 
fdisk: enable expert menu with SGI label

This allows the creation of a new label if the disk already has an existing
SGI disklabel without working around this problem such as creating a DOS
disklabel or overwriting with zero the partition table (problem reported in
'Gentoo Linux/MIPS Handbook').

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: rewrite print menu system
Francesco Cosoleto [Wed, 9 Nov 2011 18:04:12 +0000 (19:04 +0100)] 
fdisk: rewrite print menu system

DOS and SGI label menus are unchanged. BSD label command
descriptions change slightly to use a common form.

This also removes an useless menu entry in SUN label menu to
edit bsd disklabel.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: move command prompt code to a separate function
Francesco Cosoleto [Fri, 11 Nov 2011 10:12:09 +0000 (11:12 +0100)] 
fdisk: move command prompt code to a separate function

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: rename bselect, xselect functions
Francesco Cosoleto [Fri, 11 Nov 2011 10:12:08 +0000 (11:12 +0100)] 
fdisk: rename bselect, xselect functions

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agolib,tt: fix compiler warning [-Wreturn-type]
Karel Zak [Mon, 14 Nov 2011 12:30:12 +0000 (13:30 +0100)] 
lib,tt: fix compiler warning [-Wreturn-type]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoreadprifile: remove unnecessary optstring array
Karel Zak [Mon, 14 Nov 2011 12:28:50 +0000 (13:28 +0100)] 
readprifile: remove unnecessary optstring array

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoMerge branch 'sys-utils-3rd' of https://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Mon, 14 Nov 2011 12:25:36 +0000 (13:25 +0100)] 
Merge branch 'sys-utils-3rd' of https://github.com/kerolasa/lelux-utiliteetit

* 'sys-utils-3rd' of https://github.com/kerolasa/lelux-utiliteetit:
  ldattach: add default case to switches
  ldattach: convert debug macro to function
  ldattach: check numeric user inputs with strtol_or_err
  ldattach: align with howto-usage-function.txt
  ldattach: fix coding style
  docs: add long options to readprofile.8
  readprofile: fix coding style
  readprofile: use libc error printing facilities
  readprofile: add long options
  docs: align tunelp.8 with howto-man-page.txt
  docs: add long options to tunelp.8
  tunelp: add long options and align with howto-usage-function.txt
  tunelp: use libc error printing facilities
  tunelp: use symbolic exit values
  tunelp: fix coding style
  switch_root: add nls support
  switch_root: align with howto-usage-function.txt
  unshare: align with howto-usage-function.txt
  rtcwake: align with howto-usage-function.txt
  setsid: add long options and fix coding style

13 years agolibblkid: export info about PT magic strings
Karel Zak [Sun, 13 Nov 2011 20:25:12 +0000 (21:25 +0100)] 
libblkid: export info about PT magic strings

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibblkid: add BLKID_PARTS_MAGIC
Karel Zak [Fri, 11 Nov 2011 14:13:33 +0000 (15:13 +0100)] 
libblkid: add BLKID_PARTS_MAGIC

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomkswap: wipe all old signatures
Karel Zak [Fri, 11 Nov 2011 12:33:51 +0000 (13:33 +0100)] 
mkswap: wipe all old signatures

mkswap(8) zaps the begin of the device (1024 bytes) only. This is not
enough, because for example ReiserFS superblock is outside this area.

This patch add blkid_do_wipe() call to mkswap(8) and all block device
is scanned and all signature are removed.

Reported-by: Martin Pitt <martin.pitt@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodocs: update TODO file
Karel Zak [Fri, 11 Nov 2011 11:58:59 +0000 (12:58 +0100)] 
docs: update TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agowipefs: improve -a, use blkid_do_wipe()
Karel Zak [Fri, 11 Nov 2011 11:48:38 +0000 (12:48 +0100)] 
wipefs: improve -a, use blkid_do_wipe()

Some filesystems (e.g. FAT) is possible to detect in many ways -- for
example if a magic string is stored on more places on the device. The
current implementation always removes from the device only the firstly
detected possibility.

 # wipefs /dev/sdb1
 offset               type
 ----------------------------------------------------------------
 0x36                 vfat   [filesystem]
                      UUID:  D203-A7F4

 # wipefs -a /dev/sdb1
 8 bytes [46 41 54 31 36 20 20 20] erased at offset 0x36 (vfat)

 # wipefs /dev/sdb1
 offset               type
 ----------------------------------------------------------------
 0x0                  vfat   [filesystem]
                      UUID:  D203-A7F4

This patch fixes this issue:

 # wipefs -a /dev/sdb1
 8 bytes were erased at offset 0x00000036 (vfat): 46 41 54 31 36 20 20 20
 1 bytes were erased at offset 0x00000000 (vfat): eb
 2 bytes were erased at offset 0x000001fe (vfat): 55 aa

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibblkid: add blkid_do_wipe()
Karel Zak [Fri, 11 Nov 2011 11:41:35 +0000 (12:41 +0100)] 
libblkid: add blkid_do_wipe()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibblkid: don't call CDROM_GET_CAPABILITY for partitions
Karel Zak [Thu, 10 Nov 2011 19:18:54 +0000 (20:18 +0100)] 
libblkid: don't call CDROM_GET_CAPABILITY for partitions

Reported-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofsck.minix: fix zone_map memory allocation failure check
Francesco Cosoleto [Wed, 9 Nov 2011 15:57:28 +0000 (16:57 +0100)] 
fsck.minix: fix zone_map memory allocation failure check

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agolib,tt: add TT_FL_NOEXTREMES
Karel Zak [Thu, 10 Nov 2011 01:02:38 +0000 (02:02 +0100)] 
lib,tt: add TT_FL_NOEXTREMES

If you mark a column with TT_FL_NOEXTREMES flag then extremely
large fields will no have effect to column width. Foe example:

 without the TT_FL_NOEXTREMES flag for the 'AAA' column:

 AAA         BBB CCC  DDD
 aa          bbb ccc  ddd
 aaaaaaaaaaa  bb ccc  ddd
 aa           bb ccc  ddd
 aa           bb ccc  ddd

 with the flags:

 AAA  BBB CCC  DDD
 aa   bbb ccc  dddddddddd
 aaaaaaaaaaa
       bb ccc  dddddddd
 aa    bb ccc  dddddd
 aa    bb ccc  ddddddddd

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