]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
9 years agodocs: mentintion default udp and tcp ports logger is using
Sami Kerola [Sat, 9 Aug 2014 08:09:16 +0000 (09:09 +0100)] 
docs: mentintion default udp and tcp ports logger is using

The fact that 'syslog tcp/514' does not exist in RFS's, which has lead
to 'syslog-conn 601/tcp' be used in place could be a suprice and should
be told in manual.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: set function arguments read-only when possible
Sami Kerola [Sat, 9 Aug 2014 07:57:51 +0000 (08:57 +0100)] 
logger: set function arguments read-only when possible

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: optimize string initializations
Sami Kerola [Sat, 9 Aug 2014 07:38:58 +0000 (08:38 +0100)] 
logger: optimize string initializations

Setting whole array to be completely full of nulls cannot be as quick as
making the only significant member of the array when needed.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: remove openlog(3) options
Sami Kerola [Sat, 9 Aug 2014 00:04:50 +0000 (01:04 +0100)] 
logger: remove openlog(3) options

One variable less, and more importantly bit operations become unnecessary
in if statements.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: allow use of --id=ppid when logging locally
Sami Kerola [Fri, 8 Aug 2014 23:49:46 +0000 (00:49 +0100)] 
logger: allow use of --id=ppid when logging locally

There is no obvious way to make syslog(3) to print both pid or ppid, so
duplicate the libc syslog() to logger.  Making the ppid printing work
using unix socket has side effect of local becoming capable to use both
rfc format output, which is hopefully seen as good thing.  The
syslog_local() is format wise one-to-one copy with glibc syslog(3)
format.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agofdisk: add independent debug stuff
Karel Zak [Fri, 15 Aug 2014 10:38:02 +0000 (12:38 +0200)] 
fdisk: add independent debug stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: move fdisk_ask_partnum() to API
Karel Zak [Fri, 15 Aug 2014 10:34:42 +0000 (12:34 +0200)] 
libfdisk: move fdisk_ask_partnum() to API

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agofdisk: use libfdisk public API only
Karel Zak [Fri, 15 Aug 2014 10:16:55 +0000 (12:16 +0200)] 
fdisk: use libfdisk public API only

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: add geometry to API, cleanup
Karel Zak [Fri, 15 Aug 2014 10:16:27 +0000 (12:16 +0200)] 
libfdisk: add geometry to API, cleanup

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agocfdisk: use only public libfdisk API
Karel Zak [Fri, 15 Aug 2014 08:50:33 +0000 (10:50 +0200)] 
cfdisk: use only public libfdisk API

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: fdisk_label_is_labeltype()
Karel Zak [Fri, 15 Aug 2014 08:49:51 +0000 (10:49 +0200)] 
libfdisk: fdisk_label_is_labeltype()

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: more docs
Karel Zak [Thu, 14 Aug 2014 19:04:01 +0000 (21:04 +0200)] 
libfdisk: more docs

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: final parttype API cleanup
Karel Zak [Thu, 14 Aug 2014 11:28:37 +0000 (13:28 +0200)] 
libfdisk: final parttype API cleanup

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: move get_parttypes to label API
Karel Zak [Thu, 14 Aug 2014 10:01:38 +0000 (12:01 +0200)] 
libfdisk: move get_parttypes to label API

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: (gpt) allow to specify attr bit by API
Karel Zak [Thu, 14 Aug 2014 09:33:46 +0000 (11:33 +0200)] 
libfdisk: (gpt) allow to specify attr bit by API

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: make it possible to get fields for all labes
Karel Zak [Wed, 13 Aug 2014 22:27:28 +0000 (00:27 +0200)] 
libfdisk: make it possible to get fields for all labes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: cleanup label geometry API
Karel Zak [Wed, 13 Aug 2014 22:09:48 +0000 (00:09 +0200)] 
libfdisk: cleanup label geometry API

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: cleanup fdisk_is_label stuff
Karel Zak [Wed, 13 Aug 2014 21:57:54 +0000 (23:57 +0200)] 
libfdisk: cleanup fdisk_is_label stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: clean up API (alignment.c)
Karel Zak [Wed, 13 Aug 2014 21:27:00 +0000 (23:27 +0200)] 
libfdisk: clean up API (alignment.c)

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: clean up API (context.c)
Karel Zak [Wed, 13 Aug 2014 20:26:53 +0000 (22:26 +0200)] 
libfdisk: clean up API (context.c)

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agocfdisk: add libfdisk independent debug stuff
Karel Zak [Wed, 13 Aug 2014 19:21:46 +0000 (21:21 +0200)] 
cfdisk: add libfdisk independent debug stuff

