]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
14 years agolibblkid: use stuff from sysfs.h and at.h
Karel Zak [Mon, 16 May 2011 15:20:55 +0000 (17:20 +0200)] 
libblkid: use stuff from sysfs.h and at.h

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolsblk: use generic sysfs functions
Karel Zak [Mon, 16 May 2011 13:24:26 +0000 (15:24 +0200)] 
lsblk: use generic sysfs functions

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: add generic sysfs utils
Karel Zak [Mon, 16 May 2011 12:08:50 +0000 (14:08 +0200)] 
lib: add generic sysfs utils

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: use cached buffers for nested PT probing
Karel Zak [Mon, 16 May 2011 08:31:50 +0000 (10:31 +0200)] 
libblkid: use cached buffers for nested PT probing

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: make whole disk probing more robust
Karel Zak [Fri, 13 May 2011 13:07:56 +0000 (15:07 +0200)] 
libblkid: make whole disk probing more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: update for recent fdisk changes
Karel Zak [Fri, 13 May 2011 13:05:45 +0000 (15:05 +0200)] 
tests: update for recent fdisk changes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: cleanup prober initialization
Karel Zak [Fri, 13 May 2011 10:48:57 +0000 (12:48 +0200)] 
libblkid: cleanup prober initialization

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: cleanup flags
Karel Zak [Fri, 13 May 2011 10:28:12 +0000 (12:28 +0200)] 
libblkid: cleanup flags

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: remove note about obsolete volume_id library from man page
Karel Zak [Thu, 12 May 2011 16:32:08 +0000 (18:32 +0200)] 
mount: remove note about obsolete volume_id library from man page

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoblkid: don't read past end of FAT32 cluster chain
John Lindgren [Wed, 11 May 2011 18:32:18 +0000 (14:32 -0400)] 
blkid: don't read past end of FAT32 cluster chain

When looking for a volume label on a FAT32 filesystem, blkid does not
correctly handle special cluster values in the range 0x0FFFFFF8 to
0x0FFFFFFF, which mark the last cluster in a chain. As a result, it
begins to read [what it treats as] FAT entries from past the end of the
FAT. Depending on the data read, it may then try to parse random data
from the filesystem (including user files, free space, and other
directories) as though it were part of the root directory.

Because parsing stops early when a volume label is found, the problem
only occurs on filesystems without a volume label. When it occurs, it
may result in a long sequence of lseek and read calls; on an older IDE
drive with a 2 GB FAT32 partition, this amounted to around 3 seconds of
disk I/O.

After patching, blkid stop parsing as soon as it reaches a cluster value
greater than or equal to the number of entries in the FAT.

[kzak@redhat.com: - add le32_to_cpu()]

Signed-off-by: John Lindgren <john.lindgren@tds.net>
14 years agotests: add mount(8) test for fstab entries without options
Karel Zak [Wed, 11 May 2011 15:55:10 +0000 (17:55 +0200)] 
tests: add mount(8) test for fstab entries without options

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: -a segfaults when 4th field is omitted (mount options)
Karel Zak [Wed, 11 May 2011 14:57:27 +0000 (16:57 +0200)] 
mount: -a segfaults when 4th field is omitted (mount options)

 # echo 'tmpd /tmp/x tmpfs' >> /etc/fstab
 # mkdir /tmp/x
 # mount -a
 segfault

Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotaskset: make threads aware
Davidlohr Bueso [Tue, 10 May 2011 22:03:09 +0000 (18:03 -0400)] 
taskset: make threads aware

Add a new '-a' option to view/modify the CPU affinity for an entire
group of threads belonging to a given PID.  We create two new
functions, print_affinity() and do_taskset() for code simplification.

Example:

zeus@jilguero:~/src/util-linux/schedutils$ ./taskset -a -p 01 3142
pid 3142's current affinity mask: 2
pid 3142's new affinity mask: 1
pid 3164's current affinity mask: 2
pid 3164's new affinity mask: 1
pid 854's current affinity mask: 2
pid 854's new affinity mask: 1

[kzak@redhat.com: - clean up
                  - move variables to struct taskset]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Tested-by: Jonathan Gonzalez <zeus@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotaskset: use xalloc lib
