summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* fdisk: add --protect-bootKarel Zak2015-04-132-1/+10
| | | | | | | | Now fdisk erases the begin of the device when create a new disk label, it seems like disadvantage for some use-cases. Reported-by: Jean-Loup 'clippix' Bogalho <clippix@lse.epita.fr> Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: enable bootbits protectionKarel Zak2015-04-131-0/+1
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1210428 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: support bootbits protection from (p)MBRKarel Zak2015-04-1311-30/+106
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: improve -N warningsKarel Zak2015-04-132-3/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add sfdisk resize testsKarel Zak2015-04-134-0/+74
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: require wipefs for sfdisk/gptKarel Zak2015-04-131-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (dos) retain existing boot flag when resizing a partitionKarel Zak2015-04-132-5/+6
| | | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1210912 Signed-off-by: Karel Zak <kzak@redhat.com> Co-Author: awilliam@redhat.com
* libfdisk: recognize FAT32 partitions hidden by Acronis softwareJörg Jenderek2015-04-082-0/+2
| | | | | | References: http://www.acronis.de/products/trueimage Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Jörg Jenderek <joerg.jen.der.ek@gmx.net>
* Merge branch 'fix-last' of https://github.com/rudimeier/util-linuxKarel Zak2015-04-071-4/+4
|\ | | | | | | | | | | * 'fix-last' of https://github.com/rudimeier/util-linux: last, fix race when comparing time stamps last: fix first (current) runlevel line
| * last, fix race when comparing time stampsRuediger Meier2015-03-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | It is just luck if two time() calls happen within the same second. Introduced in 31d28e09. Actually I don't like adding another global variable but this way we avoid bigger refactoring. IMO it's questionable why lastdate, lastdown, etc. are initialized with current time() at all. It looks unsafe to print "still running" always when logout_time = now. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * last: fix first (current) runlevel lineRuediger Meier2015-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 744c7fec lastrch was not set to current time anymore, but we need it. # broken: $ ./last -x | grep -m 2 runlevel runlevel (to lvl 5) 3.11.10-25-deskt Wed Feb 18 13:11 - 01:00 (-16484+-12:-11) runlevel (to lvl 5) 3.11.10-25-deskt Thu Jan 22 16:50 - 13:11 (26+20:21) # fixed: $ ./last -x | grep -m 2 runlevel runlevel (to lvl 5) 3.11.10-25-deskt Wed Feb 18 13:11 still running runlevel (to lvl 5) 3.11.10-25-deskt Thu Jan 22 16:50 - 13:11 (26+20:21) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | cal: add -Y and -n <num>Max Klinger2015-04-072-100/+107
| | | | | | | | | | | | | | | | | | | | | | [kzak@redhat.com: - add month_in_row to avoid extra meaning of num_month=-3, - add header_year - add long option for -Y - define conflicts between -Y, -y and -n - remove ctl.yflag] Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | Merge branch 'test-fixes' of https://github.com/rudimeier/util-linuxKarel Zak2015-04-075-11/+32
|\ \ | | | | | | | | | | | | | | | | | | | | | * 'test-fixes' of https://github.com/rudimeier/util-linux: tests: mount/rlimit tries to restore mtab tests: fix, don't call ts_die from subshell tests: ts_scsi_debug_init() sleeps a bit earlier tests: fix cramfs/mkfs for BE and different pagesizes
| * | tests: mount/rlimit tries to restore mtabRuediger Meier2015-04-021-2/+11
| | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | tests: fix, don't call ts_die from subshellRuediger Meier2015-04-021-3/+1Star
| | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | tests: ts_scsi_debug_init() sleeps a bit earlierRuediger Meier2015-04-021-4/+4
| | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | tests: fix cramfs/mkfs for BE and different pagesizesRuediger Meier2015-04-022-2/+16
| | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | | Merge branch 'fix-tinfo-typo' of https://github.com/rudimeier/util-linuxKarel Zak2015-04-071-1/+1
|\ \ \ | | | | | | | | | | | | | | | | * 'fix-tinfo-typo' of https://github.com/rudimeier/util-linux: build-sys: typo -ltinfo
| * | | build-sys: typo -ltinfoRuediger Meier2015-03-281-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | | | whereis: trivial spelling and grammar fixMike Place2015-04-071-3/+3
| | | | | | | | | | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | | logger: fix memory leaksSami Kerola2015-04-071-1/+2
| | | | | | | | | | | | | | | | | | | | Reported-by: Patrick Plagwitz <patrick.plagwitz@fau.de> Signed-off-by: Sami Kerola <sami.kerola@lastminute.com>
* | | | logger: generate header when reading message from stdinPatrick Plagwitz2015-04-071-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes crashing error, that ought not to be simply avoided. $ echo foo | logger -n localhost Segmentation fault (core dumped) If the ctl->hdr is just checked not to be NULL syslog message will not have valid header, so generating such is not optional when reading message from stdin and writing it to remote destination. Reviewed-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Patrick Plagwitz <patrick.plagwitz@fau.de> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | | | wall: do not use a temporary file.Karel Zak2015-04-031-36/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue with using a temporary file in wall is that wall runs as setgid. This means that an unprivileged user who runs wall can modify wall's temporary files, even if those are mode 0600, so the unprivileged user can edit and effectively suppress the banner. The fix is to simply not use temporary files. [kzak@redhat.com: - rewrite growing string functions - use struct buffer - add buf_print() function] Signed-off-by: Karel Zak <kzak@redhat.com> Co-Author: Jann Horn <jann@thejh.net>
* | | | libmount: add note about flock() to docsKarel Zak2015-04-021-0/+4
| |/ / |/| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | lsblk: don't ignore dependences for partitioned deviesKarel Zak2015-04-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code only lists partitions, but ignore another dependencies on whole-disk device: $ lsblk /dev/sdb NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 298.1G 0 disk └─sdb1 8:17 0 298.1G 0 part $ ls /sys/block/sdb/holders/ dm-0 fixed version: $ lsblk /dev/sdb NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 298.1G 0 disk ├─sdb1 8:17 0 298.1G 0 part └─mpatha 253:0 0 298.1G 0 mpath └─mpatha1 253:1 0 298.1G 0 part Signed-off-by: Karel Zak <kzak@redhat.com>
* | | lsblk: follow kernel for inverse treeKarel Zak2015-04-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For multi-path devices kernel defines dependence between the device and whole-list: $ ls /sys/block/dm-0/slaves/ sdb but lsblk inserts partition into the tree: $ lsblk -s -oNAME,KNAME /dev/dm-1 mpatha1 dm-1 └─mpatha dm-0 └─sdb1 sdb1 <--- ! └─sdb sdb Signed-off-by: Karel Zak <kzak@redhat.com>
* | | lsblk: add debug supportKarel Zak2015-04-011-11/+76
| | | | | | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | cfdisk: cleanup extra partitions info for slangKarel Zak2015-03-311-35/+18Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch removes problem with getch() on slang, now the code is based on subwin() and extra info window is persistent. A new problem is that slang does not keep sub-window border persistent. I'm going to ignore this slang problem... use ncurses dude! Signed-off-by: Karel Zak <kzak@redhat.com>
* | | build-sys: define cfdisk dependence on open_memstreamKarel Zak2015-03-301-1/+2
| | | | | | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | mount: fix lazytime docsKarel Zak2015-03-301-1/+0Star
| | | | | | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | libmount: add support for MS_LAZYTIMEKarel Zak2015-03-303-0/+35
| | | | | | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | | setarch: fix regression for sparc buildsWaldemar Brodkorb2015-03-301-1/+1
|/ / | | | | | | | | | | | | | | | | With following commit: 5edb0ea6bbd57dd916417737f98c9109dc1ecb5b Sparc cross-compile fails. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
* | sfdisk: cleanup prompt usageKarel Zak2015-03-271-6/+13
| | | | | | | | | | | | | | | | Let's use fgets-like callback only when compiled with readline, otherwise (and also for non-tty) print prompt by printf(). Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* | cfdisk: provide extra partinfo with "x"Ondrej Oprala2015-03-273-22/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new 'extra' info provides: * filesystem information from libblkid (TYPE, UUID, LABEL) This feature is based on libblkid ability to probe specified area on the device. It allows to probe for filesystems although the partition devices (e.g. /dev/sda2) does not exist. For example from disk image: # cfdisk /home/archive/fs-images/disk.img * additional information from libfdisk (partition UUID, Name, ...) * mount information from libmount (from fstab or mountinfo) Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com> Co-Author: Karel Zak <kzak@redhat.com>
* | libfdisk: don't return empty strings from fdisk_partition_to_string()Karel Zak2015-03-271-5/+5
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | build-sys: add HAVE_LIBMOUNTKarel Zak2015-03-271-0/+3
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | build-sys: add TINFO_LIBS_STATICKarel Zak2015-03-271-24/+31
| | | | | | | | | | | | | | | | and use this variable for $READLINE_LIBS_STATIC. Note the patch also moves READLINE checks after TINFO check. Signed-off-by: Karel Zak <kzak@redhat.com>
* | build-sys: fix READLINE_LIBS_STATIC usage for fdiskKarel Zak2015-03-261-2/+2
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | sfdisk: fix -a vs. -A bugKarel Zak2015-03-262-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | The -A has been originally used for --activate, since v2.26 it's used for --append. This is stupid mistake. This patch reverts the change to: -A, --activate -a, --append Note that --append is a new command line option in v2.26. Addresses: https://bugs.archlinux.org/task/44349 Signed-off-by: Karel Zak <kzak@redhat.com>
* | docs: document --exclude for testsKarel Zak2015-03-261-0/+10
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add documentation about environment variablesRuediger Meier2015-03-261-0/+50
| | | | | | | | | | | | Introduced in 8e3ac29e, now advertised :) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | tests: verify logger return valueRuediger Meier2015-03-2627-1/+193
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | tests: avoid &>> for bash compatibilityRuediger Meier2015-03-262-6/+6
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | tests: fix getopt for old glibcRuediger Meier2015-03-261-3/+3
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | build-sys: python is optional, don't fail when missingKarel Zak2015-03-261-4/+9
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | build-sys: ncurses is optional, don't fail when missingKarel Zak2015-03-261-3/+4
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add --exclude=<list> for run.shKarel Zak2015-03-251-0/+20
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | build-sys: support static build with readlineKarel Zak2015-03-252-3/+5
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: more(1) depends on terminal, force to TERM=linuxKarel Zak2015-03-251-0/+1
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | docs: remove obsolete things from TODOKarel Zak2015-03-251-13/+0Star
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>