summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* more: fix mem leak [coverity scan]Karel Zak2014-01-141-1/+3
| | | | | | ... the code is so soo ugly. Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: import directly from pylibmount in testsKarel Zak2014-01-143-3/+9
| | | | | | | This change does not have any impact to in a standard way installed libmount impact. It's simplification for in-tree tests. Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: remove unncessary subdirectoryKarel Zak2014-01-142-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update lscpu testsKarel Zak2014-01-141-33/+35
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: sort NUMA nodes to keep output human readableKarel Zak2014-01-141-0/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: add lslogins(1) to TODOKarel Zak2014-01-141-0/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add partx --update testKarel Zak2014-01-142-0/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update partx sgi testKarel Zak2014-01-141-0/+2
| | | | | | | Since commit 4253275490926cf533bfd0bc33279729e9ff427a the libblkid lists system partitions for SGI label. Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: fix --update ranges and out of order tablesScott Moser2014-01-141-25/+50
| | | | | | | | | | | | partx --update DEVICE NUMBER was broken in 2 cases: * if NUMBER != 1 * if the partition table was "out of order". Ie, where sda2 came after sda3. References: https://bugs.launchpad.net/ubuntu/+source/cloud-utils/+bug/1244662 Signed-off-by: Scott Moser <smoser@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: update man page ext3/4 mount optionsCarlos Maiolino2014-01-131-11/+31
| | | | | | | | Add missing mount options to ext3 and ext4 filesystems. This also remove resize option information from the man page. Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: prefer FALLOC_FL_* flags from libc headersKarel Zak2014-01-131-2/+3
| | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: (nilfs2) check also backup superblockKarel Zak2014-01-131-24/+42
| | | | | | | | | * read also backup superblock * check which superblock is newer * set minimal device size to 1MiB Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: fix --raw zero timestamp for kmsgKarel Zak2014-01-071-8/+12
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1049438 Signed-off-by: Karel Zak <kzak@redhat.com>
* uuidd: use pkg-config to find systemd-deamon supportSami Kerola2014-01-075-818/+15Star
| | | | | | | | [kzak@redhat.com: - remove USE_SOCKET_ACTIVATION and use HAVE_* as we use for another libs] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* unshare: Add possibility to add mapping into root user in user namespaceLubomir Rintel2014-01-073-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it very convenient to use make use of privileged actions on CONFIG_USER_NS enabled kernels, without having to manually tinker with uid_map and gid_map to obtain required credentials (as those given upon unshare() vanish with call to execve() and lot of userspace checks for euid==0 anyway). Usage example: $ unshare --uts unshare: unshare failed: Operation not permitted $ unshare --user --uts [nfsnobody@odvarok ~]$ hostname swag hostname: you must be root to change the host name $ unshare -r --uts [root@odvarok util-linux]# hostname swag [root@odvarok util-linux]# [kzak@redhat.com: - move code to map_id() - use all-io.h - add paths to pathnames.h] Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Karel Zak <kzak@redhat.com>
* cal: in man page improve grammar and wording of the reformation limitationBenno Schulenberg2014-01-071-5/+6
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* lscpu: support discontinuous NUMA nodesKarel Zak2014-01-061-7/+43
| | | | | | | | | | | lscpu fails to print proper NUMA node values in a system with discontinuous nodes. This patch adds support by creating a nodeidx array to map node numbers. Based on patch from Madhavan Srinivasan <maddy@linux.vnet.ibm.com>. Reported-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/path: add path_strdup()Karel Zak2014-01-062-0/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: convert a variable type according with fmtAndrew Vagin2014-01-061-6/+6
| | | | | | | | | | | | | | | | | | hexdump works uncorrectly on Rassberry Pi (raspbian wheezy): 0000000 3200000000 3400000000 3600000000 3800000000 a00000000 000000a The problem is that the %qx format is used for printing the (short int) variable. Here is the output from hexdump with this patch: 0000000 3231 3433 3635 3837 0a39 000000a Currently raspbian uses hexdump from bsdmainutils. bsdmainutils: /usr/bin/hexdump Signed-off-by: Andrew Vagin <avagin@openvz.org>
* hexdump: don't access hex after freeing itAndrew Vagin2014-01-061-1/+5
| | | | | | | [kzak@redhat.com: - remove unnecessary code] Signed-off-by: Andrew Vagin <avagin@openvz.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* hexdump: use xcalloc()Karel Zak2014-01-061-1/+2
| | | | | Reported-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: libmount: skip tabfiles-py when pylibmount is disabledMike Frysinger2014-01-061-0/+2
| | | | | | | The default configure disables python support, so this test fails by default. Add a simple check for module availability. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: last: skip when last is not enabledMike Frysinger2014-01-062-0/+4
| | | | | References: https://bugs.gentoo.org/489794 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cal: in man page admit that any week has just one SundayBenno Schulenberg2014-01-061-5/+5
| | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* cal: mention where Gregorian reformation happen in September 1752Sami Kerola2014-01-061-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | In September 1752 the Gregorian reformation happen in Great Britain and Dominions (including what is now the USA). One could argue the cal(1) should consider locale when determining the reformation, but such is nearly impossible implement correctly. The dates when reformation happen are split by areas that cannot be expressed with current locales, for example the Netherlands is split to two and Germany three categories depending on where in the modern country one is. Secondly the track when reformation happen is lost for some countries, Lithuania or Japan are good examples of such. One of the worst for a programmer is Sweden. They got gradual calendar change which made Swedish calendar to be completely out of sync. Later the Swedish calendar jumped in 1753 to be in sync with everyone else. Notice that some countries, including Saudi Arabia, Ethiopia, Nepal, Iran and Afghanistan, still have not adopted the Gregorian calendar. Hence the output of the cal(1) cannot be considered to be correct for everyone. References: http://calendopedia.com/gregory.htm References: http://en.wikipedia.org/wiki/Gregorian_calendar#Gregorian_reform Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* losetup: remove warning for unsupported -e and -EKarel Zak2014-01-061-6/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup, mount: remove --pass-fd at allKarel Zak2014-01-063-13/+3Star
| | | | | | | | The option is unsupported since v2.23, let's cleanup man pages and code to remove it at all. Reported-by: "Dale R. Worley" <worley@alum.mit.edu> Signed-off-by: Karel Zak <kzak@redhat.com>