Commit Graph

8194 Commits

Author SHA1 Message Date
Karel Zak 8a2ab0eee8 docs: update v2.25-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-02 11:38:19 +02:00
Karel Zak 2d5c127b4d docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-02 11:35:53 +02:00
Karel Zak 21dcf21ab7 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-02 11:33:31 +02:00
Karel Zak f3135f939d lib/ismounted: more robust buffer usage [clang-analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 13:51:32 +02:00
Karel Zak 1bf9e264e2 fsck: uninitialized argument value [clang-analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 13:48:01 +02:00
Karel Zak 1671b2ed1a libfdisk: fix possible memory leak [clang-analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 13:36:37 +02:00
Karel Zak a1da27a8c0 cfdisk: fix division by zero [clang-analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 13:25:46 +02:00
Karel Zak f3438ee801 libblkid: fix probe_ddf() [clang-analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 12:32:25 +02:00
Karel Zak 23deb5aca0 findmnt: simplify cache_set_targets()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 10:36:40 +02:00
Karel Zak 8642cd7b0f libmount: always use mnt_resolve_target() in mnt_fs_match_target()
The requested path is also target mountpoint, so let's optimize
realpath() usage as well.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 10:34:09 +02:00
Eric Rannaud fb329bbc04 findmnt: use mnt_cache_set_targets() for non-kernel table
findmnt compares the user-supplied path <target> with each entry in the
parsed table. To do this comparison, libmount attempts to canonicalize
the target path of each table entry, when the entry does not originate
from the kernel (kernel supplied target paths are already
canonicalized). However, if one of these entries is an active mount
point, stat(2) or readlink(2) on the mount target path can hang (e.g.
unreachable NFS server).

If the main table is not a kernel table, we parse /proc/self/mountinfo
into a secondary table and call mnt_cache_set_targets(). This allows
libmount to check that the target path of each entry in the main table
is not an active mount point, so it can avoid canonicalizing it.

Signed-off-by: Eric Rannaud <e@nanocritical.com>
2014-07-01 10:05:16 +02:00
Eric Rannaud 0382ba32ed libmount: mnt_resolve_target: tiptoe around active mount points
Current code in mnt_fs_match_target() and mnt_table_find_target()
already does not canonicalize active mount points (when read from
mountinfo), because they are already canonicalized by the kernel.
Calling realpath(fs->target) on a mount point can hang -- e.g. if the
NFS server is unreachable.

This patch optionally extends this strategy to the general case, that is
when @fs does not directly come from the kernel through mountinfo (for
instance, it may have been parsed from /etc/fstab).

Given @mtab parsed from mountinfo, and if mnt_cache_set_targets(cache,
mtab) is used, then mnt_fs_match_target() and mnt_table_find_target()
check whether @fs->target is a known mount point in the cached
mountinfo, before attempting to canonicalize @fs->target, no matter
where @fs itself comes from. If found in the cached mountinfo,
@fs->target is not canonicalized.

[kzak@redhat.com: - don't allocate libmnt_iter,
                  - add docs for mnt_cache_set_targets(),
                  - fallback to mnt_resolve_path() if no cache->mtab specified,
                  - use streq_except_trailing_slash() to compare paths]

Signed-off-by: Eric Rannaud <e@nanocritical.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 10:03:40 +02:00
Eric Rannaud 45e8cdba91 libmount: mnt_resolve_path: don't canonicalize fs->target for swap
This is how mnt_table_find_target() does it. It makes sense because
@fs->target is "none" for swap and is never a sensible match for a
user-specified target.

Signed-off-by: Eric Rannaud <e@nanocritical.com>
2014-07-01 09:32:12 +02:00
Eric Rannaud ab131f00a2 libmount: mnt_resolve_path: use strcmp() only if both are canonical
Signed-off-by: Eric Rannaud <e@nanocritical.com>
2014-07-01 09:32:09 +02:00
Karel Zak 4b4e391a28 fdisk: don't use --geom-* prefix for CHS options
We already use --cylinders, --heads and --sectors for sfdisk, let's
make new fdisk option compatible.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-30 15:10:29 +02:00
Karel Zak 3175f03552 libsmartcols: add note about deallocations
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-30 14:14:34 +02:00
Karel Zak a6c6662d7c swapon: mark --sumarry as deprecated
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-30 11:03:12 +02:00
Sami Kerola 7471244148 swapon: align --summary fields
This commit makes  partitions and files to have remaining three columns
aligned.  Below print out demonstrates earlier misalignment.

$ swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda2                               partition       4194300 0       3
/home/src/util-linux/newswap            file    496     0       -1

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-06-30 10:43:04 +02:00
Benno Schulenberg 6ec8a0bac5 umount: slightly improve the man page
Remove some stray words from option arguments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-06-30 10:22:38 +02:00
Benno Schulenberg ab5b4f837d findmnt: minimally improve wording of usage text
Also sort the options better and tweak whitespace.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-06-30 10:22:26 +02:00
Benno Schulenberg 9421a1a3b3 findmnt: slightly improve wording and formatting in man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-30 10:22:07 +02:00
Benno Schulenberg b8ec0ab712 lslogins: improve the columns information
Some fixes for typos, whitespace and wordings.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-06-30 10:21:43 +02:00
Benno Schulenberg ce969b16f0 lslogins: improve wording and formatting of the man page
Some typos, spacing, line breaks, and missing optional arguments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-06-30 10:21:27 +02:00
Benno Schulenberg d276d99572 setterm: improve formatting and wording of usage text
Mainly: showing that the word color is a placeholder by writing
<color>, showing some numbers as optional, and message levels
and colors as not optional.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-06-30 10:21:11 +02:00
Benno Schulenberg e73a07208e setterm: improve wording and formatting of the man page
The main changes are: showing the arguments of boolean options
as optional, improving the alphabetization, and restoring the
--half-bright option that went missing in 2011.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-06-30 10:20:09 +02:00
Karel Zak 575718a04a fallocate: use O_CREAT only for the default behavior
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-26 14:45:02 +02:00
Bernhard Voelker 38a5440c95 fallocate: fix check of number of arguments
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2014-06-26 14:27:08 +02:00
Pádraig Brady 14c9b68096 fallocate: clarify usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-26 13:05:16 +02:00
Karel Zak b7f3f147f2 fallocate: use err_exclusive_options(), cleanup getopt_long() stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-26 12:38:04 +02:00
Karel Zak 634a4cf1b2 fallocate: make man page readable for humans
Well, let's copy & past from fallocate(2) syscall man page rather than
try to be creative with another description for the flags.

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-26 12:04:12 +02:00
Karel Zak dac1cb536b fallocate: fix FALLOC_FL_ZERO_RANGE flag check
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-26 12:01:13 +02:00
Karel Zak 6d4774b0d4 docs: add note about lsblk
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 14:04:20 +02:00
Karel Zak b8446f75d8 bash-completion: update fallocate, fstrim and lsblk
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 13:55:56 +02:00
Karel Zak 077698f5d6 bash-completion: update cfdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 13:44:08 +02:00
Karel Zak 675821f4bd bash-completion: update fdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 13:41:27 +02:00
Karel Zak e3a4aaa7d3 fdisk: add long options, cleanup man page and usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 13:31:14 +02:00
Karel Zak 505dedfec4 docs: fix minor things in man-page howto
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 13:21:15 +02:00
Karel Zak 425ae8f50c docs: add fdisk mac support to TODO file
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 11:39:30 +02:00
David Shea cbccd7a4f8 libblkid: correct the return values in squashfs probe
Returning -1 can cause squashfs v3 detection to make v4 detection fail.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-24 10:54:48 +02:00
Karel Zak 11712b6667 libfdisk: (dos) count fisrt usable LBA to total number of used sectors
The check() function counts number of used sectors, but it counts only
partitions. This is mistake, the area before the first partition is
also "used" place (boot loaders or we have to align the first partition
to disk I/O limits, etc).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-24 10:32:25 +02:00
Karel Zak 63fb717d8c libfdisk: (dos) use check() for dos-comaptible mode only
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-24 09:40:56 +02:00
Thorsten Wilmer 9bb8caff87 libfdisk: (dos) calculation of total size based on CHS in check function
Many people report a problem with the message if (cylinders <= 1024 &&
start != total) fprintf(stderr, _("Partition %d: previous sectors %d
disagrees with " "total %d\n"), n, start, total);

This message comes from the fact that the previous code caluclates the
total number of sectors in the wrong way.

The formula should be total = (real_c * heads + h) * sectors + real_s;

As a Cylinder consists of some heads * sectors A Head consists of some
sectors and finally sectors are the smallest unit

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-24 09:40:06 +02:00
Karel Zak b1f03df798 libmount: special treatment for auto in fstype pattern
Let's support

  mount -t ext2,auto /dev/sde /media/stick

Reported-by: Andreas Henriksson <andreas@fatal.se>
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506695
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-23 12:42:33 +02:00
peppe 033effcacd hwclock: sometimes one day lasts 23 hours.
If less than 23 hours have passed since the last calibration, hwclock
says "Not adjusting drift factor because it has been less than a day since
the last calibration.", but in fact compares to 23 hours, not 24.

This was originally reported at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689534

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-06-23 11:48:14 +02:00
Karel Zak cabce4ea71 script: clean up code to genenrate Star/Done messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-23 11:41:31 +02:00
Andreas Henriksson dc47cfee48 script: silence the done message on --quiet as well
Apparently James Hunts patch (which he provided a long time
ago) is no longer covering it all.

This followup patch also silences the "Script done ..." message
when --quiet is used.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-06-23 11:31:08 +02:00
James Hunt 1474c09ea8 script: --quiet option is not quiet.
Specifying 'script --quiet ...' still produces the 'Script started'
message in the typescript file. The --quiet option implies that the
script program should not log any of its output to the typescript file.

Originally reported at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=693966

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-06-23 11:31:07 +02:00
Karel Zak d121efdb6e cfdisk: add --zero command line option
The option has been supported by previous versions, we can easily
support it too.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-20 12:17:53 +02:00
Karel Zak dd626abdbe cfdisk: don't offer BSD
BSD is nested within DOS partition, so for disk without any partition
table it does not make any sense to offer BSD label.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-20 12:07:30 +02:00
Karel Zak 6da288af2e Merge branch 'master' of https://github.com/nazarov-yuriy/util-linux 2014-06-19 11:52:27 +02:00