]> err.no Git - util-linux/log
util-linux
14 years agofstrim: add new command
Lukas Czerner [Wed, 24 Nov 2010 23:05:37 +0000 (00:05 +0100)]
fstrim: add new command

fstrim is used on a mounted filesystem to discard (or "trim") blocks
which are not in use by the filesystem.  This is useful for
solid-state drives (SSDs) and thinly-provisioned storage

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: 256MiB is min size of btrfs
Karel Zak [Fri, 26 Nov 2010 12:40:51 +0000 (13:40 +0100)]
libblkid: 256MiB is min size of btrfs

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofallocate: fix typo
Karel Zak [Wed, 24 Nov 2010 22:16:01 +0000 (23:16 +0100)]
fallocate: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: fix lsblk building
Karel Zak [Wed, 24 Nov 2010 17:16:44 +0000 (18:16 +0100)]
build-sys: fix lsblk building

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolsblk: add new utility
Milan Broz [Wed, 24 Nov 2010 16:06:39 +0000 (17:06 +0100)]
lsblk: add new utility

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [strutils] move strmode() from namei.c to strutils.c
Karel Zak [Wed, 24 Nov 2010 15:41:20 +0000 (16:41 +0100)]
lib: [strutils] move strmode() from namei.c to strutils.c

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [xalloc] add xstrdup()
Karel Zak [Wed, 24 Nov 2010 15:39:15 +0000 (16:39 +0100)]
lib: [xalloc] add xstrdup()

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: apply new changes from tt.c
Karel Zak [Thu, 18 Nov 2010 20:06:27 +0000 (21:06 +0100)]
findmnt: apply new changes from tt.c

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [tt] add TT_FL_RIGHT, add columns list parser
Karel Zak [Thu, 18 Nov 2010 20:04:13 +0000 (21:04 +0100)]
lib: [tt] add TT_FL_RIGHT, add columns list parser

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [ismounted] don't wast time with mtab is /proc/mounts used
Karel Zak [Thu, 18 Nov 2010 20:03:02 +0000 (21:03 +0100)]
lib: [ismounted] don't wast time with mtab is /proc/mounts used

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: remove unused variable
Karel Zak [Tue, 23 Nov 2010 20:14:48 +0000 (21:14 +0100)]
libblkid: remove unused variable

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update TODO file
Karel Zak [Tue, 23 Nov 2010 20:10:48 +0000 (21:10 +0100)]
docs: update TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [strutils] general purpose string handling functions
Davidlohr Bueso [Tue, 16 Nov 2010 13:47:35 +0000 (10:47 -0300)]
lib: [strutils] general purpose string handling functions

This patch replaces a few functions used throughout the source:
* Renames getnum (from schedutils) to strtol_or_err
* Moves strtosize (from lib/strtosize.c)
* Moves xstrncpy (from include/xstrncpy.h)
* Adds strnlen, strnchr and strndup if not available (remove it from libmount utils)

A few Makefile.am files were modified to compile accordingly along with trivial renaming
in schedutils source code.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agolibblkid: cache is incorrectly revalidated
Karel Zak [Tue, 23 Nov 2010 18:49:58 +0000 (19:49 +0100)]
libblkid: cache is incorrectly revalidated

for example:

# echo "password" | cryptsetup luksFormat /dev/loop7
# blkid /dev/loop7
/dev/loop7: UUID="09240a80-1cf1-456d-9a6e-a35b39dc1f2b" TYPE="crypto_LUKS"

# pvcreate -ff /dev/loop7
# blkid /dev/loop7
#

the second blkid call has to return info about LVM.

Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: mark die() as nonreturn
Karel Zak [Tue, 23 Nov 2010 18:42:33 +0000 (19:42 +0100)]
mount: mark die() as nonreturn

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: ignore *context= options on remount
Karel Zak [Fri, 19 Nov 2010 12:37:25 +0000 (13:37 +0100)]
mount: ignore *context= options on remount

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=563267
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: update relatime description in mount.8
Karel Zak [Tue, 16 Nov 2010 09:17:02 +0000 (10:17 +0100)]
mount: update relatime description in mount.8

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=653705
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoagetty: use nl_langinfo()
Karel Zak [Mon, 15 Nov 2010 15:48:27 +0000 (16:48 +0100)]
agetty: use nl_langinfo()

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocal: follow HAVE_LANGINFO
Karel Zak [Mon, 15 Nov 2010 15:48:03 +0000 (16:48 +0100)]
cal: follow HAVE_LANGINFO

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: follow HAVE_LANGINFO
Karel Zak [Mon, 15 Nov 2010 15:47:13 +0000 (16:47 +0100)]
findmnt: follow HAVE_LANGINFO

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: add fallback for nl_langinfo()
Karel Zak [Mon, 15 Nov 2010 15:42:45 +0000 (16:42 +0100)]
lib: add fallback for nl_langinfo()

