summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* fstrim: add control structKarel Zak2018-07-311-19/+24
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update fdisk dialogsKarel Zak2018-07-3110-40/+40
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: Accept negative numbers for last sector inputAwal Garg2018-07-3112-20/+57
| | | | | | | | [kzak@redhat.com: - add note to the man page - add '-' to the dialog query - cleanup functions names and libfdisk.sym] Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: remove ntpd from man pageKarel Zak2018-07-311-7/+4Star
| | | | | | | | It seems better to use generic "NTP daemon" in the man page than points to specific ntpd(1) implementation as some distros use for example chronyd(1) rather than old ntpd(1). Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fix resource leak [coverity scan]Karel Zak2018-07-251-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: fix mem leak, improve code [coverity scan]Karel Zak2018-07-251-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use xstrncpy() for PT id [coverity scan]Karel Zak2018-07-251-1/+2
| | | | | | | | It's probably unnecessary change as blkid_parttable_set_id() is used by MBR code and we use proper buffer size there, but better safe than sorry. Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: add note about --disable-all-programsKarel Zak2018-07-241-0/+19
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/666 Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkid: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* login: use const qualifier for username from PAM or struct passwd [-Wcast-qual]Karel Zak2018-07-231-6/+11
| | | | | | | | | It seems more robust to use 'const' qualifier for username if this variable points to external resources like PAM or struct passwd. The patch introduces new variable cmd_username for username specified on login(1) command line. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: (utils) fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors:: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setterm: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setterm: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-3/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-233-6/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix compiler warning [-Wcast-qual]Karel Zak2018-07-231-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/loopdev: fix compiler warning [-Wcast-qual]Karel Zak2018-07-231-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/mangle: const quialifier cleanupKarel Zak2018-07-203-6/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/list, include/c: update and container_of()Karel Zak2018-07-202-7/+12
| | | | | | | | * update container_of() to version without "const" qualifier * use container_of() in list_entry() Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: const qualifier cleanupKarel Zak2018-07-2012-55/+57
| | | | | | | | * use "const" in functions where we don't modify arguments * use "const" when cast from const buffer to any struct (superblock etc.) Signed-off-by: Karel Zak <kzak@redhat.com>
* include/all-io: const cleanupKarel Zak2018-07-201-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup const in umount codeKarel Zak2018-07-201-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/color-names: const cleanupKarel Zak2018-07-201-3/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add missing constKarel Zak2018-07-201-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: use const char in swaps parserKarel Zak2018-07-201-1/+1
| | | | | | The parser does not modify the string, so let's keep it "const char". Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: use const char in mountinfo parserKarel Zak2018-07-201-2/+3
| | | | | | The parser does not modify the string, so let's keep it "const char". Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: use const char in fstab parserKarel Zak2018-07-201-19/+27
| | | | | | The parser does not modify the string, so let's keep it "const char". Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/strutils: follow const in parse_size()Karel Zak2018-07-201-13/+15
| | | | | | | | | * don't cast from char to const char * don't share endptr from strtoxxx() with rest of the code as the end pointer is char, but code works with const chars Signed-off-by: Karel Zak <kzak@redhat.com>
* include/strutils: remove unnecessary castKarel Zak2018-07-201-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: fix warningKarel Zak2018-07-201-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add -Wdiscarded-qualifiersKarel Zak2018-07-201-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add details about mtab and --namespace to mount.8Karel Zak2018-07-192-6/+32
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add since tag for new functionsKarel Zak2018-07-191-0/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: add note about --list -I <maj,...>Karel Zak2018-07-181-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: add --delay <seconds>Karel Zak2018-07-186-8/+102
| | | | | | | | | | | * add command line option --delay <seconds> * read RTC type from /sys/class/rtc/rtc<N>/name * default to 0.5 (500ms) for rtc_cmos or when RTC type is impossible determine; otherwise delay is 0. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add -Wno-cast-function-type for pythonKarel Zak2018-07-182-1/+5
| | | | | | | | | | | | | | | | | libmount/python/pylibmount.c:158:19: warning: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type] This is generic problem in all Python C code and gcc v8. The another possible (and probably more correct) way is to add unused argument to all API functions. Unfortunately, this solution is pretty invasive. The question is if gcc is not too paranoid in this case. For more details see https://bugs.python.org/issue33012. It seems Python guys also prefer CFLAGS modification for now. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix compiler warning [-Wmaybe-uninitialized]Karel Zak2018-07-181-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: remove redundant conditionKarel Zak2018-07-181-1/+1
| | | | | | | [util-linux-2.32.1/login-utils/lslogins.c:601]: (style) Redundant condition: If '!EXPR', the comparison 'EXPR != '$'' is always true. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/strutils: remove redundant conditionKarel Zak2018-07-181-1/+1
| | | | | | | [util-linux-2.32.1/lib/strutils.c:122]: (style) Redundant condition: If 'EXPR == '0'', the comparison 'EXPR' is always true. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: remove redundant conditionKarel Zak2018-07-181-1/+1
| | | | | | | util-linux-2.32.1/disk-utils/mkfs.cramfs.c:362]: (style) Redundant condition: If 'EXPR >= 16777216', the comparison 'EXPR' is always true. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/pager: fix compiler warning [-Wrestrict]Karel Zak2018-07-181-2/+4
| | | | | | | lib/pager.c: In function ‘pager_preexec’: lib/pager.c:148:12: warning: passing argument 2 to restrict-qualified parameter aliases with argument 4 [-Wrestrict] Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: add fdisk to TODOKarel Zak2018-07-171-0/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: add hwclock to TODOKarel Zak2018-07-171-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: Check for a secondary LUKS2 header.Milan Broz2018-07-111-13/+47
| | | | | | | | | | | This patch adds search for a secondary LUKS2 header, if the primary one is corrupted. This patch is primarily needed for wipefs that should wipe both signatures (otherwise LUKS2 header recovery can use secondary header and revert wipefs action). Signed-off-by: Milan Broz <gmazyland@gmail.com>
* * break up large strings for PySys_WriteStdout()Frank Schaefer2018-07-111-13/+43
|
* tests: add mountinfo with empty sourceKarel Zak2018-07-103-0/+90
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: (mountinfo) parse empty strings in sourceAlban Crequy2018-07-101-5/+28
| | | | | | | | | | | | | | | | | | | | | The source of a mount in /proc/self/mountinfo can unfortunately be an empty string. Before this patch, 'mount' and 'mountpoint' fail as following: $ sudo mount -t tmpfs "" /tmp/bb $ mount mount: /proc/self/mountinfo: parse error at line 64 -- ignored $ mountpoint /tmp/bb /tmp/bb is not a mountpoint This patch fixes the parsing. It is unfortunately more complex because sscanf() does not handle fields with empty strings easily. Other projects have their own parser for mountinfo and have similar issues. I know of runc and runtime-tools (I'll send a patch for those two) but there are probably others. Signed-off-by: Alban Crequy <alban@kinvolk.io>