summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libmount: fix use of preprocessor identifierSami Kerola2017-03-131-1/+1
| | | | | | | libmount/src/context_mount.c:990:5: warning: undefined preprocessor identifier 'USE_LIBMOUNT_SUPPORT_MTAB' Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: stop mixing declarations and codeSami Kerola2017-03-134-8/+9
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/colors: assert rathen than overflow [-Wnull-dereference]Karel Zak2017-03-131-1/+4
| | | | | | | | lib/colors.c: In function 'colors_read_schemes': lib/colors.c:412:7: warning: potential null pointer dereference [-Wnull-dereference] Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* last: use domain string more carefullyKarel Zak2017-03-131-4/+6
| | | | | | | Use xstrcpy() to explicitly terminate the domain string. Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* login: prevent OOB read on illegal /etc/hushloginsTobias Stoeckmann2017-03-131-1/+2
| | | | | | | | | If the file /etc/hushlogins exists and a line starts with '\0', the login tools are prone to an off-by-one read. I see no reliability issue with this, as it would clearly need a hostile action from a system administrator. But for the sake of correctness, I've sent this patch nonetheless.
* libblkid: Fix blkid.conf parsingTobias Stoeckmann2017-03-131-1/+1
| | | | | | | | | The SEND_UEVENT=yes|no line is not properly parsed, because the offset jumps one byte too far behind the equal sign. Therefore, every configuration that contains the line "SEND_UEVENT=yes" still does not send an uevent. The fix is simple: adjust the offset to be "12" instead of "13".
* libsmartcols: allow to add column to already used tableKarel Zak2017-03-031-7/+18
| | | | | | | | Now it's impossible to add new column if the table already contains lines with data. This patch forces library to realloc cell array in the lines to accept a new column. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: support columns separators greater than one output cellKarel Zak2017-03-022-4/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: note about small partition in man pageKarel Zak2017-03-021-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: add note about alignment to man pageKarel Zak2017-03-021-3/+14
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/417 Signed-off-by: Karel Zak <kzak@redhat.com>
* column: make more obvious what is default behaviorKarel Zak2017-03-012-9/+9
| | | | | | | | | | | | | | | | | | | | The man page contains mistakes. The default is to fill columns before lines: $ printf 'aaaaaaaaaaaaaaaaaaaaaa\nBBBBBBBBBBBBBBBBBBBBB\nXXXXXXX\nYYYYYYYYYYY\nZZZZZ' > data $ column --columns 80 < data aaaaaaaaaaaaaaaaaaaaaa XXXXXXX ZZZZZ BBBBBBBBBBBBBBBBBBBBB YYYYYYYYYYY $ column --fillrows --columns 80 < data aaaaaaaaaaaaaaaaaaaaaa BBBBBBBBBBBBBBBBBBBBB XXXXXXX YYYYYYYYYYY ZZZZZ The patch also rename functions in the code to make it more obvious for code readers. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cosmetic change to mnt_table_find_srcpath()Karel Zak2017-02-281-6/+5Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: return tab entry for default nodePetr Vorel2017-02-281-1/+28
| | | | | | This is useful for lsblk. Signed-off-by: Petr Vorel <pvorel@suse.cz>
* setterm: fix bitfield warning [smatch]Sami Kerola2017-02-281-1/+1
| | | | | | | term-utils/setterm.c:179:27: warning: dubious bitfield without explicit `signed' or `unsigned' Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libfdisk: (dos) add ID related debug messagesKarel Zak2017-02-271-2/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add version to debug outputKarel Zak2017-02-271-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: fix a memory leak when parsing \S in issue filesMatthias Gerstner2017-02-271-0/+3
|
* unshare: add note about sysfs and procfsKarel Zak2017-02-271-0/+5
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1390057 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: add note about branches to READMEKarel Zak2017-02-241-1/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: add count option to bash-completionKarel Zak2017-02-242-2/+6
| | | | | | and fix typo in man page Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: use optutils.h to check mutually exclusive optionsKarel Zak2017-02-241-6/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: Add --count optionDamien Le Moal2017-02-242-39/+76
| | | | | | | | | | | The length option is used to specify the number of zones to operate on. To be more consistent with other tools, have this option use a number of sectors and introduce the --count option to allow users to specify a number of zones. The --count and --length options cannot be used together on the command line. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
* blkzone: Improve zone information printDamien Le Moal2017-02-242-32/+29Star
| | | | | | | | | | | Add "0x" to the zone start, length and write pointer print to make it always clear that the values are Hexadecimal. Also update the zone condition string and associated comments to match more closely the wording in the standard document. The man page is also updated to match the new wording. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
* blkzone: Report all zones if length is not specifiedDamien Le Moal2017-02-241-54/+72
| | | | | | | | | Report all zones of the block device when length is not specified on the command line. To do this, introduce an inner loop in blkzone_report to repeatedly issue report zone ioctl to the device. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
* blkzone: Reset all zones when length is not specifiedDamien Le Moal2017-02-241-3/+5
| | | | | | | If length is 0, operate on all zones starting from offset. This also fix the maximum length calculation from offset. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
* blkreport, blkreset: remove in favour of blkzoneKarel Zak2017-02-238-627/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: add bash-completionKarel Zak2017-02-232-0/+51
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: add new command (merge blkreport and blkreset)Karel Zak2017-02-235-0/+466
| | | | | | | This new command is based on the original implementation of blkreport and blkreset command. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: simplify UL_ENABLE_ALIAS() semanticKarel Zak2017-02-212-4/+3Star
| | | | | | | | Let's follow only $enable_ variables. In this case the MASTERNAME (e.g. [schedutils] for --enable-schedutils) has to be without UL_BUILD_INIT. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fix --disable-all-programs --enable-schedutilsKarel Zak2017-02-203-6/+26
| | | | | | | | | | | | | * add UL_ENABLE_ALIAS(NAME, MASTERNAME) to initialize $enable_<name> according to MASTERNAME. Note that we have to use $build_<mastername>, the $enable_<mastername> is just AC_ARG_ENABLE() stuff only. The $build_ is evaluated and modified by our UL_...() functions. * add enable-schedutils.conf to have build-system regression test for this use-case Addresses: https://github.com/karelzak/util-linux/issues/415 Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: another improvement to the sfdisk wipe testKarel Zak2017-02-202-13/+7Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: remove unnecessary 'static' keywordKarel Zak2017-02-201-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* findmnt: fix couple memory leaks [cppcheck]Sami Kerola2017-02-201-5/+5
| | | | | | In both cases FILE *f was leaked. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libblkid: declare across file variables in blkidP.h [smatch scan]Sami Kerola2017-02-202-5/+5
| | | | | | | | | Else these variables will cause following warning: libblkid/src/superblocks/superblocks.c:165:29: warning: symbol 'superblocks_drv' was not declared. Should it be static? Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/idcache: add void to function declaration [smatch scan]Sami Kerola2017-02-201-1/+1
| | | | | | | lib/idcache.c:29:29: warning: non-ANSI function declaration of function 'new_idcache' Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: add static keyword to where needed [smatch scan]Sami Kerola2017-02-2038-200/+199Star
| | | | | | | text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be static? Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-2073-655/+655
| | | | | | | | | | text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cfdisk: avoid use of VLA in combination with sizeof() [smatch scan]Sami Kerola2017-02-201-2/+5
| | | | | | | | | disk-utils/cfdisk.c:1066:29: error: cannot size expression One should use sizeof() only when variable size can be known at time of compilation. That is not the case with variable length arrays. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tests: make sfdisk wipe partition optionalKarel Zak2017-02-171-4/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add sample-fdisk-mkpart binaryKarel Zak2017-02-173-0/+184
| | | | | | | | | | | | | | | | | For example: # sample-fdisk-mkpart --device /dev/sdc 1M 2M 3M - 5M # fdisk -l /dev/sdc ... Device Boot Start End Sectors Size Id Type /dev/sdc1 2048 4095 2048 1M 83 Linux /dev/sdc2 4096 8191 4096 2M 83 Linux /dev/sdc3 8192 14335 6144 3M 83 Linux /dev/sdc4 14336 204799 190464 93M 5 Extended /dev/sdc5 16384 26623 10240 5M 83 Linux Addresses: https://github.com/karelzak/util-linux/issues/204 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (dos) make it possible to create primary/logical by templateKarel Zak2017-02-171-3/+21
| | | | | | | | Let's check partition partno if specified to create logical or primary partition. Addresses: https://github.com/karelzak/util-linux/issues/204 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) make sure it's GPT in public APIKarel Zak2017-02-171-3/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: verify partno from templateKarel Zak2017-02-172-2/+3
| | | | | | | * verify partno from template when create a new partition * remove unnecessary l->ext_offset check Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: (sfdisk) tell kernel about new partitionKarel Zak2017-02-172-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add udevadm settle to sfdisk wipeKarel Zak2017-02-161-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add missing fileKarel Zak2017-02-161-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add --show-diffKarel Zak2017-02-163-2/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add non-widechar.confKarel Zak2017-02-161-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: use buffer editor for ui_get_string()Karel Zak2017-02-161-53/+46Star
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/403 Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/mbsedit: add simple buffer editorKarel Zak2017-02-163-0/+255
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>