The fallback ignores locales and returns hardcoded static strings. It
should be enough to include "nls.h" to work with nl_langinfo() on all
systems.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib/tt: fix langinfo build break
Davidlohr Bueso [Mon, 15 Nov 2010 11:55:16 +0000 (08:55 -0300)]
lib/tt: fix langinfo build break

When HAVE_LANGINFO_H is not defined we break the compilation in tt.c:

  CC     tt.o
tt.c: In function ‘tt_new_table’:
tt.c:142: warning: implicit declaration of function ‘nl_langinfo’
tt.c:142: error: ‘CODESET’ undeclared (first use in this function)
tt.c:142: error: (Each undeclared identifier is reported only once
tt.c:142: error: for each function it appears in.)
make: *** [tt.o] Error 1

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agolibblkid: add blkid_probe_get_sectors()
Davidlohr Bueso [Thu, 11 Nov 2010 13:34:52 +0000 (10:34 -0300)]
libblkid: add blkid_probe_get_sectors()

This function allows users to obtain the device's 512-byte sector count.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agohwclock: [m68k] unbreak FTBFS with recent (>= 2.4.18?) kernels
Thorsten Glaser [Sun, 7 Nov 2010 14:00:04 +0000 (14:00 +0000)]
hwclock: [m68k] unbreak FTBFS with recent (>= 2.4.18?) kernels

The old KDGHWCLK ioctl was removed from the Linux kernel quite some
time ago. The kd.c source file of hwclock contains fallback code to
handle this, but the fallback code never could have compiled or was
not fixed along other code changes. The Linux kernel nowadays igno-
res the ioctl entirely so removing it unless provided by the kernel
headers, to keep it working on very old kernels, seems the sensible
thing to do, as the comments say m68k only and deprecated (which is
correct AFAICT).

According to pickaxe on gitweb, it was removed in 2002:
http://git.kernel.org/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commit;h=a915e414af5fc541ff62ef0bfec847457ae650bc

Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578168
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoswapon: better text for "discard", note about swapon in fstab.5
Karel Zak [Wed, 10 Nov 2010 10:48:30 +0000 (11:48 +0100)]
swapon: better text for "discard", note about swapon in fstab.5

Suggested by Hugh Dickins. Thanks.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: remove ipc.texi (info with IPC API docs)
Karel Zak [Tue, 9 Nov 2010 11:40:56 +0000 (12:40 +0100)]
docs: remove ipc.texi (info with IPC API docs)

The IPC API documentation is maintained in the standard man-pages. It does
not make sense to maintain this docs in util-linux-ng.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: add magic to vfat
Jeroen Oortwijn [Tue, 2 Nov 2010 21:13:12 +0000 (22:13 +0100)]
libblkid: add magic to vfat

Add the "FAT     " magic to vfat. There are devices that use this magic
in their FAT filesystem.

Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/491476
Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com>
14 years agocolumn: segfault on empty input
Karel Zak [Thu, 4 Nov 2010 21:22:49 +0000 (22:22 +0100)]
column: segfault on empty input

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=579955
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agosys-utils: make use xalloc wrappers
Davidlohr Bueso [Wed, 27 Oct 2010 09:14:46 +0000 (06:14 -0300)]
sys-utils: make use xalloc wrappers

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agolibblkid: add signature to FAT32 fsinfo block
Jeroen Oortwijn [Sun, 31 Oct 2010 20:32:21 +0000 (21:32 +0100)]
libblkid: add signature to FAT32 fsinfo block

