summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* tests: fix trailing spaces in cal(1) stuffKarel Zak2014-02-173-389/+391
| | | | | Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: initialize *root to NULL in mnt_table_get_root_fsThomas Bächler2014-02-171-0/+2
| | | | | | | | mnt_table_get_root_fs only works when *root is set to NULL. This is not only undocumented, but also unintuitive. Fix it by initializing *root inside mnt_table_get_root_fs. Signed-off-by: Karel Zak <kzak@redhat.com>
* su: don't use kill(0, ...) when propagate signalKarel Zak2014-02-171-1/+1
| | | | | | | | | | | The current code uses kill(0, caught_signal) after regular signal cleanup and before exit (all just to make shells happy). Unfortunately, kill(0, ...) is a bad idea. It seems better to use kill(getpid(), ...) otherwise we kill our parent process too. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1063887 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: make the mountinfo parser more robustKarel Zak2014-02-171-10/+11
| | | | | | ... sorry, the previous change to the parser was too stupid. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: accept (deleted) path suffix in mountinfo fileKarel Zak2014-02-173-0/+22
| | | | | Addresses: debian bug #711183 Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: add the way to specify the target processes with pgid and uidMasatake YAMATO2014-02-172-22/+74
| | | | | | | | | | | | | ioprio_get and ioprio_set system call accept not only process ID but also process group ID(pgid) and user ID(uid) to specify the target process(es). However, ionice command accepts only process ID. With this patch a user can specify the target processes with pgid(-P option) and uid(-u option). [kzak@redhat.com: - tiny cleanup in usage()] Signed-off-by: Masatake YAMATO <yamato@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: improve --dig-holesKarel Zak2014-02-172-62/+77
| | | | | | | | | * don't use --length to specify hole size, always use stat.st_blksize * use --offset and --length to specify offset within the file (like another fallocate operations) Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: add --verbose, clean up usage()Karel Zak2014-02-143-13/+32
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: Add "--dig-holes" optionRodrigo Campos2014-02-143-25/+95
| | | | | | | | | | This option tries to detect chunk of '\0's and punch a hole, making the file sparse in-place. [kzak@redhat.com: - fix coding style, use xalloc.h and err.h] Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar> Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: Hide #ifdef tricks to call fallocate in a functionRodrigo Campos2014-02-141-15/+28
| | | | | | | | | | | | Future patches will add more calls to fallocate(), so it will be useful to have all these tricks inside a function. The error message when fallocate is not supported is slightly changed: the file name is not printed as a prefix because is not available in the context of the function. Also, to only print one of the two possible errors (as happens when using directly exit()), an else clause was added. Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
* fallocate: Clarify that space can also be deallocatedRodrigo Campos2014-02-142-7/+8
| | | | | | | The functionality is already there, with --punch-hole, but the text was for the preallocation case only. Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
* scriptreplay: Add --maxdelay option.Jesper Dahl Nyerup2014-02-102-4/+20
| | | | | | | | This option caps the delay between updates, to avoid long pauses in transcript playback. Signed-off-by: Jesper Dahl Nyerup <nyerup@one.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* cal: remove unnecessary static variablesSami Kerola2014-02-101-19/+0Star
| | | | | | Not in use since commit 95f4adde867492563167b11ba94dba67f93809aa. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* renice: correct max priority in renice man pagePhillip Susi2014-02-101-7/+3Star
| | | | | | | | | | | | The man page stated that the PRIO_MAX is 20. While this is correct, the header definition is wrong and the max value is actually 19. [kzak@redhat.com: - remove PRIO_MAX from man page, kernel syscalls use hardcoded numbers for the priority limits] Signed-off-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove obsolete and confusing statement from mount.8Phillip Susi2014-02-101-2/+1Star
| | | | | | | The wording was confusing and suidperl has gone the way of the dodo, and really didn't need mentionting in mount.8. Signed-off-by: Phillip Susi <psusi@ubuntu.com>
* fix mkfs --verbose and man pagePhillip Susi2014-02-102-6/+2Star
| | | | | | | | | mkfs did not actually accept the long form --verbose option. Also the man page seemed to indicate that version/verbose/help options were passed to the filesystem specific utility when this is not the case. Signed-off-by: Phillip Susi <psusi@ubuntu.com>
* hwclock: internationalizing the message of the used interfaceBenno Schulenberg2014-02-104-4/+4
| | | | | | In addition, do it in a single sentence instead of in two fragments. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* getopt.1: The usual doc dir is /usr/share/doc, not .../docsVille Skyttä2014-02-101-1/+1
| | | | Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
* setpriv: Fix --apparmor-profileAndy Lutomirski2014-02-101-2/+2
| | | | | | | | | | | | | | | There were two bugs. First, trying to access /proc/self/attr/exec with O_CREAT | O_EXCL has no chance of working. Second, it turns out that the correct command to send is "exec", not "changeprofile". Of course, there was no way to know this until: commit 3eea57c26e49a5add4c053a031cc2a1977b7c48e Author: John Johansen <john.johansen@canonical.com> Date: Wed Feb 27 03:44:40 2013 -0800 apparmor: fix setprocattr arg processing for onexec Signed-off-by: Andy Lutomirski <luto@amacapital.net>
* last: make session gone determination more robustSami Kerola2014-02-101-3/+22
| | | | | | | | | | | | Earlier determination that used kill with signal zero to pid was prone to false positive reports, due reuse of pid space and unrelated processes. New function is_phantom() tries do a little bit better job, but fails to be perfect. It seems linking to gether utmp session start time or terminal id with /proc/<pid>/ information is not as simple as one might hope. Reported-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hexdump: add highlighting supportOndrej Oprala2014-02-1035-1/+1268
| | | | | | | | | [kzak@redhat.com: - fix coding style, - use xalloc in all code, - fix strtol usage] Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/color: add colorscheme parserKarel Zak2014-02-102-2/+48
|
* Merge branch 'master' of https://github.com/micha137/util-linuxKarel Zak2014-02-101-1/+1
|\
| * ionice: Fix output for case ioclass==0Michael Bunk2014-01-151-1/+1
| | | | | | | | output "none" instead of "unknown"
* | lsblk: add PARTTYPE tagMichael Marineau2014-02-101-0/+13
| | | | | | | | To stay in sync with blkid add PARTTYPE as an available output column.
* | tests: automatic whitespace trimming broke earlier commitSami Kerola2014-02-060-0/+0
| | | | | | | | | | | | | | | | Setting in .gitconfig to do 'git apply --whitespace=fix' automatically turned automation against user. Frankencommit: 4d2f0d08f67707b6d44d4a45fb6e21876c02c731 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | tests: cal(1) is year is limited to signed 32 bit valueSami Kerola2014-02-064-369/+355Star
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | cal: limit year to 32 bit valueSami Kerola2014-02-061-21/+23
| | | | | | | | | | | | | | | | | | | | This is done to keep things simple, when considering tests, for both 64 and 32 bit architectures. Setting the upper limit of a year value to to 2^31-1 (2147483646) should be enough for anyone. Reported-by: Mike Frysinger <vapier@gentoo.org> Reference: http://www.spinics.net/lists/util-linux-ng/msg08662.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | fsck: don't return error if fsck.<type> does not existKarel Zak2014-02-061-32/+42
| | | | | | | | | | | | | | | | | | The error message is expected for "really wanted" set of filesystems (extN, ..), otherwise it does not make sense for filesystems like btrfs or xfs. Reported-by: Tom Gundersen <teg@jklm.no> Signed-off-by: Karel Zak <kzak@redhat.com>
* | nsenter: fix set{gid,uid} order,drop supplementary groupsKarel Zak2014-02-061-2/+5
| | | | | | | | | | | | | | .. always, always setgid() before setuid()! Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1061751 Signed-off-by: Karel Zak <kzak@redhat.com>
* | dmesg: -w output not line-bufferedKarel Zak2014-02-061-0/+2
| | | | | | | | | | | | | | | | when writing to e.g. a pipe, output from dmesg -w can come many minutes late due to buffering. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1060925 Signed-off-by: Karel Zak <kzak@redhat.com>
* | losetup: wait for udevKarel Zak2014-01-242-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | On system with /dev/lop-control the udevd creates /dev/loopN nodes. It seems better to wait a moment after unsuccessful open(/dev/loopN) and try it to open again. The problem is pretty visible on systems where udevd also modifies permission for loopN devices, then open() fails with EACCES when losetup executed by non-root user (but user who is in "disk" group). Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1045432 Signed-off-by: Karel Zak <kzak@redhat.com>
* | include/c.h: prefer nanosleep() over usleep()Karel Zak2014-01-248-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's use nanosleep() although if usleep() exists. The nanosleep function does no interact with signals and other timers. The patch introduces xusleep() as replacement to libc (or our fallback) usleep(). Yes, we don't want to use struct timespec + nanosleep() everywhere in code as nano-time resolution is useless for us. The patch also enlarges delays in some busy wait loops. It seems enough to try read/write 4x per second. Signed-off-by: Karel Zak <kzak@redhat.com>
* | flock: Change the 'exit status' man page section to make more senseWieland Hoffmann2014-01-201-2/+2
| | | | | | | | Signed-off-by: Wieland Hoffmann <themineo@gmail.com>
* | wipefs: call BLKRRPART when erase partition tableKarel Zak2014-01-202-8/+36
| | | | | | | | | | | | | | | | It's better to be smart than make things inconsistent (without BLKRRPART kernel still uses the erased PT and udev-db still contains obsolete information). Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid: detect alone PMBRKarel Zak2014-01-203-2/+44
| | | | | | | | | | | | | | | | wipefs(8) has to also erase PMBR, not GPR header only, otherwise the device could be still interpreted as a device with a partition table. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1054186 Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: update build-sys testsKarel Zak2014-01-1718-18/+15Star
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | build-sys: fstrim depends on libmountKarel Zak2014-01-172-6/+14
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | mkswap: fix compiler warning [-Wunused-variable]Karel Zak2014-01-171-1/+2
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid: no more probe for btrfs backup superblockKarel Zak2014-01-164-19/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | * Linux kernel cares about the first superblock only * backup superblock are FS specific stuff and there is no reason to care about it in generic tools * the problem with broken btrfs utils has been already fixed (it was possible to use the utils on filesystem with erased primary superblok without any warning message). Signed-off-by: Karel Zak <kzak@redhat.com>
* | wipefs: add comments to codeKarel Zak2014-01-161-4/+7
| |
* | script: use all-io.h to make the code more robustKarel Zak2014-01-161-9/+5Star
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | script: fix inconsistent -q, use poll() rather then O_NONBLOCKKarel Zak2014-01-161-25/+17Star
| | | | | | | | | | | | | | | | | | - don't suppress "Script done" message in typescript file by -q (note that -q has no effect to "Script started" message) - simplify the code by poll() Signed-off-by: Karel Zak <kzak@redhat.com>
* | script: don't wait for empty descriptors if child is deadKarel Zak2014-01-161-4/+8
|/ | | | | | | | The current code waits for empty file master and slave descriptors, but it makes sense only if there is child process that cares (read) about data in the descriptors. Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: use blkid_partlist_get_partition_by_partno()Karel Zak2014-01-151-32/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add blkid_partlist_get_partition_by_partno()Karel Zak2014-01-154-0/+40
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: fix scanf format string [coverity scan]Karel Zak2014-01-141-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix scanf format string [coverity scan]Karel Zak2014-01-141-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rename: fix mem leak [coverity scan]Karel Zak2014-01-141-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: fix mem leak [coverity scan]Karel Zak2014-01-141-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>