Now it's possible to use
CFDISK_DEBUG=0xffff ./cfdisk
to debug only cfdisk UI.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add debug tests
Ondrej Oprala [Wed, 13 Aug 2014 12:36:45 +0000 (14:36 +0200)] 
tests: add debug tests

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
9 years agoinclude/debug: allow to speficy empty masknames
Karel Zak [Wed, 13 Aug 2014 12:19:21 +0000 (14:19 +0200)] 
include/debug: allow to speficy empty masknames

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoinclude/debug: cleanup masks
Karel Zak [Wed, 13 Aug 2014 12:13:32 +0000 (14:13 +0200)] 
include/debug: cleanup masks

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoinclude/debug: make masknames optional
Karel Zak [Wed, 13 Aug 2014 11:51:42 +0000 (13:51 +0200)] 
include/debug: make masknames optional

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibs/debug: accept human readable names for _DEBUG=
Ondrej Oprala [Thu, 31 Jul 2014 11:23:07 +0000 (13:23 +0200)] 
libs/debug: accept human readable names for _DEBUG=

For example
$ LIBMOUNT_DEBUG=tab,cache findmnt

to debug only TAB and CACHE subsystem.

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: rename fdisk_column to fdisk_field
Karel Zak [Wed, 13 Aug 2014 09:12:27 +0000 (11:12 +0200)] 
libfdisk: rename fdisk_column to fdisk_field

.. to make the API and fdisk(s) code more readable.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: remove dependence on libsmartcols
Karel Zak [Wed, 13 Aug 2014 08:10:11 +0000 (10:10 +0200)] 
libfdisk: remove dependence on libsmartcols

It's application business to convert libfdisk_table to string.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolib/colors: add function to return color from scheme
Karel Zak [Wed, 13 Aug 2014 08:09:08 +0000 (10:09 +0200)] 
lib/colors: add function to return color from scheme

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibblkid: (gpt) fix PT offset
Karel Zak [Mon, 11 Aug 2014 13:59:04 +0000 (15:59 +0200)] 
libblkid: (gpt) fix PT offset

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoFix bash-completion Makemodule options
Stanislav Brabec [Fri, 8 Aug 2014 17:30:55 +0000 (19:30 +0200)] 
Fix bash-completion Makemodule options

9 years agotests: make ipcs limit calculations work when numbers are large
Sami Kerola [Wed, 6 Aug 2014 22:04:31 +0000 (23:04 +0100)] 
tests: make ipcs limit calculations work when numbers are large

Test suite  failed when I ran it with kernel 3.16.  Error is the
following.