Add 0x41645252 to the list of valid signatures of the FAT32 fsinfo
block. It isn't a valid signature, but there are devices that use this
signature in their FAT32 filesystem.

Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/589369
Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com>
14 years agoswapon: add "discard" support
Hugh Dickins [Mon, 25 Oct 2010 00:32:47 +0000 (17:32 -0700)]
swapon: add "discard" support

In kernel 2.6.36 (and in stable kernel 2.6.35.5) I made a tiny change
to the swapon(const char *path, int swapflags) system call interface:
kernel commit 3399446632739fcd05fd8b272b476a69c6e6d14a
swap: discard while swapping only if SWAP_FLAG_DISCARD

As things stand at present, we could just remove the swap discard
support; but since several filesystems (including ext4 and btrfs and
fat) are offering a "discard" mount option, I thought swap should take
the same course, and offer a "--discard" or "-d" option to swapon(8).

[kzak@redhat.com: - update swapon.8 man page
                  - use for -d the same logic as for -p]

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agorev: use xalloc for memory allocation
Davidlohr Bueso [Fri, 22 Oct 2010 15:26:24 +0000 (12:26 -0300)]
rev: use xalloc for memory allocation

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agoul: use xalloc for memory allocation
Davidlohr Bueso [Fri, 22 Oct 2010 15:25:46 +0000 (12:25 -0300)]
ul: use xalloc for memory allocation

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agocol: use err.h and EXIT_* macros
Karel Zak [Mon, 1 Nov 2010 13:51:08 +0000 (14:51 +0100)]
col: use err.h and EXIT_* macros

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocol: use xalloc for memory allocation
Davidlohr Bueso [Fri, 22 Oct 2010 15:24:37 +0000 (12:24 -0300)]
col: use xalloc for memory allocation

Differentiate between malloc and realloc (not done so far) and get rid of local warn()

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agotailf: use xalloc for memory allocation
Davidlohr Bueso [Fri, 22 Oct 2010 15:23:31 +0000 (12:23 -0300)]
tailf: use xalloc for memory allocation

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agomore: use xalloc for memory allocation
Davidlohr Bueso [Fri, 22 Oct 2010 15:22:56 +0000 (12:22 -0300)]
more: use xalloc for memory allocation

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agopg: use xalloc for memory allocation
Davidlohr Bueso [Fri, 22 Oct 2010 15:22:09 +0000 (12:22 -0300)]
pg: use xalloc for memory allocation

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agomount: use utimensat(AT_FDCWD) rather than open()+futimens()
Karel Zak [Fri, 29 Oct 2010 18:04:00 +0000 (20:04 +0200)]
mount: use utimensat(AT_FDCWD) rather than open()+futimens()

Thanks to Kay Sievers.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: add note about agetty to TODO
Karel Zak [Fri, 29 Oct 2010 15:51:35 +0000 (17:51 +0200)]
docs: add note about agetty to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoremove free() from atexit() callbacks
Karel Zak [Fri, 29 Oct 2010 11:29:28 +0000 (13:29 +0200)]
remove free() from atexit() callbacks

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agochrt: Add noreturn attribute to show_usage() function
Marek Polacek [Thu, 28 Oct 2010 23:04:30 +0000 (01:04 +0200)]
chrt: Add noreturn attribute to show_usage() function

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
14 years agouse _exit() instead of exit() in sighandlers
Marek Polacek [Thu, 28 Oct 2010 22:55:07 +0000 (00:55 +0200)]
use _exit() instead of exit() in sighandlers

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
14 years agoagetty: fix -s option (baud rate setup)
Karel Zak [Fri, 22 Oct 2010 19:24:50 +0000 (21:24 +0200)]
agetty: fix -s option (baud rate setup)

The problem is pretty visible in strace output:

broken version:
  ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0
  [...]
  ioctl(0, SNDCTL_TMR_START or TCSETS, {B0 -opost -isig -icanon -echo ...}) = 0
                                       ^^^
fixed version:
  ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0
  [...]
  ioctl(0, SNDCTL_TMR_START or TCSETS, {B115200 -opost -isig -icanon -echo ...}) = 0

Reported-by: Jon Masters <jcm@redhat.com>
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=645640
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofsck: add support for whole-disk locking (-l option)
Karel Zak [Tue, 26 Oct 2010 10:58:32 +0000 (12:58 +0200)]
fsck: add support for whole-disk locking (-l option)

