summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* agetty: fix typoKarel Zak2014-11-219-7/+60
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: keep the current baud before try 9600 on serial linesKarel Zak2014-11-212-4/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: don't ignore TERMKarel Zak2014-11-211-2/+4
| | | | | | | | | Fix command line parsing to not ignore term setting if no baud specified, for example: /sbin/agetty ttyS0 vt100 Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: cleanup library symbol filesKarel Zak2014-11-206-13/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ibfdisk: (gpt) allow to maximize partitionKarel Zak2014-11-201-2/+20
| | | | | | | | | | | | | | | | | | | | enlarge second partition: # echo ',+' | ./sfdisk -N2 /dev/sdb ... Disk /dev/sdb: 100 MiB, 104857600 bytes, 204800 sectors Old situation: Device Start End Sectors Size Type /dev/sdb1 2048 22527 20480 10M Linux filesystem /dev/sdb2 22528 43007 20480 10M Linux filesystem New situation: Device Start End Sectors Size Type /dev/sdb1 2048 22527 20480 10M Linux filesystem /dev/sdb2 22528 204766 182239 89M Linux filesystem Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (dos) allow to maximize partitionKarel Zak2014-11-202-25/+98
| | | | | | | | | | | | | | | | | | | | | | | The struct fdisk_partition has special flag "end_follow_default" to make the partition large as much as possible. This patch makes this flag usable for fdisk_set_partition() function. Command line example (enlarge the first partition): # echo ',+' | ./sfdisk -N1 /dev/sdb ... Disk /dev/sdb: 100 MiB, 104857600 bytes, 204800 sectors ... Old situation: Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 22527 20480 10M 83 Linux ^^^^^ New situation: Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 204799 202752 99M 83 Linux ^^^^^^ Signed-off-by: Karel Zak <kzak@redhat.com>
* aggety: always set default serial line speedKarel Zak2014-11-201-4/+11
| | | | | | | | | * makes speeds table usage more robust * don't call next_speed() for empty speeds table to avoid division by zero * default to 9600 when port baud unspecified Addresses: https://github.com/karelzak/util-linux/pull/131 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix lock test to use real time to syncKarel Zak2014-11-191-3/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* login: ignore SIGXFSZ when write to lastlogKarel Zak2014-11-191-2/+11
| | | | | | | | the lastlog file is huge and on systems with large UIDs, it's so huge that it generates SIGXFSZ when the FSIZE limit is too small. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1165702 Signed-off-by: Karel Zak <kzak@redhat.com>
* blkid: add hint about lsblk to the man pageKarel Zak2014-11-191-1/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors: fix double free on error pathAndreas Henriksson2014-11-191-3/+5
| | | | | | | | | | | | The error path was a bit unclear on the semantics. The seq argument would get freed but not the name argument. Then the caller frees them both when the function returns an error. This fixes the problem my making the function not touch the arguments unless we're going to return success. Also improve the description for this function to make it more obvious what the callers should expect. Addresses: CID#77487 (on scan.coverity.com for JIghtuse/util-linux) Signed-off-by: Andreas Henriksson <andreas@fatal.se>
* build-sys: move all around clock_gettime() to monotonic.cKarel Zak2014-11-1912-36/+39
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use CLOCKGETTIME_LIBSKarel Zak2014-11-192-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix utab entry on remountKarel Zak2014-11-191-0/+3
| | | | | | | | | | mount(8) command does not set ROOT= field to utab entry on remount, for example: mount -oremount,_netdev /mnt Reported-by: Chris Leech <cleech@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add private mnt_context_get_mtab_for_target()Karel Zak2014-11-193-40/+69
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: reuse allocated fs in parserKarel Zak2014-11-191-7/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: improve mnt_reset_fs()Karel Zak2014-11-191-17/+20
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: use monotonic time rater than gettimeofdayKarel Zak2014-11-185-9/+38
| | | | | | Based on patch Alexander Samilovskih <alexsamilovskih@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* uuidd: Fixed a typo in daemon logging messageNikolay Sivov2014-11-181-1/+1
| | | | Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
* docs: Spelling fixesVille Skyttä2014-11-185-5/+5
| | | | | Signed-off-by: Ville Skyttä <ville.skytta@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* bash-completion: Invoke actual commands to be completed, not basenamesVille Skyttä2014-11-187-11/+11
| | | | | Addresses partially: http://bugs.debian.org/769462 Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
* ldattach: GSM0710 support, add intro modem commandKarel Zak2014-11-183-2/+105
| | | | | | | | | | Patch add: --intro-command string : send command to modem --pause value : define delay between intro command and ldattach Based on patch from Martin Schmid <scm@aps-systems.ch> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: remove memory leaks [LeakSanitizer] [valgrind]Sami Kerola2014-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | | ==18922==ERROR: LeakSanitizer: detected memory leaks Direct leak of 8 byte(s) in 1 object(s) allocated from: #0 0x49d12b in __interceptor_malloc (/home/src/util-linux/.libs/lt-mkswap+0x49d12b) #1 0x7faf2a5069c9 in __GI___strdup (/usr/lib/libc.so.6+0x819c9) #2 0xffff96e7e33 (<unknown module>) SUMMARY: AddressSanitizer: 8 byte(s) leaked in 1 allocation(s). And another one that valgrind found. ==6316== 8 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==6316== at 0x4C29F90: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6316== by 0x5E3F9C9: strdup (in /usr/lib/libc-2.20.so) ==6316== by 0x43A25F: size_to_human_string (strutils.c:495) ==6316== by 0x42B35C: main (mkswap.c:488) Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tests: mark python libmount tests known to fail with AddressSanitizerSami Kerola2014-11-184-1/+17
| | | | | | | | | | | | | | | The tests fail with an error similar to this. Traceback (most recent call last): File "/home/src/util-linux/libmount/python/test_mount_tab_update.py", line 7, in <module> import pylibmount as mnt ImportError: /home/src/util-linux/.libs/libuuid.so.1: undefined symbol: __asan_option_detect_stack_use_after_return It might be possible to build ASAN-DSO and set LD_PRELOAD, but this solution is not officially supported. See the reference for details. Reference: https://code.google.com/p/address-sanitizer/wiki/AsanAsDso Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tests: skip kill -SEGV test when running AddressSanitizerSami Kerola2014-11-181-0/+3
| | | | | | | Sending signal indicating invalid memory reference makes AddressSanitizer to report false positive test failure. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount: fix memory overflow [AddressSanitizer]Sami Kerola2014-11-181-1/+1
| | | | | | | | | | | | | | | | | | ==10918==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffd795b680 at pc 0x0000004447c6 bp 0x7fffd795b3e0 sp 0x7fffd795ab78 WRITE of size 129 at 0x7fffd795b680 thread T0 #0 0x4447c5 in scanf_common(void*, int, bool, char const*, __va_list_tag*) (/home/src/util-linux/.libs/lt-mount+0x4447c5) #1 0x445892 in sscanf (/home/src/util-linux/.libs/lt-mount+0x445892) #2 0x7fe78709a3d3 in get_filesystems /home/src/util-linux/libmount/src/utils.c:581:7 #3 0x7fe78709a1ba in mnt_get_filesystems /home/src/util-linux/libmount/src/utils.c:622:7 #4 0x7fe7870aa78f in do_mount_by_pattern /home/src/util-linux/libmount/src/context_mount.c:833:7 #5 0x7fe7870a9534 in mnt_context_do_mount /home/src/util-linux/libmount/src/context_mount.c:951:9 #6 0x7fe7870aab2b in mnt_context_mount /home/src/util-linux/libmount/src/context_mount.c:1051:8 #7 0x4ba9f5 in main /home/src/util-linux/sys-utils/mount.c:1107:7 #8 0x7fe785caa03f in __libc_start_main (/usr/lib/libc.so.6+0x2003f) #9 0x4b9f9c in _start (/home/src/util-linux/.libs/lt-mount+0x4b9f9c) Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: fix memory leak [AddressSanitizer]Sami Kerola2014-11-181-0/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: make scanf_cv_alloc_modifier to work [LeakSanitizer]Sami Kerola2014-11-181-0/+1
| | | | | | | | | | | | | | | | | | | | | The tests failed with following message in config.log ERROR: LeakSanitizer: detected memory leaks Direct leak of 2 byte(s) in 1 object(s) allocated from: #0 0x49a40e in realloc (/home/src/util-linux/conftest+0x49a40e) #1 0x7fbe48633e69 in __GI__IO_vfscanf (/usr/lib/libc.so.6+0x56e69) #2 0x7fbe48649786 in _IO_vsscanf (/usr/lib/libc.so.6+0x6c786) which knocked out libmount from build, and commands depending on it. The reason this change makes sense is that AddressSanitizer seems like a good addition to set of tools that util-linux package can use, when and if needed. Reference: https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer Reviewed-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lscpu: theoretical buffer overflowTobias Stoeckmann2014-11-181-2/+2
| | | | | | | | | | | | there is a theoretical buffer overflow possible in the hypervisor parsing code of lscpu. It would require a proc entry to return way more than expected so it's no high priority. But better be safe than sorry. At first I thought about switching to fgets but there is another code file that adds a format specifier. The diff is less intrusive that way, too. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix partition names on GNU Hurd.Gabriele Giacone2014-11-181-0/+4
|
* libfdisk: fix get_partition_unused_primary()Boris Egorov2014-11-141-23/+27
| | | | | | | | | | | | | | | | Was: Mentioned function returns -1 if adding of primary partition is impossible. Caller treats this value as size_t (res variable) and then compares it for negative values, totally ignoring errors. Becomes: Now function takes address to variable and fills it with partition number. Caller treats return value as int and use it appropriately. [kzak@redhat.com: - don't mix return code and partno at all] Signed-off-by: Boris Egorov <egorov@linux.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: missing break in switchBoris Egorov2014-11-131-0/+1
| | | | | Signed-off-by: Boris Egorov <egorov@linux.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: (nilfs) fix typoBoris Egorov2014-11-131-1/+1
| | | | | Signed-off-by: Boris Egorov <egorov@linux.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: improve wording and formatting of man pageBenno Schulenberg2014-11-131-37/+37
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk: (dos) be sure that sorted EBR list is terminatedKarel Zak2014-11-131-5/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix table_add_freespace(), add debug messagesKarel Zak2014-11-132-5/+20
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: cleanup menuitem draw functionsKarel Zak2014-11-131-19/+55
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: remove [Load] from menuKarel Zak2014-11-133-22/+9Star
| | | | | | | | | This functionality will be rarely used, so it does not make sense to waste screen space with this menu item. It's enough to provide this functionality in "Select label type" dialog (cfdisk --zero and then 'L' command). Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: add support for sfdisk scriptsKarel Zak2014-11-123-4/+125
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add support for sfdisk scriptsKarel Zak2014-11-122-0/+91
| | | | | | | | | New commands 'I' and 'O' allows to read and write sfdisk compatible scripts by fdisk. It means that you can save your work (partition table) and later use it (in fdisk, sfdisk or cfdisk) to create a new partition table. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix script parser, add debug messagesKarel Zak2014-11-121-7/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) don't offer first sector before the first partionKarel Zak2014-11-101-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GPT first usable LBA is usually aligned to grain (1MiB), but for small (<=4MiB) devices we strictly follow sector sizes. In this case there is a small space in front of the aligned begin of the first partition. This useless space should not be offered for the next partitions. Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 32768 bytes Disklabel type: gpt Disk identifier: 041E2D54-AD0C-4C7E-A50D-363D23058D47 Device Start End Size Type /dev/sdb1 40 2087 1M Linux filesystem Command (m for help): n Partition number (2-128, default 2): First sector (34-8158, default 2088): ^^ first usable LBA is 34, but first aligned (recommended) LBA is 40, we use it for the first partition. All this is correct, but the space before the first partition should be ignored. Fixed version: Command (m for help): n Partition number (2-128, default 2): First sector (2088-8158, default 2088): ^^^^ Note this problem does not exist for "normal" (large) devices where first usable LBA is aligned to grain. Reported-by: Boaz Harrosh <boaz@plexistor.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) make mode more readableKarel Zak2014-11-101-39/+43
| | | | | | | | * use check_ prefix for checking functions * use plural in function names where we work with more partitions than one * always use "ents" when when we work with gpt entries array Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fdisk_read_firstsector should seek to offset 0Samuel Thibault2014-11-101-0/+7
| | | | | | | The current offset of cxt->dev_fd may not be still 0, notably when blkdev_get_size has to resort to using blkdev_find_size Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org
* tests: simplify and update swaplabel testKarel Zak2014-11-102-8/+4Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/statfs_magic: use macro rather than type for f_typeKarel Zak2014-11-102-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: make final report more human readableKarel Zak2014-11-071-10/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: device write code refactoringKarel Zak2014-11-071-13/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: device open code refactoringKarel Zak2014-11-071-43/+50
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: always use header from control structKarel Zak2014-11-071-19/+39
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>