tests/ts/ipcs/limits2: line 31: [: 18446744073692774399: integer expression expected

Reference: http://lkml.iu.edu/hypermail/linux/kernel/1406.0/01869.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agoswapon: remove invalid error string print outs
Sami Kerola [Wed, 6 Aug 2014 20:52:18 +0000 (21:52 +0100)] 
swapon: remove invalid error string print outs

To avoid messages like this:

$ swapon /dev/zram0
swapon: /dev/zram0: read swap header failed: Success

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agotextual: remove some inconsistent periods from error messages
Benno Schulenberg [Wed, 6 Aug 2014 20:35:06 +0000 (22:35 +0200)] 
textual: remove some inconsistent periods from error messages

While doing so, also improve translatability and some wordings.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agolscpu: clean up vmware inline asm
Mike Frysinger [Tue, 5 Aug 2014 22:59:50 +0000 (18:59 -0400)] 
lscpu: clean up vmware inline asm

This code is not PIC clean which means it fails to build on hardened
32bit x86 systems (i.e. building as PIE).

While here, optimize the existing cpuid logic slightly.

URL: https://bugs.gentoo.org/518936
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
9 years agozramctl: improve option combination error messaging
Sami Kerola [Wed, 6 Aug 2014 09:35:30 +0000 (10:35 +0100)] 
zramctl: improve option combination error messaging

Use of --algorithm or --streams is not expected to work without
reseting device, that happens when --size is specified, so ensure the
former options to be combined with the later.

[kzak@redhat.com: - make it more generic]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agozramctl: add bash completion script
Sami Kerola [Sun, 3 Aug 2014 14:10:50 +0000 (15:10 +0100)] 
zramctl: add bash completion script

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agozramctl: cannonicalize devname when no fullpath specified
Karel Zak [Mon, 11 Aug 2014 12:39:46 +0000 (14:39 +0200)] 
zramctl: cannonicalize devname when no fullpath specified

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agozramctl: improve error message
Sami Kerola [Sun, 3 Aug 2014 12:42:32 +0000 (13:42 +0100)] 
zramctl: improve error message

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agozramctl: fail status printout when device does not exist
Karel Zak [Mon, 11 Aug 2014 12:26:20 +0000 (14:26 +0200)] 
zramctl: fail status printout when device does not exist

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agozramctl: add details to --size option documentation
Sami Kerola [Sat, 2 Aug 2014 17:43:42 +0000 (18:43 +0100)] 
zramctl: add details to --size option documentation

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agofdisk: update tests and clean up output
Karel Zak [Fri, 8 Aug 2014 10:35:20 +0000 (12:35 +0200)] 
fdisk: update tests and clean up output

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibblkid: (gpt) use real sector size to set PTMAGIC_OFFSET
Karel Zak [Fri, 8 Aug 2014 09:56:06 +0000 (11:56 +0200)] 
libblkid: (gpt) use real sector size to set PTMAGIC_OFFSET

So stupid and 5 years old bug...

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agofdisk: always print warning for mis-aligned partitions
Karel Zak [Fri, 8 Aug 2014 09:33:28 +0000 (11:33 +0200)] 
fdisk: always print warning for mis-aligned partitions

This patch restores the original fdisk behavior and always prints
information about misaligned partitions in 'p'print output.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agocfdisk: move curs_set(1) to ui_end()
Karel Zak [Wed, 6 Aug 2014 13:39:27 +0000 (15:39 +0200)] 
cfdisk: move curs_set(1) to ui_end()

This is probably correct to have curs_set() in ui_end(), but according
to Martin it does not work with slang library from signal handler.

Reported-by: Martin Steigerwald <Martin@lichtvoll.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agozramctl: remove extra \n from usage()
Karel Zak [Wed, 6 Aug 2014 12:55:42 +0000 (14:55 +0200)] 
zramctl: remove extra \n from usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: fix inconsistencies in man pages
Steven Honeyman [Sun, 3 Aug 2014 15:22:24 +0000 (16:22 +0100)] 
docs: fix inconsistencies in man pages

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoMerge branch 'master' of https://github.com/entertainyou/util-linux
Karel Zak [Wed, 6 Aug 2014 07:04:29 +0000 (09:04 +0200)] 
Merge branch 'master' of https://github.com/entertainyou/util-linux

9 years agozramctl: fix typo
Karel Zak [Wed, 6 Aug 2014 07:02:09 +0000 (09:02 +0200)] 
zramctl: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agohexdump: Fix parse format of "byte count without repetition count"
HUANG Wei [Wed, 6 Aug 2014 04:20:18 +0000 (12:20 +0800)] 
hexdump: Fix parse format of "byte count without repetition count"

9 years agozramctl: fix typo
Karel Zak [Tue, 5 Aug 2014 13:47:36 +0000 (15:47 +0200)] 
zramctl: fix typo

Reported-by: Steven Honeyman
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoMerge branch 'master' of https://github.com/ottxor/util-linux
Karel Zak [Tue, 5 Aug 2014 13:39:32 +0000 (15:39 +0200)] 
Merge branch 'master' of https://github.com/ottxor/util-linux

9 years agodocs: improve the wording and formatting of the zramctl man page
Benno Schulenberg [Fri, 1 Aug 2014 12:19:08 +0000 (14:19 +0200)] 
docs: improve the wording and formatting of the zramctl man page

Especially fix the mistaken short option -h for --noheadings.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agozramctl: fix the wording of some message strings
Benno Schulenberg [Fri, 1 Aug 2014 12:19:07 +0000 (14:19 +0200)] 
zramctl: fix the wording of some message strings

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agotests: kill output message change
Sami Kerola [Thu, 31 Jul 2014 22:05:25 +0000 (23:05 +0100)] 
tests: kill output message change

Commit 09af3db48e01e5744f15fd8a2395e0fed36526ea changed how a missing
process is reported, which caused kill test to fail when the test suite
is ran as root.

Reference: https://travis-ci.org/karelzak/util-linux/jobs/31312170
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agodocs: restore the mention of uhelper= and helper= in man page of umount
Benno Schulenberg [Thu, 31 Jul 2014 20:43:29 +0000 (22:43 +0200)] 
docs: restore the mention of uhelper= and helper= in man page of umount

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agobuild-sys: fix double prefix with explict --libdir
Christoph Junghans [Fri, 1 Aug 2014 17:37:08 +0000 (11:37 -0600)] 
build-sys: fix double prefix with explict --libdir

* with configure --prefix=$HOME --libdir=$HOME usrlib_execdir
  ends up being ${exec_prefix}/${libbir}, which is double-prefixed

* fix: use explict given ${libbir} if is matches ${prefix}/*

Signed-off-by: Christoph Junghans <ottxor@gentoo.org>
9 years agozrmactl: add new command to control /dev/zramN devices
Karel Zak [Fri, 1 Aug 2014 10:09:55 +0000 (12:09 +0200)] 
zrmactl: add new command to control /dev/zramN devices

Co-Author: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolib/ismounted: make it more compatible with lsblk output
Karel Zak [Fri, 1 Aug 2014 10:09:33 +0000 (12:09 +0200)] 
lib/ismounted: make it more compatible with lsblk output

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolib/sysfs: allow to write to sysfs attributes
Karel Zak [Fri, 1 Aug 2014 10:08:44 +0000 (12:08 +0200)] 
lib/sysfs: allow to write to sysfs attributes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoMerge branch 'travis' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Thu, 31 Jul 2014 08:55:38 +0000 (10:55 +0200)] 
Merge branch 'travis' of git://github.com/kerolasa/lelux-utiliteetit

* 'travis' of git://github.com/kerolasa/lelux-utiliteetit:
  tests: fix rename subdir check that was failing in travis
  build-sys: remove swap-common.h from sys-utils/Makemodule.am

9 years agolibfdisk: (gpt) add Microsoft Storage Spaces GUID
Sergei Antonov [Thu, 31 Jul 2014 10:46:06 +0000 (12:46 +0200)] 
libfdisk: (gpt) add Microsoft Storage Spaces GUID

Storage Spaces is Microsoft's logical volume management.
It has been around since Windows 8.

Cc: Karel Zak <kzak@redhat.com>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
9 years agotests: fix rename subdir check that was failing in travis
Sami Kerola [Wed, 30 Jul 2014 21:21:08 +0000 (22:21 +0100)] 
tests: fix rename subdir check that was failing in travis

Apparently some or all travis build servers has a bit older coreutils
version.  The coreutils v8.13 added a feature to readlink that allows
user to specify multiple arguments.  Earlier versions gave exactly the
type of error travis_script log has.

+readlink: extra operand `rename_aa/sublink.2'
+Try `readlink --help' for more information.

The commit 0f85e0535bd4e6d19fadca182e4d57660b6bb57b introduced the travis
readlink issue, and has caused failures for 8 days in row (builds 192 -
213).

Reference: https://travis-ci.org/karelzak/util-linux/builds
Reviewed-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agobuild-sys: remove swap-common.h from sys-utils/Makemodule.am
Sami Kerola [Wed, 30 Jul 2014 19:48:46 +0000 (20:48 +0100)] 
build-sys: remove swap-common.h from sys-utils/Makemodule.am

The commit 25a365e moved the file to include/

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agofdformat: clean up usage()
Karel Zak [Tue, 29 Jul 2014 11:53:26 +0000 (13:53 +0200)] 
fdformat: clean up usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agofdformat: Add new switches -f/--from, -t/--to, -r/--repair
Jaromir Capik [Mon, 28 Jul 2014 18:47:09 +0000 (20:47 +0200)] 
fdformat: Add new switches -f/--from, -t/--to, -r/--repair

This commit introduces a support for user configurable
from/to track and a basic repair mode for broken floppies.
It also fixes a recently introduced bug that causes
a line breakage when printing the track number.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update TODO
Karel Zak [Tue, 29 Jul 2014 11:17:35 +0000 (13:17 +0200)] 
docs: update TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agonsenter: allow to use --set{uid,gid} for all namespaces
Karel Zak [Tue, 29 Jul 2014 11:07:44 +0000 (13:07 +0200)] 
nsenter: allow to use --set{uid,gid} for all namespaces

Now it's possible to set UID and GID for user namespaces only. This
patch removes this restriction and allow to use --set{uid,gid} in all
cases. The default for user namespaces is still GID=0, UID=0.

Reported-by: Tomas Doran <bobtfish@bobtfish.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: allow non-inotify tailf to keep up
Andreas Henriksson [Sat, 26 Jul 2014 20:44:01 +0000 (22:44 +0200)] 
tests: allow non-inotify tailf to keep up

When tailf is not using inotify, it seems to sleep for 0.25s between
checks. Just giving a 0.1s time window between update and removal of the
input file thus gives little chance for tailf to succeed.
Similar between startup and append to file, make sure initial
content is read before appending additional data by bumping the time.

This should possibly be bumped much larger to make sure that
the tailf process actually gets a chance to run at all in the
given time window. Otherwise it might fail on really slow/overloaded
machines.
The drawback would then ofcourse be to increase the time it takes
to run the testsuite.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
9 years agodocs: bring the runuser and su man pages closer to standard formatting
Benno Schulenberg [Sun, 27 Jul 2014 18:59:00 +0000 (20:59 +0200)] 
docs: bring the runuser and su man pages closer to standard formatting

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agodocs: give the man page of utmpdump the proper User Commands header
Benno Schulenberg [Sun, 27 Jul 2014 18:58:59 +0000 (20:58 +0200)] 
docs: give the man page of utmpdump the proper User Commands header

Also bring the formatting closer to standard.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agodocs: improve the formatting of the chfn and chsh man pages
Benno Schulenberg [Sun, 27 Jul 2014 18:58:58 +0000 (20:58 +0200)] 
docs: improve the formatting of the chfn and chsh man pages

Also fix a pasting mistake where the chfn man page suggested
to use ypchsh or lchsh for non-local entries.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agodocs: remove all mention of helper= and uhelper= from umount man page
Benno Schulenberg [Sun, 27 Jul 2014 18:58:57 +0000 (20:58 +0200)] 
docs: remove all mention of helper= and uhelper= from umount man page

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agodocs: sort the options in the man pages of hwclock and uuidd
Benno Schulenberg [Sun, 27 Jul 2014 18:58:56 +0000 (20:58 +0200)] 
docs: sort the options in the man pages of hwclock and uuidd

Also improve the formatting a bit.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agodocs: bring the rtcwake man page closer to standard formatting
Benno Schulenberg [Sun, 27 Jul 2014 18:58:55 +0000 (20:58 +0200)] 
docs: bring the rtcwake man page closer to standard formatting

Also sort the options alphabetically, and use the standard comma
instead of the vertical bar to separate short from long option.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agologger: fix untranslated message
Karel Zak [Tue, 29 Jul 2014 10:13:24 +0000 (12:13 +0200)] 
logger: fix untranslated message

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agologger: require --{server,socket} to remote rfc542/rfc3164 log
Karel Zak [Tue, 29 Jul 2014 10:08:47 +0000 (12:08 +0200)] 
logger: require --{server,socket} to remote rfc542/rfc3164 log

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoRevert "wall: wrap message header when it exceeds 79 characters"
Karel Zak [Tue, 29 Jul 2014 09:57:01 +0000 (11:57 +0200)] 
Revert "wall: wrap message header when it exceeds 79 characters"

This reverts commit 93d7baf250495b2385c369afd48137a7363ae4c2.

Ooops... it wasn't my plan to merge this patch. Sorry.

9 years agologger: fix -i=ppid
Karel Zak [Tue, 29 Jul 2014 09:49:00 +0000 (11:49 +0200)] 
logger: fix -i=ppid

For short options (-i) the optional argument contains '='.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agologger: clean up strings usage
Karel Zak [Tue, 29 Jul 2014 09:43:01 +0000 (11:43 +0200)] 
logger: clean up strings usage

 - use allocated buffers to compose the final messages

 - initialize static buffers to zero

 - remove strlen-after-sprintf

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoMerge branch 'logger' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Tue, 29 Jul 2014 08:22:21 +0000 (10:22 +0200)] 
Merge branch 'logger' of git://github.com/kerolasa/lelux-utiliteetit

* 'logger' of git://github.com/kerolasa/lelux-utiliteetit:
  wall: wrap message header when it exceeds 79 characters
  logger: add hostname to rfc3164 message
  logger: warn when --file and command line message are combined
  logger: improve readablity of pencode() function
  logger: make --stderr print remote server messages
  logger: add process --id=parent optional argument
  docs: add logger protocol notes to manual page
  logger: add rfc5424 support
  logger: tidy up main() by adding small functions and ctl data
  logger: add function pointer to choose how logging is done
  docs: make logger.1 facilities and levels easier to read
  logger: refactor long if clause
  logger: do not rely only getlogin(3) telling who ran the command
  logger: fix indentation issues
  logger: ensure program writes everything to syslog file descriptor

9 years agohwclock: check for permissions before use clock interface
Karel Zak [Mon, 28 Jul 2014 11:00:54 +0000 (13:00 +0200)] 
hwclock: check for permissions before use clock interface

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agowall: wrap message header when it exceeds 79 characters
Sami Kerola [Sun, 27 Jul 2014 18:52:25 +0000 (19:52 +0100)] 
wall: wrap message header when it exceeds 79 characters

Header truncation started to happen more often after commit
d81c30553f4fb49173d38f69edff4b0b67a18b65 that made the header to be
longer.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: add hostname to rfc3164 message
Sami Kerola [Sun, 27 Jul 2014 17:33:22 +0000 (18:33 +0100)] 
logger: add hostname to rfc3164 message

This makes the obsolete protocol a little bit more compliant with the
internet standard, but few should care now when we have rfc5424 support,
and rfc3164 feels broken.  For example it requires hostname to be not
fully qualified, which is hard to understand, and should make users to
prefer the new protocol.

Reported-by: Frank Thilo <thilo@unix-ag.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705217
CC: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: warn when --file and command line message are combined
Sami Kerola [Sun, 27 Jul 2014 17:01:09 +0000 (18:01 +0100)] 
logger: warn when --file and command line message are combined

When --file is combined with command line arguments the later has
silently been ignored.  This commit makes user to be aware the logger
will not use command line arguments when --file is specified.

Reported-by: "Daniel 'DaB.' Baur" <debian@daniel.baur4.info>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467244
CC: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: improve readablity of pencode() function
Sami Kerola [Sat, 26 Jul 2014 14:19:26 +0000 (15:19 +0100)] 
logger: improve readablity of pencode() function

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: make --stderr print remote server messages
Sami Kerola [Sat, 28 Jun 2014 22:49:06 +0000 (23:49 +0100)] 
logger: make --stderr print remote server messages

Users wish to see the message should include also remote messages, not
only the one sent to locally via libc function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: add process --id=parent optional argument
Sami Kerola [Sat, 28 Jun 2014 15:08:28 +0000 (16:08 +0100)] 
logger: add process --id=parent optional argument

When scripts send several messages they will be easier to group together
when parent process id is printed rather than id of the each logger
process.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agodocs: add logger protocol notes to manual page
Sami Kerola [Sat, 28 Jun 2014 14:37:39 +0000 (15:37 +0100)] 
docs: add logger protocol notes to manual page

Inform about rfc5424 support, how to control what it includes to
submission, and that it is the new default when sending syslog messages
to remote server without specifying protocol.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: add rfc5424 support
Sami Kerola [Thu, 26 Jun 2014 15:13:55 +0000 (16:13 +0100)] 
logger: add rfc5424 support

Add support the more recent syslog protocol and make it default.  The
older BSD syslog protocol can still be used with option --rfc3164.
Protocols are meaningful only when messages are sent to remote syslog
server.

Requested-by: Kodiak Firesmith <ksf@sei.cmu.edu>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: tidy up main() by adding small functions and ctl data
Sami Kerola [Sat, 26 Jul 2014 12:10:25 +0000 (13:10 +0100)] 
logger: tidy up main() by adding small functions and ctl data

Add logger_open(), logger_command_line(), logger_stdin(), and
logger_close() functions, and move all remaining option argument
assignments to control structure.

Proposed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: add function pointer to choose how logging is done
Sami Kerola [Thu, 26 Jun 2014 20:48:25 +0000 (21:48 +0100)] 
logger: add function pointer to choose how logging is done

This change paves way to adding support for both RFC 3164 and RFC 5424
syslog protocols.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agodocs: make logger.1 facilities and levels easier to read
Sami Kerola [Mon, 23 Jun 2014 20:26:02 +0000 (21:26 +0100)] 
docs: make logger.1 facilities and levels easier to read

Most people read vertical list a lot quicker than horizontal.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: refactor long if clause
Sami Kerola [Sun, 22 Jun 2014 22:43:09 +0000 (23:43 +0100)] 
logger: refactor long if clause

When if clause that continues throughout whole function it usually can be
shorten to immediate action, e.g., in this case return on the spot not at
end of the function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: do not rely only getlogin(3) telling who ran the command
Sami Kerola [Sun, 22 Jun 2014 22:29:36 +0000 (23:29 +0100)] 
logger: do not rely only getlogin(3) telling who ran the command

The getlogin(3) is known not to always work, and when that happens it is
reasonable to try determine user of name by looking process owner and
passwd information.

Reference: http://man7.org/linux/man-pages/man3/getlogin.3.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: fix indentation issues
Sami Kerola [Sun, 22 Jun 2014 22:02:43 +0000 (23:02 +0100)] 
logger: fix indentation issues

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agologger: ensure program writes everything to syslog file descriptor
Sami Kerola [Sun, 22 Jun 2014 21:59:57 +0000 (22:59 +0100)] 
logger: ensure program writes everything to syslog file descriptor

It is fair assumption messages an user is asking to be wrote will be
attempted to be wrote as hard as possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agoagetty: Reprompt and reprint /etc/issue when asked
Stef Walter [Thu, 3 Jul 2014 15:44:41 +0000 (17:44 +0200)] 
agetty: Reprompt and reprint /etc/issue when asked

Add an 'agetty --reload' command which asks all running agetty
commands to display their prompts again.

Several of the /etc/issue escape codes such as \4 and \S depend on
variable data which can change after the agetty prompt is displayed.
This can cause stale data to be displayed when a user looks at a VT,
especially in cases of DHCP racing with system start up.

We never want this to occur once the user has started typing a
user name. So we detect when the user starts typing, after which
no further reprompting occurs after that point.

[kzak@redhat.com: - add #ifdefs to make it usable on non-inotify systems,
                  - use futimens() with NULL timespec
                  - add --reaload to usage()]

Signed-off-by: Stef Walter <stefw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoswaplabel: move swapon-common to include directory
Sami Kerola [Sat, 26 Jul 2014 10:53:06 +0000 (11:53 +0100)] 
swaplabel: move swapon-common to include directory

This fixes the following compiler warning.

disk-utils/swaplabel.c:175:2: warning: implicit declaration of function
'get_swap_prober' [-Wimplicit-function-declaration]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: add -Wimplicit-function-declaration to compiler warnings
Karel Zak [Mon, 28 Jul 2014 10:26:17 +0000 (12:26 +0200)] 
build-sys: add -Wimplicit-function-declaration to compiler warnings

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