This feature allows to call multiple independent fsck instances rather
than use only one "fsck -A" process.

The lock uses LOCK_EX flock(2). The lock request is ignored if the
whole-disk is non-rotating disk. The verbose mode (-V) provides
information about disk locking.

Note that "fsck -l" does not care if the device is stacked, for
example if you want to call "fsck -l /dev/md0" and "fsck -l /dev/md1"
then the underlying devices will not be locked. The traditional "fsck
-A" does not run in parallel for stacked devices.

Requested-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibmount: optimize blkid_devno_to_devname()
Karel Zak [Mon, 25 Oct 2010 21:23:48 +0000 (23:23 +0200)]
libmount: optimize blkid_devno_to_devname()

The brutal force /dev directory scanning should be used as a fallback
solution only. Currently, almost all systems use udev and we can read the
name from /sys/block/<maj>:<min> symlink.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoswapon: add support for "nofail" fstab mount option
Karel Zak [Mon, 25 Oct 2010 12:03:16 +0000 (14:03 +0200)]
swapon: add support for "nofail" fstab mount option

This option is already supported by mount(8) and fsck(8), there is no
reason to have any exception for swap devices. Note that the --ifexists
command line option applies to all swap devices, the "nofail" setting
is per device.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoumount: umount -r segfault
Karel Zak [Mon, 25 Oct 2010 10:26:28 +0000 (12:26 +0200)]
umount: umount -r segfault

umount(8) segfaults when update incomplete mtab file after remount to
read-only (-r). For example autofs does not store info about
mountpoint to /etc/mtab file.

# mount /dev/sda1 /mnt/test
# sed -i -e 's:/dev/sda1 .*::g' /etc/mtab
# cd /mnt/test
# umount -r /mnt/test
umount: /mnt/test busy - remounted read-only
Segmentation fault

The command "umount -r" should not care about /etc/mtab if the related
mtab entry does not exist.

Reported-by: Paul Crawford <psc@sat.dundee.ac.uk>
Addresses: https://bugs.launchpad.net/bugs/579858
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: add test program to canonicalize.c
Karel Zak [Fri, 22 Oct 2010 21:38:07 +0000 (23:38 +0200)]
lib: add test program to canonicalize.c

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: remove warning about FS detection from mount.1
Karel Zak [Thu, 21 Oct 2010 15:24:41 +0000 (17:24 +0200)]
mount: remove warning about FS detection from mount.1

The warning is from util-linux 2.7.1 (year 1996)... the filesystems
detection is pretty generic now.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoman: add russian translation of ddate.1
Karel Zak [Thu, 21 Oct 2010 13:00:47 +0000 (15:00 +0200)]
man: add russian translation of ddate.1

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoctrlaltdel: use err() instead of fprintf() and exit()
Marek Polacek [Sun, 17 Oct 2010 09:01:22 +0000 (11:01 +0200)]
ctrlaltdel: use err() instead of fprintf() and exit()

[kzak@redhat.com: - remove unnecessary program name from err(),
                  - use program_invocation_short_name]

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolook: fix conflict between locally defined err() and glibc's version
Davidlohr Bueso [Fri, 15 Oct 2010 17:23:16 +0000 (14:23 -0300)]
look: fix conflict between locally defined err() and glibc's version

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomisc-utils: use new xmalloc() wrapper
Davidlohr Bueso [Fri, 15 Oct 2010 14:59:18 +0000 (11:59 -0300)]
misc-utils: use new xmalloc() wrapper

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agoxalloc: general purpose memory allocation handling wrappers
Davidlohr Bueso [Fri, 15 Oct 2010 17:03:25 +0000 (14:03 -0300)]
xalloc: general purpose memory allocation handling wrappers

[kzak@redhat.com: - use %zu for size_t]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: fix memory leak
Igor Bazhitov [Sat, 9 Oct 2010 18:54:31 +0000 (22:54 +0400)]
libblkid: fix memory leak

search_type and search_handle fields of blkid_dev_iterate iterator are
not being freed after usage.
Add cleanup code.

