summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* lib/sysfs: be more smart for non-scsi devicesKarel Zak2016-06-022-2/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/ttyutils: use stdout for get_terminal_width()Karel Zak2016-06-022-3/+3
| | | | | | | | | We use the function to be sure with *output* width. Note that the current code (with STDIN) is broken because in some situations libsmartcols is not able to detect terminal width and fall back to default 80. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: check for mount(8) in minix testKarel Zak2016-06-011-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.minix: fix endless loop and out of stackKarel Zak2016-06-011-0/+16
| | | | | | | | | It seems there is no elegant way how to recovery if a directory i_zone (and i_size) is out of reality. Let's require human interaction to avoid endless loop when executed with --auto, etc. Addresses: https://github.com/karelzak/util-linux/issues/228 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: Fix typo RequiredPartiton -> RequiredPartitionSebastian Rasmussen2016-05-317-5/+1162
| | | | | | | | This typo fix is backwards compatible in that fdisk will accept both the GPT attribute RequiredPartition and RequiredPartiton with the typo. Update documentation and tests to all use the new attribute name. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* misc: Fix various typosSebastian Rasmussen2016-05-31130-329/+329
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* docs: Fix various typosSebastian Rasmussen2016-05-3116-25/+25
| | | | Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* cal: support timestampsKarel Zak2016-05-312-1/+28
| | | | | | | | For example $ cal '2 weeks ago' Signed-off-by: Karel Zak <kzak@redhat.com>
* cal: allow to specify month by nameKarel Zak2016-05-312-2/+34
| | | | | | | | For example: $ cal August 2016 Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.minix: Verify more fields in super-block.Tobias Stoeckmann2016-05-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The field s_ninodes in super-block is used for memory allocation and division without verifications. The memory allocation increments the unchecked value by 1, making it vulnerable to an integer overflow on 32 bit systems with minix 3 file systems. I did not find a (good) way to exploit this by crafting a malicious file system, so I consider it as a reliability issue. If it's 0, a division by zero occurs when "-v" has been used. A filesystem without any inodes is definitely wrong, because it means that there's not even the root inode, which is accessed unchecked later on. The field s_firstdatazone has to be checked against s_(n)zones. If it is larger than the highest allowed index, the file system is definitely corrupted -- hard to say which value is wrong though, therefore I decided to simply call die(). A maliciously created file system could do more harm in this way: single bits inside the memory area could be flipped because range checks would fail. Hard to consider it as a security issue though, because these addresses are not arbitrarily accessible without very careful crafting (if at all possible). [kzak@redhat.com: - fix compiler warning (cast get_nzones()) [-Wsign-compare]] Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add --disable-plymouth-supportKarel Zak2016-05-264-7/+45
| | | | | | | | The plymouth support depends on Linux specific SOCK_* flags and all the feature is probably unnecessary in some cases (non-plymouth distros, etc.) Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: store only canonical devnames to the cacheKarel Zak2016-05-263-9/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | Let's try to use symlink: # ls -la /dev/block/8\:1 # lrwxrwxrwx 1 root root 7 May 25 16:42 /dev/block/8:1 -> ../sda1 # blkid /dev/block/8:1 /dev/block/8:3: LABEL="HOME" UUID="196972ad-3b13-4bba-ac54-4cb3f7b409a4" TYPE="ext4" PARTUUID="6073277f-87bc-43ff-bcfd-724c4484a63a" unfortunately the symlink is stored to the cache: <device DEVNO="0x0803" TIME="1464253300.715279" LABEL="HOME" UUID="196972ad-3b13-4bba-ac54-4cb3f7b409a4" TYPE="ext4" PARTUUID="6073277f-87bc-43ff-bcfd-724c4484a63a">/dev/block/8:3</device> next time if you ask for LABEL=HOME the answer will be /dev/block/8:3 rather than /dev/sda3. It seems better to canonicalize the paths we store to the cache. Unfortunately if you ask for /dev/block/8:3 then you probably expect that blkid_dev_devname() returns the same path. This patch introduces dev->bid_xname, this is the path used by application (and never stored in the cache). Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1332779 Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: use ID_WWN_WITH_EXTENSION is possibleKarel Zak2016-05-251-1/+6
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/321 Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add tools/Makemodule.amKarel Zak2016-05-252-3/+11
| | | | | | | | We have "make" targets which depends on tools/check*.sh scripts. It's ugly to exclude these scripts from the release tar balls (as generated by "make distcheck"). Signed-off-by: Karel Zak <kzak@redhat.com>
* tools: add script to load .po from translationproject.orgKarel Zak2016-05-251-0/+58
| | | | | | I use it for years, let's keep it in the repository. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: improve debug messagesKarel Zak2016-05-255-29/+16Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add missing include/plymouth-ctrl.hKarel Zak2016-05-241-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: fix indentionKarel Zak2016-05-241-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* last: fix logout timeKarel Zak2016-05-241-4/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: use strtime_short()Karel Zak2016-05-241-25/+8Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: use strtime_short()Karel Zak2016-05-241-31/+19Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/timeutils: add strtime_short()Karel Zak2016-05-242-0/+45
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: refresh cal(1) testKarel Zak2016-05-242-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: use strtm_iso()Karel Zak2016-05-241-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: use strtimeval_iso()Karel Zak2016-05-241-9/+7Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: use strtimeval_iso()Karel Zak2016-05-241-13/+12Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: use strtm_iso()Karel Zak2016-05-241-1/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* last: cleanup time formatting codeKarel Zak2016-05-241-48/+66
| | | | | | | | | | - describe difference between login and logout time formats in struct last_timefmt - use strtime_iso() - rename LAST_TIMEFTM_SHORT_CTIME to LAST_TIMEFTM_SHORT - rename LAST_TIMEFTM_FULL_CTIME to LAST_TIMEFTM_CTIME - add LAST_TIMEFTM_HHMM for internal purpose (logout format for "--time-format short") Signed-off-by: Karel Zak <kzak@redhat.com>
* include/timeutils: rewrite iso formatting functionsKarel Zak2016-05-242-40/+74
| | | | | | | | | - use buffers rather than allocate memory - support .usec and ,usec convention - use strftime for timezone (we need to care about daylight saving time) Signed-off-by: Karel Zak <kzak@redhat.com>
* include/timeutils: use pointer for time_tKarel Zak2016-05-232-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sulogin: agetty: use the plymouth local protocol instead the plymouth binaryWerner Fink2016-05-205-82/+223
| | | | | | | | | | | | | for stopping plymouthd. That do not depend on the existence of the plymouth binary if it e.g. becomes uninstalled or an other service is providing plymouthd facilities. [kzak@redhat.com: - fix compiler warnings [-Wpointer-sign] - use sizeof() for write_all() - cast to char* for read_all] Signed-off-by: Werner Fink <werner@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'cal04'Karel Zak2016-05-201-4/+4
|\
| * cal: use %04d for yearKarel Zak2016-05-181-4/+4
| | | | | | | | | | | | | | | | | | | | It seems that people are crazy enough to assume that "cal 16" is the year 2016, rather than 16 (2000 years ago). This patch makes it more clear as the output is 0016. Addresses: https://github.com/karelzak/util-linux/issues/320 Signed-off-by: Karel Zak <kzak@redhat.com>
* | man pages: fix spacing between man page name & section numberMike Frysinger2016-05-205-6/+6
| | | | | | | | | | | | Most have standardized correctly, but fix a few latent ones. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | script: improve coding style and the "done" messageKarel Zak2016-05-181-7/+5Star
|/ | | | | | Don't print the "done" message if the file does not exist. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use table-length in dump for non-standard PTKarel Zak2016-05-183-9/+17
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: make table-length usage more robustKarel Zak2016-05-182-3/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: Add support for altering GPT sizeSassan Panahinejad2016-05-181-2/+13
| | | | Adds a header option to alter the GPT table length
* libfdisk: Add support for altering GPT sizeSassan Panahinejad2016-05-183-0/+102
| | | | | | | | | | | | | | | | | | | | | This is useful in two situations: 1. More than 128 partitions are required. Or 2. The partition table must be restricted in size, such as when a system expects to find a bootloader at a location that would otherwise overlap the partition table. The gdisk partitioner supports this feature. libfdisk is already capable of reading and writing partition tables of any size, but previously could only create ones of 128 entries and could not resize. This change should be fairly safe, as it has no effect unless explicitly activated. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: Add support for altering GPT sizeSassan Panahinejad2016-05-181-0/+8
| | | | Adds an options (l) to the GPT menu to resize the GPT.
* libfdisk: fix range checking for fdisk_set_last_lbaSassan Panahinejad2016-05-181-1/+1
|
* logger: add man page note about the default --tagKarel Zak2016-05-161-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add API for work with labelitemsKarel Zak2016-05-128-14/+309
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: move fdisk_field_...() functions to field.cKarel Zak2016-05-124-52/+97
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/timeutils: add strxxx_iso() functionsKarel Zak2016-05-115-1/+117
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ramctl: add support for zram-controlKarel Zak2016-05-111-3/+61
| | | | | | | | Based on patch from Timofey Titovets. Addresses: https://github.com/karelzak/util-linux/issues/318 Reported-by: Timofey Titovets <nefelim4ag@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use fdisk_add_partition() for unused partnoKarel Zak2016-05-101-0/+5
| | | | | | | | | | | | For example: sfdisk -N <parno> may address unused partition. In this case we need to redirect from fdisk_set_partition() to fdisk_add_partition() and follow default setting (used all free space). Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'no-fork' of https://github.com/terryburton/util-linuxKarel Zak2016-05-092-27/+49
|\
| * flock: Introduce no-fork option.Terry Burton2016-04-162-27/+49
| | | | | | | | | | When guarding a command with flock it is sometimes preferable to not leave a flock process waiting around for the command to exit.
* | setterm: remove unnecessary translation stringSami Kerola2016-05-091-8/+8
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>