libmount: improve mnt_reset_fs()

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: reuse allocated fs in parser

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: add private mnt_context_get_mtab_for_target()

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: fix utab entry on remount

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>
build-sys: use CLOCKGETTIME_LIBS

Signed-off-by: Karel Zak <kzak@redhat.com>
build-sys: move all around clock_gettime() to monotonic.c

Signed-off-by: Karel Zak <kzak@redhat.com>
lib/colors: fix double free on error path

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>
blkid: add hint about lsblk to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
login: ignore SIGXFSZ when write to lastlog

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>
libmount: fix lock test to use real time to sync

Signed-off-by: Karel Zak <kzak@redhat.com>
aggety: always set default serial line speed

* 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>
libfdisk: (dos) allow to maximize partition

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>
ibfdisk: (gpt) allow to maximize partition

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>
build-sys: cleanup library symbol files

Signed-off-by: Karel Zak <kzak@redhat.com>
agetty: don't ignore TERM

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>
agetty: keep the current baud before try 9600 on serial lines

Signed-off-by: Karel Zak <kzak@redhat.com>
agetty: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: add ref.counting to ask API

Signed-off-by: Karel Zak <kzak@redhat.com>
agetty: use futimens, check for all in configure.ac

It seems better to warn about --reload in ./configure if futimens or
inotify_init1 are missing.

The patch also replaces futimes() with futimens() to make the code
compatible with Uclibc.

Addresses: https://github.com/karelzak/util-linux/issues/133
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/colors: use static buffers when parse scheme

* use static buffers when parse scheme colors
* cleanup deallocation on error in sequence parser

Signed-off-by: Karel Zak <kzak@redhat.com>