Signed-off-by: Igor Bazhitov <igor.bazhitov@gmail.com>
14 years agocolumn: code readability improvements
Sami Kerola [Sat, 9 Oct 2010 17:59:50 +0000 (19:59 +0200)]
column: code readability improvements

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agocolumn: error messaging & exit codes
Sami Kerola [Sat, 9 Oct 2010 17:59:49 +0000 (19:59 +0200)]
column: error messaging & exit codes

Human understandable error messages along with symbolic exit
codes to comply with coding standard.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agocolumn: EOF handling bug
Sami Kerola [Sat, 9 Oct 2010 17:59:48 +0000 (19:59 +0200)]
column: EOF handling bug

For the last line of the file lenght of line should be determined
where the EOF is instead of new line. Old output was

$ printf "1 2\n3" | column -t
column: line too long
1 2

which this commit will change to

$ printf "1 2\n3" | column -t
1  2
3

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: fix MBR detection on iPod and cleanup vfat code
Karel Zak [Thu, 14 Oct 2010 23:33:28 +0000 (01:33 +0200)]
libblkid: fix MBR detection on iPod and cleanup vfat code

 - move all FAT code to superblocks/vfat.c only
 - add a generic function to verify FAT superblock and use it
   in FAT prober as well as in MBR parser
 - add a more robust FAT cluster_count check
   (it seems that iPod contains an "almost valid" FAT superblock before MBR)

Reported-by: Davidlohr Bueso <dave.bueso@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: consolidate magic strings detection code
Karel Zak [Thu, 14 Oct 2010 23:32:13 +0000 (01:32 +0200)]
libblkid: consolidate magic strings detection code

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopartx: integrate support for mac and sun partitions, based on kpartx.
Davidlohr Bueso [Thu, 7 Oct 2010 14:48:28 +0000 (10:48 -0400)]
partx: integrate support for mac and sun partitions, based on kpartx.

[kzak@redhat.com: - remove unnecessary members from struct slice,
                  - fix gcc warnings]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopartx: add sun partition table support
Davidlohr Bueso [Thu, 7 Oct 2010 14:48:22 +0000 (10:48 -0400)]
partx: add sun partition table support

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agopartx: add mac partition table support
Davidlohr Bueso [Thu, 7 Oct 2010 14:48:16 +0000 (10:48 -0400)]
partx: add mac partition table support

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agodocs: update TODO
Karel Zak [Thu, 7 Oct 2010 15:57:35 +0000 (17:57 +0200)]
docs: update TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: don't canonicalize "spec" with --no-canonicalize option
Miklos Szeredi [Thu, 7 Oct 2010 14:05:12 +0000 (16:05 +0200)]
mount: don't canonicalize "spec" with --no-canonicalize option

