| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
Based on patch Alexander Samilovskih <alexsamilovskih@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
|
|
|
|
|
| |
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
| |
Addresses partially: http://bugs.debian.org/769462
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
==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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Sending signal indicating invalid memory reference makes AddressSanitizer
to report false positive test failure.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
==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>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Signed-off-by: Boris Egorov <egorov@linux.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Boris Egorov <egorov@linux.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|