Davidlohr Bueso [Mon, 9 May 2011 15:18:32 +0000 (11:18 -0400)] 
taskset: use xalloc lib

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agofdisk: accept digits-space-suffix format
Francesco Cosoleto [Mon, 9 May 2011 14:00:36 +0000 (16:00 +0200)] 
fdisk: accept digits-space-suffix format

This is for users who are used to separate with a space numbers from units.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agochrt.1: fix grammar
Davidlohr Bueso [Fri, 6 May 2011 18:23:10 +0000 (15:23 -0300)] 
chrt.1: fix grammar

Corrent the English grammar for the new -a option.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agofdisk: print logical partition number while adding it
Francesco Cosoleto [Tue, 10 May 2011 12:13:14 +0000 (14:13 +0200)] 
fdisk: print logical partition number while adding it

[kzak@redhat.com: - merged two Francesco's patches]

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agofdisk: quit from partition type dialog after invalid response
Francesco Cosoleto [Fri, 6 May 2011 15:23:33 +0000 (17:23 +0200)] 
fdisk: quit from partition type dialog after invalid response

This gets rid of the while() loop and fixes indentation.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agofdisk: add a default response for the partition type dialog
Francesco Cosoleto [Fri, 6 May 2011 15:23:32 +0000 (17:23 +0200)] 
fdisk: add a default response for the partition type dialog

The default response is 'p' until three primary partitions are created,
then 'e'.

The original idea is from Karel Zak.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agofdisk: change primary or extended partition type dialog
Francesco Cosoleto [Fri, 6 May 2011 15:23:31 +0000 (17:23 +0200)] 
fdisk: change primary or extended partition type dialog

Mainly this appends a colon for the prompt, reverses order of the list,
reports the number of primary partitions used and unused.

Old version:
 Command action
    e   extended
    p   primary partition (1-4)
 p

New version:
 Partition type:
    p   primary (0 primary, 0 extended, 4 free)
    e   extended
 Select: p

Old version:
 Command action
    l   logical (5 or over)
    p   primary partition (1-4)
 l

New version:
 Partition type:
    p   primary (0 primary, 1 extended, 3 free)
    l   logical (numbered from 5)
 Select: l

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agofindmnt: add columns description to the --help output
Karel Zak [Tue, 10 May 2011 10:06:39 +0000 (12:06 +0200)] 
findmnt: add columns description to the --help output

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopartx: add --pairs to output in key="value" format
Karel Zak [Tue, 10 May 2011 09:39:51 +0000 (11:39 +0200)] 
partx:  add --pairs to output in key="value" format

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: add --pairs to output in key="value" format
Karel Zak [Tue, 10 May 2011 09:16:41 +0000 (11:16 +0200)] 
findmnt: add --pairs to output in key="value" format

... usable in scripts, for example:

findmnt --pairs -o "SOURCE,TARGET,FSTYPE" $1 | while read line; do
        eval $line
        echo "$SOURCE is mounted on $TARGET [$FSTYPE]"
done

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: fix leak
Karel Zak [Tue, 10 May 2011 08:39:14 +0000 (10:39 +0200)] 
findmnt: fix leak

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolsblk: add --pairs to output in key="value" format
Karel Zak [Tue, 10 May 2011 08:38:29 +0000 (10:38 +0200)] 
lsblk: add --pairs to output in key="value" format

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [tt.c] support key="value" output format
Karel Zak [Tue, 10 May 2011 08:37:39 +0000 (10:37 +0200)] 
lib: [tt.c] support key="value" output format

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agosfdisk: returns non-zero on failed BLKRRPART ioctl
Andrea Galbusera [Tue, 3 May 2011 13:47:38 +0000 (15:47 +0200)] 
sfdisk: returns non-zero on failed BLKRRPART ioctl

Make sfdisk(8) return non-zero value on failed BLKRRPART ioctl().
This will happen for either partition table re-reads after partition
changes or on explicit use of -R switch.

The function reread_disk_partition() was changed from 'void' to 'int'
and now returns a result to let the calling functions decide to exit(1).

Signed-off-by: Andrea Galbusera <gizero@gmail.com>
14 years agolibblkid: ignore hfsplus superblocks with blocksize < 512
Karel Zak [Fri, 6 May 2011 11:00:07 +0000 (13:00 +0200)] 
libblkid: ignore hfsplus superblocks with blocksize < 512

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: validate hfs blocksize != 0
Timo Warns [Fri, 6 May 2011 09:04:24 +0000 (11:04 +0200)] 
libblkid: validate hfs blocksize != 0

Validate that blocksize != 0 as a blocksize == 0 can cause
a division-by-zero error.

Signed-off-by: Timo Warns <warns@pre-sense.de>
14 years agodocs: update TODO file
Karel Zak [Thu, 5 May 2011 12:56:53 +0000 (14:56 +0200)] 
docs: update TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoaddpart: multiplication on 512 deleted
Anton V. Boyarshinov [Thu, 5 May 2011 10:31:09 +0000 (14:31 +0400)] 
addpart: multiplication on 512 deleted

Multiplication on 512 now placed in partx/kpartx.h in '<< 9' form.
Double moutiplication causes an error.

14 years agochrt: allow to use --all-tasks when retrieve info
Karel Zak [Thu, 5 May 2011 12:23:22 +0000 (14:23 +0200)] 
chrt: allow to use --all-tasks when retrieve info

master thread:
 $ chrt --pid $(pidof firefox)

all threads:
 $ chrt --all-tasks --pid $(pidof firefox)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agochrt: make threads aware
Davidlohr Bueso [Thu, 5 May 2011 12:02:34 +0000 (14:02 +0200)] 
chrt: make threads aware

Currently this program works only with the master thread. Add a '-t'
option to propagate changes to the entire group of threads.

Example:

root@offworld:~/projects/util-linux/schedutils# ls /proc/2111/task/
2111  2112  2119  2121  2138  2139  2159  2160
root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2111
pid 2111's current scheduling policy: SCHED_RR
pid 2111's current scheduling priority: 3
root@offworld:~/projects/util-linux/schedutils# ./chrt -t -p 2 2111
root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2112
pid 2112's current scheduling policy: SCHED_RR
pid 2112's current scheduling priority: 2
root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2111
pid 2111's current scheduling policy: SCHED_RR
pid 2111's current scheduling priority: 2

[kzak@redhat.com: - rename -t/--thread to -a/--all-tasks]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoprocutils: include missing header
Davidlohr Bueso [Wed, 4 May 2011 17:40:14 +0000 (14:40 -0300)] 
procutils: include missing header

To be able to use DIR we need to include the dirent.h header. This fixes issues such as:

../include/procutils.h:5: error: syntax error before "DIR"
../include/procutils.h:5: warning: no semicolon at end of struct or union

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agolsblk: add support for discard topology (-D option)
Martin K. Petersen [Wed, 4 May 2011 15:16:05 +0000 (11:16 -0400)] 
lsblk: add support for discard topology (-D option)

I got tired of poking around in sysfs to find the discard topology.
Here's a patch against lsblk that adds a -D option to present this
information in a human-readable form:

NAME                  DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sda                          0        0B       0B         0
└─sda1                       0        0B       0B         0
sdb                          0      512B       2G         1
└─sdb1                       0      512B       2G         1

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [procutils.c]: add missing files. Sorry.
Karel Zak [Wed, 4 May 2011 13:52:39 +0000 (15:52 +0200)] 
lib: [procutils.c]: add missing files. Sorry.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [procutils.c]: general purpose procfs parsing functions
Davidlohr Bueso [Tue, 3 May 2011 18:57:01 +0000 (15:57 -0300)] 
lib: [procutils.c]: general purpose procfs parsing functions

We include the following functions as a first approach:

  - proc_open_tasks(): allocate resources and setup basic data
  - proc_next_tid(): iterate over the thread group
  - proc_close_tasks(): free used resources

[kzak@redhat.com: - free() on error in proc_open_tasks(),
                  - always call free() in proc_close_tasks()
                  - ignore non-digit dirs and return 1 on end-of-dir
                    in proc_next_tid()]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomkfs.minix: remove die()
Davidlohr Bueso [Wed, 13 Apr 2011 13:37:55 +0000 (10:37 -0300)] 
mkfs.minix: remove die()

Get rid of this function and use errx(3) instead. This patch also
introduces a mkfs.h header and defines general purpose mkfs related
exit codes.

[kzak@redhat.com: - fix "warning: too many arguments for format" errors]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: improve error message for missing extended partition
Francesco Cosoleto [Thu, 28 Apr 2011 21:39:30 +0000 (23:39 +0200)] 
fdisk: improve error message for missing extended partition

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agofdisk: fix "invalid partition number for type" error message
Francesco Cosoleto [Thu, 28 Apr 2011 21:39:29 +0000 (23:39 +0200)] 
fdisk: fix "invalid partition number for type" error message

You can't input a partition number here.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agodocs: add Matej to AUTHORS
Karel Zak [Mon, 2 May 2011 11:36:20 +0000 (13:36 +0200)] 
docs: add Matej to AUTHORS

The original idea to have something like fallocate(1) is from Matej
Cepl -- his mkfile(1) prototype has been originally discussed on
coreutil mailing list. Thanks!

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: agetty manual update
Sami Kerola [Tue, 26 Apr 2011 19:29:01 +0000 (21:29 +0200)] 
docs: agetty manual update

Tell users how to see what issue escape will print by using other
commands, such as uname.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agoagetty.c: move issue path to pathnames.h
Sami Kerola [Tue, 26 Apr 2011 19:29:00 +0000 (21:29 +0200)] 
agetty.c: move issue path to pathnames.h

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agoagetty.c: further scrubbing
Sami Kerola [Tue, 26 Apr 2011 19:28:59 +0000 (21:28 +0200)] 
agetty.c: further scrubbing

In reply to two requests.

http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/3990
http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/3999

The scubbing consists;

o Old school introduction back to the top of the source file.
o Indentation changes.
o Removal of void casting.
o Removal of braces from single statements.
o Unified format for comments.
o Comparison with W. Venema's code from 1993 to clean few comment
  mysteries.
o Web referrals added to further explanation to near the code or
  comments which some could find difficult to understand why.
o Clean up of comments.
o FIXME items added where attention is needed.
o Make functions static.
o Functions with same argument types use same argument order.
o Get rid of classic K&R style function declarations.

Please notice that this patch _should not_ affect how program
works e.g. this has no actual code changes.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agofindmnt: minor coding style changes
Karel Zak [Wed, 27 Apr 2011 21:04:21 +0000 (23:04 +0200)] 
findmnt: minor coding style changes

 * remove __<MACRONAME> from code
 * use 'static' for global variables

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: filter filesystems and actions for --poll
Karel Zak [Wed, 27 Apr 2011 20:39:44 +0000 (22:39 +0200)] 
findmnt: filter filesystems and actions for --poll

The patch allows to filter by:

 * actions name:
$ findmnt --poll=umount

 * target, source, fstype, options:
$ findmnt --poll /mnt/test
$ findmnt --poll -O ro
$ findmnt --poll -t ext4

 * --first-only option to wait only for the first matching change:

$ findmnt --poll=umount --first-only /mnt/test

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: print OLD-* columns only when necessary
Karel Zak [Wed, 27 Apr 2011 16:09:16 +0000 (18:09 +0200)] 
findmnt: print OLD-* columns only when necessary

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: add --poll and --timeout to the man page
Karel Zak [Wed, 27 Apr 2011 16:07:39 +0000 (18:07 +0200)] 
findmnt: add --poll and --timeout to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: add --timeout option
Karel Zak [Wed, 27 Apr 2011 15:39:25 +0000 (17:39 +0200)] 
findmnt: add --timeout option

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: add --poll option
Karel Zak [Wed, 27 Apr 2011 15:19:04 +0000 (17:19 +0200)] 
findmnt: add --poll option

The --poll functionality is based on poll(/proc/self/mountinfo) and
mnt_tabdiff_* functions from libmount.

 $ findmnt --poll
 ACTION     TARGET    SOURCE    FSTYPE OPTIONS
 mount      /mnt/test /dev/sda1 ext3   rw,relatime,errors=continue,user_xattr,acl,barrier=0,data=ordered

... after "mount /dev/sda1 /mnt/test".

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibmount: minor fix to mnt_tabdiff_*
Karel Zak [Wed, 27 Apr 2011 15:17:16 +0000 (17:17 +0200)] 
libmount: minor fix to mnt_tabdiff_*

 - tabdiff has to support NULL fs->source
 - disable some debug messages

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [tt.c] support fixed width and multiple tt_print_table() calls
Karel Zak [Wed, 27 Apr 2011 15:15:36 +0000 (17:15 +0200)] 
lib: [tt.c] support fixed width and multiple tt_print_table() calls

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibmount: add mnt_tabdiff_* functions
Karel Zak [Tue, 26 Apr 2011 15:33:43 +0000 (17:33 +0200)] 
libmount: add mnt_tabdiff_* functions

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibmount: add mnt_reset_table()
Karel Zak [Tue, 26 Apr 2011 14:34:16 +0000 (16:34 +0200)] 
libmount: add mnt_reset_table()

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibmount: support NULL source path for mnt_table_find_* functions
Karel Zak [Tue, 26 Apr 2011 14:32:09 +0000 (16:32 +0200)] 
libmount: support NULL source path for mnt_table_find_* functions

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: non-linux fixup
Samuel Thibault [Wed, 20 Apr 2011 13:57:12 +0000 (15:57 +0200)] 
build-sys: non-linux fixup

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
14 years agolibmount: add support for x-* mount comments
Karel Zak [Thu, 21 Apr 2011 12:53:23 +0000 (14:53 +0200)] 
libmount: add support for x-* mount comments

The current way how add any comment or extra information to /etc/fstab
is to use comment="" mount option. This is not too elegant and readable
if you want to add more than one comment.

It seems better to add any generic prefix that will be used for all
3rd-party userspace mount options.

Expected syntax is:

  x-<application>-<options>[=<data>]

For example:

  x-systemd-bar=managed

All x-* options (as well as comment=) are ignored by libmount and not
stored to the mtab file.

Requested-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: don't run mount/regfile test on old kernel
Karel Zak [Tue, 19 Apr 2011 11:39:35 +0000 (13:39 +0200)] 
tests: don't run mount/regfile test on old kernel

The /sys/.../loop/backing_file is available since 2.6.37.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add test for RLIMIT_FSIZE issue
Karel Zak [Tue, 19 Apr 2011 10:22:06 +0000 (12:22 +0200)] 
tests: add test for RLIMIT_FSIZE issue

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: use libmount tab update tests for UID=0 only
Karel Zak [Tue, 19 Apr 2011 08:04:33 +0000 (10:04 +0200)] 
tests: use libmount tab update tests for UID=0 only

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agogetopt: fix gcc warning
Karel Zak [Tue, 19 Apr 2011 07:22:16 +0000 (09:22 +0200)] 
getopt: fix gcc warning

getopt.c:80:13: warning: ‘set_initial_shell’ declared ‘static’ but
never defined

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomesg: add \n to usage() output
Karel Zak [Thu, 14 Apr 2011 15:16:30 +0000 (17:16 +0200)] 
mesg: add \n to usage() output

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomesg: man page clean wqup
Karel Zak [Thu, 14 Apr 2011 15:11:23 +0000 (17:11 +0200)] 
mesg: man page clean wqup

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomesg: new --verbose option
Sami Kerola [Sun, 10 Apr 2011 14:24:23 +0000 (16:24 +0200)] 
mesg: new --verbose option

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agomesg: add long options to the man page
Sami Kerola [Sun, 10 Apr 2011 14:24:22 +0000 (16:24 +0200)] 
mesg: add long options to the man page

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agomesg: use long options, also --help and --version added
Sami Kerola [Sun, 10 Apr 2011 14:24:21 +0000 (16:24 +0200)] 
mesg: use long options, also --help and --version added

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agoagetty: coding style - fix identation
Karel Zak [Thu, 14 Apr 2011 11:43:11 +0000 (13:43 +0200)] 
agetty: coding style - fix identation

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoagetty: coding style - fix comments, remove tailing whitespace
Karel Zak [Thu, 14 Apr 2011 11:25:57 +0000 (13:25 +0200)] 
agetty: coding style - fix comments, remove tailing whitespace

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoagetty: getopt case segment reordering
Sami Kerola [Sun, 10 Apr 2011 10:16:15 +0000 (12:16 +0200)] 
agetty: getopt case segment reordering

The case clause after getopts is in alphabetical order, just like
option string definition and manual page. The patch also convers
spaces to tabs in this code block.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agodocs: agetty long options
Sami Kerola [Sun, 10 Apr 2011 10:16:14 +0000 (12:16 +0200)] 
docs: agetty long options

Long options to manual page with the new --version and --help.
The manual page option order is also set to be the same as it is
in code. For the persons who don't see the order it is short
option case in sensitive alphabetical order.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agoagetty: symbolic standard file descriptors
Sami Kerola [Sun, 10 Apr 2011 10:16:13 +0000 (12:16 +0200)] 
agetty: symbolic standard file descriptors

I find it easier to read code in which standard file descriptors
are symbolic strings rather than numbers.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agoagetty: #endif comments
Sami Kerola [Sun, 10 Apr 2011 10:16:12 +0000 (12:16 +0200)] 
agetty: #endif comments

The longer #ifdef ... #endif markups have now at the end section
comment where they begun, which should improve preprosessor
directive readability.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agoagetty: error message about required arguments
Sami Kerola [Sun, 10 Apr 2011 10:16:11 +0000 (12:16 +0200)] 
agetty: error message about required arguments

This patch also fixes only remaining magical number to EXIT_*
markup.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agoagetty: use long options
Sami Kerola [Sun, 10 Apr 2011 10:16:10 +0000 (12:16 +0200)] 
agetty: use long options

This patch will introducing --help and --version options, which
does not have short version. Reason to this is a that the -h was
already assigned.

[kzak@redhat.com: - fix one usage call,
                  - use %1$s in usage printf format
                  - remove "static const" from enum]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoagetty: use program_invocation_short_name
Sami Kerola [Sun, 10 Apr 2011 10:16:09 +0000 (12:16 +0200)] 
agetty: use program_invocation_short_name

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agoagetty: use xalloc.h
Sami Kerola [Sun, 10 Apr 2011 10:16:08 +0000 (12:16 +0200)] 
agetty: use xalloc.h

Unifies and fixes malloc and strdup calls.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agolibmount: use libmnt_lock for utab flock
Karel Zak [Wed, 13 Apr 2011 14:27:18 +0000 (16:27 +0200)] 
libmount: use libmnt_lock for utab flock

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibmount: merge mtab and utab locking code
Karel Zak [Wed, 13 Apr 2011 13:38:10 +0000 (15:38 +0200)] 
libmount: merge mtab and utab locking code

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibmount: block signals when update utab
Karel Zak [Wed, 13 Apr 2011 12:37:44 +0000 (14:37 +0200)] 
libmount: block signals when update utab

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibmount: more robust mtab and utab update (CVE-2011-1676, CVE-2011-1677)
Karel Zak [Wed, 13 Apr 2011 09:02:34 +0000 (11:02 +0200)] 
libmount: more robust mtab and utab update (CVE-2011-1676, CVE-2011-1677)

http://thread.gmane.org/gmane.comp.security.oss.general/4374

Changes:

 - always use temporary file

 - use fflush() for the temporary file

 - check fprintf() return value

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: use lock from mnt_update_table()
Karel Zak [Wed, 13 Apr 2011 08:49:26 +0000 (10:49 +0200)] 
mount: use lock from mnt_update_table()

The mnt_update_table() is able to create a mtab lock now.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoumount: block signals when umounting and updating mtab (CVE-2011-1676, CVE-2011-1677)
Karel Zak [Wed, 13 Apr 2011 08:11:50 +0000 (10:11 +0200)] 
umount: block signals when umounting and updating mtab (CVE-2011-1676, CVE-2011-1677)

http://thread.gmane.org/gmane.comp.security.oss.general/4374

Based on CVE-2011-1089.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: use fflush() and temporary file for mtab updates (CVE-2011-1089)
Karel Zak [Tue, 12 Apr 2011 20:52:33 +0000 (22:52 +0200)] 
mount: use fflush() and temporary file for mtab updates (CVE-2011-1089)

http://thread.gmane.org/gmane.comp.security.oss.general/4374

Changes:

  - force mount(8) to use /etc/mtab.tmp file every time. The original
    code used the tmp file for remount/move operations only.

  - call and check fflush() return code for the tmp file

Note mount(8) blocks all signals when writing to mtab, so it's not
affected by SIGXFSZ and the mtab lock file is always removed.

This patch does not fix the same issue in umount(8) and libmount.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: remove test for non-zero head count in FAT superblock probe.
Nick Holloway [Sun, 10 Apr 2011 12:35:56 +0000 (13:35 +0100)] 
libblkid: remove test for non-zero head count in FAT superblock probe.

This change enables the auto-detection of the internal storage on a VTech
Kidizoom camera, which has a zero head count value in the superblock.

Microsoft documentation, "FAT: General Overview of On-Disk Format", states
that the sectors and heads fields are only relevant for media that have
a geometry.

The Linux kernel also does not require a non-zero head count, and can
manually mount the filesystem.

Signed-off-by: Nick Holloway <Nick.Holloway@pyrites.org.uk>
14 years agoscript: optional timing output file argument added
Sami Kerola [Sat, 9 Apr 2011 19:40:45 +0000 (21:40 +0200)] 
script: optional timing output file argument added

And update to manual page accordingly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agodocs: scriptreplay add note about new options
Sami Kerola [Sat, 9 Apr 2011 19:40:44 +0000 (21:40 +0200)] 
docs: scriptreplay add note about new options

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agoscriptreplay: allow arguments as command line switches
Sami Kerola [Sat, 9 Apr 2011 19:40:43 +0000 (21:40 +0200)] 
scriptreplay: allow arguments as command line switches

The command line switches override old style arguments

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: scriptreplay mention basic long options
Sami Kerola [Sat, 9 Apr 2011 19:40:42 +0000 (21:40 +0200)] 
docs: scriptreplay mention basic long options

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agoscriptreplay: support long options
Sami Kerola [Sat, 9 Apr 2011 19:40:41 +0000 (21:40 +0200)] 
scriptreplay: support long options

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoscriptreplay: end printing with new line
Sami Kerola [Sat, 9 Apr 2011 19:40:40 +0000 (21:40 +0200)] 
scriptreplay: end printing with new line

Depending on opinion this is either modest bug fix or tiny
improvement.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
14 years agolibmount: avoid redundant declaration of mnt_context_do_umount
Jan Engelhardt [Sat, 9 Apr 2011 12:11:35 +0000 (14:11 +0200)] 
libmount: avoid redundant declaration of mnt_context_do_umount

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agomkswap: add alignment check
Davidlohr Bueso [Sat, 9 Apr 2011 00:20:53 +0000 (21:20 -0300)] 
mkswap: add alignment check

This patch produces the program to warn if the given device is misaligned.

[kzak@redhat.com: - call the check for block devices only]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoblkdev: add blkdev_is_misaligned()
Davidlohr Bueso [Sat, 9 Apr 2011 00:20:49 +0000 (21:20 -0300)] 
blkdev: add blkdev_is_misaligned()

This functions returns the status of the device's alignment. It will
be 0 when aligned, otherwise return the offset.

[kzak@redhat.com: - returns 0 if the ioctl failed]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agohexdump: don't include err.h directly
Karel Zak [Tue, 12 Apr 2011 10:58:17 +0000 (12:58 +0200)] 
hexdump: don't include err.h directly

14 years agoscript: don't include err.h directly
Karel Zak [Tue, 12 Apr 2011 10:57:56 +0000 (12:57 +0200)] 
script: don't include err.h directly

14 years agoiosize: fix gcc warning
Karel Zak [Tue, 12 Apr 2011 10:37:57 +0000 (12:37 +0200)] 
iosize: fix gcc warning

isosize.c: In function ‘main’:
isosize.c:168:8: warning: unused variable ‘p’

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoelvtune, isosize: print usage text in case of invalid option
Francesco Cosoleto [Fri, 8 Apr 2011 13:51:50 +0000 (15:51 +0200)] 
elvtune, isosize: print usage text in case of invalid option

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agoisosize: use program_invocation_short_name
Francesco Cosoleto [Fri, 8 Apr 2011 13:51:49 +0000 (15:51 +0200)] 
isosize: use program_invocation_short_name

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agoisosize: simplify some error messages
Francesco Cosoleto [Fri, 8 Apr 2011 13:51:48 +0000 (15:51 +0200)] 
isosize: simplify some error messages

perror() and fprintf() are replaced with err() calls

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoelvtune, isosize: remove redundant message in case of invalid option
Francesco Cosoleto [Fri, 8 Apr 2011 13:51:47 +0000 (15:51 +0200)] 
elvtune, isosize: remove redundant message in case of invalid option

This leaves getopt() only to print a similar error message on invalid
options.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>