"Spec" was still canonicalized despite --no-canonicalize.  This
resulted in a hang during login with pam_encfs (Debian Bug#593336).

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
14 years agotests: update namei regression test
Karel Zak [Thu, 7 Oct 2010 08:37:03 +0000 (10:37 +0200)]
tests: update namei regression test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocal: use EXIT_* and program_invocation_short_name
Karel Zak [Thu, 7 Oct 2010 08:35:32 +0000 (10:35 +0200)]
cal: use EXIT_* and program_invocation_short_name

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolscpu: really use 'mode' argument in path_fopen()
Petr Uzel [Wed, 6 Oct 2010 14:03:34 +0000 (16:03 +0200)]
lscpu: really use 'mode' argument in path_fopen()

14 years agoflock: use more useful example in flock.1
Jakob Unterwurzacher [Wed, 6 Oct 2010 11:32:20 +0000 (13:32 +0200)]
flock: use more useful example in flock.1

The example in the man page does not prevent concurrent execution, as it
obtains a shared lock. More useful is taking an exclusive lock, i.e.
remove "-s".
Additionally, IMO most people want the script to exit when the lock
cannot be acquired, so adding "-n".

14 years agofindmnt: fix support for -a option
Milan Broz [Tue, 5 Oct 2010 15:38:43 +0000 (17:38 +0200)]
findmnt: fix support for -a option

Signed-off-by: Milan Broz <mbroz@redhat.com>
14 years agosfdisk: save errno before calling perror
Forest Bond [Tue, 5 Oct 2010 01:01:30 +0000 (21:01 -0400)]
sfdisk: save errno before calling perror

errno is saved into a local variable to avoid it getting trampled
by perror before it is checked to determine the return value.

This issue seems quite rare, but I have seen it when running sfdisk
via gksudo and using the --quiet command-line option.  From what I
can tell, this combination triggers loading of translations in perror,
which (at least on my machine) ends up changing the value of errno.

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
14 years agocolumn: update manual page to match column switches
Sami Kerola [Mon, 4 Oct 2010 18:57:58 +0000 (20:57 +0200)]
column: update manual page to match column switches

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocolumn: getopt_long and new help output
Sami Kerola [Mon, 4 Oct 2010 18:57:57 +0000 (20:57 +0200)]
column: getopt_long and new help output

[kzak@redhat.com: - remove __progname, cleanup usage()]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofallocate: fix build failure with old linux headers
Mike Frysinger [Sun, 3 Oct 2010 20:00:09 +0000 (16:00 -0400)]
fallocate: fix build failure with old linux headers

If linux/falloc.h does not exist, the build system still enables the
fallocate util, but ultimately fails when it tries to include the
header and use a define from it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agofsck: inform about nonexistent devices in verbose mode
Karel Zak [Thu, 7 Oct 2010 07:26:37 +0000 (09:26 +0200)]
fsck: inform about nonexistent devices in verbose mode

Reported-by: Serafeim Zanikolas <sez@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: add searching in attributes dir to BeFS
Jeroen Oortwijn [Wed, 22 Sep 2010 17:14:21 +0000 (19:14 +0200)]
libblkid: add searching in attributes dir to BeFS

Add searching for the be:volume_id attribute in the attributes directory
of the root directory. UUID is now always set when the root directory
contains the be:volume_id attribute.

Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com>
14 years agoswapon: warn if file owner is not root
Karel Zak [Thu, 7 Oct 2010 07:03:31 +0000 (09:03 +0200)]
swapon: warn if file owner is not root

Reported-by: Bernhard Voelker <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoumount: use strtosize() for offset=
Karel Zak [Thu, 7 Oct 2010 06:58:00 +0000 (08:58 +0200)]
umount: use strtosize() for offset=

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agonamei: parse all path arguments when an optarg path will fail
Sami Kerola [Thu, 30 Sep 2010 22:33:44 +0000 (00:33 +0200)]
namei: parse all path arguments when an optarg path will fail

Old implementation of namei listed path all the way to non-existing
file or directory, something like:

f: /usr/bin/nxdir/file
 d /
 d usr
 d bin
 ? nxdir - No such file or directory (2)

whiles the current implementation prints:

namei: failed to stat: /usr/bin/nxdir/file: No such file or directory

The new output it's not helpful. I am especially interested see where
the path is broken when a path is symlink to other path with symlink,
and few more like that, and something somewhere is broken.

[kzak@redhat.com: - coding style changes]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotaskset: proper numbers parsing
Karel Zak [Thu, 30 Sep 2010 21:27:42 +0000 (23:27 +0200)]
taskset: proper numbers parsing

Reported-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: eliminate redundant call to open()
Markus Rinne [Wed, 22 Sep 2010 19:11:54 +0000 (22:11 +0300)]
fdisk: eliminate redundant call to open()

Don't use open() in get_boot() if it's called with an argument try_only,
because the file has already been opened by the caller.

Signed-off-by: Markus Rinne <markus.ka.rinne@gmail.com>
14 years agomount: Don't call canonicalize_*(SPEC) for 9p
Sven Eckelmann [Sun, 26 Sep 2010 19:18:15 +0000 (21:18 +0200)]
mount: Don't call canonicalize_*(SPEC) for 9p

When calling "mount -t 9p -o trans=virtio foobar /mnt/bar" and foobar
exists in the current path, the 9p virtio transport driver will be
called with $CWD/foobar and fail with "9p: no channels available".

Similar problems exist with remote file servers
 "mount -t 9p 23.42.08.15 /mnt/bar"
and Plan 9 From User Space applications
 "mount -t 9p -o trans=unix,uname=$USER `namespace`/acme /mnt/bar"

A similar exception like for nfs, cifs and smbfs must be added for 9p.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
14 years agomount: avoid starting a man page line with a single quote
Chris Frost [Mon, 20 Sep 2010 17:27:19 +0000 (10:27 -0700)]
mount: avoid starting a man page line with a single quote

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: fix mount.8, shortname=mixed is now default for vfat
Petr Uzel [Mon, 20 Sep 2010 15:12:42 +0000 (17:12 +0200)]
mount: fix mount.8, shortname=mixed is now default for vfat

Since Linux kernel commit 955234755ce4a2c33cfc558912aa8f2148cc1fc6,
the default mode for vfat filesystem is 'shortname=mixed'.

Reported-by: Harald Koenig <koenig@linux.de>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
14 years agoddate: revert man page typo
Karel Zak [Thu, 30 Sep 2010 20:27:42 +0000 (22:27 +0200)]
ddate: revert man page typo

On Sat, Sep 18, 2010 at 03:10:52AM +0300, Anssi Hannula wrote:
> According to wikipedia [1] 'Holyday' was the correct spelling, I
> guess the first hunk should be reverted.
>
> [1] http://en.wikipedia.org/wiki/Discordian_calendar

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: rewrite is_readonly()
Karel Zak [Mon, 20 Sep 2010 11:10:36 +0000 (13:10 +0200)]
mount: rewrite is_readonly()

This new implementation is more optimistic and always calls access(2).
The fallback solution (modify atime by futimens(2)) should be used
very rarely.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoul: use atexit() to deallocate buffer, print errors by err()
Karel Zak [Fri, 17 Sep 2010 08:35:35 +0000 (10:35 +0200)]
ul: use atexit() to deallocate buffer, print errors by err()

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoul: fix memory leak.
Davidlohr Bueso [Mon, 30 Aug 2010 02:03:32 +0000 (22:03 -0400)]
ul: fix memory leak.

The 'obuf' variable is not being freed after usage and this includes
when SIGINTs occur, hence add some basic signal handling.

[kzak@redhat.com - remove if-before-free ]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolscpu: update lscpu.1 to include new additions.
Davidlohr Bueso [Mon, 30 Aug 2010 22:06:19 +0000 (18:06 -0400)]
lscpu: update lscpu.1 to include new additions.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agoddate: fix typo in ddate.1
Davidlohr Bueso [Thu, 2 Sep 2010 12:40:23 +0000 (08:40 -0400)]
ddate: fix typo in ddate.1

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agomount: add note about context= remount to mount.8
Karel Zak [Thu, 16 Sep 2010 22:09:38 +0000 (00:09 +0200)]
mount: add note about context= remount to mount.8

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: don't probe directories
Karel Zak [Wed, 15 Sep 2010 09:51:09 +0000 (11:51 +0200)]
libblkid: don't probe directories

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: better describe UUIDs usage in man pages
Karel Zak [Mon, 13 Sep 2010 09:43:14 +0000 (11:43 +0200)]
mount: better describe UUIDs usage in man pages

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=632373
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: don't ignore zero for SBMAGIC_OFFSET
Karel Zak [Tue, 7 Sep 2010 09:30:50 +0000 (11:30 +0200)]
libblkid: don't ignore zero for SBMAGIC_OFFSET

The side effect of this bug is that wipefs(8) does not report LUKS...

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: add blkid --list-all to TODO
Karel Zak [Tue, 7 Sep 2010 09:03:45 +0000 (11:03 +0200)]
docs: add blkid --list-all to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocfdisk: don't use size of device based on cylinders
Karel Zak [Mon, 6 Sep 2010 11:30:48 +0000 (13:30 +0200)]
cfdisk: don't use size of device based on cylinders

This patch is enough to make cfdisk usable on non-DOS disks where
partitioning is not based on CHS. cfdisk should not print error
messages for such disks.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=630340
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: don't swap source and target if the source is a tag
Karel Zak [Tue, 31 Aug 2010 10:24:00 +0000 (12:24 +0200)]
findmnt: don't swap source and target if the source is a tag

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: clean up fstab.5
Karel Zak [Mon, 30 Aug 2010 09:43:41 +0000 (11:43 +0200)]
mount: clean up fstab.5

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: add note about subtypes to fstab.5
Karel Zak [Mon, 30 Aug 2010 08:48:52 +0000 (10:48 +0200)]
mount: add note about subtypes to fstab.5

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