Alex Bligh [Wed, 15 Jul 2015 18:01:48 +0000 (19:01 +0100)]
logger: Add support to logger for RFC6587 octet counting
This patch adds support to logger for RFC6587 octet counting.
RFC6587 provides support for two sorts of framing:
1. Octet counting (at RFC6587 s3.4.1)
In essence each frame is preceded by a decimal length and a
space.
2. Non-transparent framing (at RFC6587 s3.4.2), also called
'octet stuffing'
In essence each frame is terminated by a `\n`
Prior to this patch, logger used option 2 (non-transparent framing)
on TCP, and used no framing on UDP. After this patch, the default
behaviour is unchanged, but if the '--octet-count' option is supplied,
option 1 is used for both TCP and UDP. Arguably octet count framing
makes little sense on UDP, but some servers provide it and this
allows testing of those servers.
Stef Walter [Fri, 3 Jul 2015 12:48:44 +0000 (14:48 +0200)]
agetty: Reprompt once the network addresses change if address displayed
Several of the /etc/issue escape codes such as \4 and \6 depend on
the current addresses of the system that 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.
Similar to the --reload mechanism, if we're displaying an address
in the issue output, and the user hasn't typed anything yet: then
redisplay the prompt with the new address.
We use netlink to watch for address changes. We only open the netlink
socket if we display an address in the issue file.
Sami Kerola [Sun, 19 Jul 2015 20:19:12 +0000 (21:19 +0100)]
logger: do not exit when socket errors are not enforced
The libc openlog(3) does not have error detection whether unix socket
could be opened. As a side effect that made it possible to use logger
even if syslogd was not running. Of course user message in these cases
were lost. This change makes the logger do behave similar way again, so
that sysvinit scripts can successfully pipe messages to logger when ever.
Addresses: https://bugs.debian.org/787864
Addresses: https://bugs.debian.org/790875 Reported-by: Andreas Beckmann <anbe@debian.org> Reported-by: Andreas Henriksson <andreas@fatal.se> Tested-by: Robie Basak <robie.basak@ubuntu.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
ldattach: always set line speed and format for N_GIGASET_M101
The Gigaset M101 exhibits particularly awkward and confusing behaviour
when the serial line speed isn't set to what the device expects:
Configuration mode detects the used speed and works anyway, but data
mode silently fails. Troubleshooting this is enormously time-consuming.
Spare the users this trouble by setting the line speed and format to
these devices' factory default values as long as the command line
doesn't say otherwise.
Sami Kerola [Sat, 6 Jun 2015 21:41:51 +0000 (22:41 +0100)]
rtcwake: fix valgrind warning
==3445== Syscall param ioctl(generic) points to uninitialised byte(s)
==3445== at 0x4F16477: ioctl (in /usr/lib/libc-2.21.so)
==3445== by 0x402785: setup_alarm (rtcwake.c:231)
==3445== by 0x403302: main (rtcwake.c:520)
Sami Kerola [Sun, 11 Jan 2015 09:37:59 +0000 (09:37 +0000)]
rtcwake: read accepted mode strings from /sys/power/state
The rtcwake has various mode names that are internal to the command,
listed in rtcwake_mode_string array, while some modes are dynamicaly
listed in /sys/power/state. Together these form the allowed modes.
[kzak@redhat.com: - cleanup strv usage]
Reviewed-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Sami Kerola [Sat, 10 Jan 2015 20:07:08 +0000 (20:07 +0000)]
rtcwake: add --list-modes
Commit ece44f19f423408f576f348fed2845c876d72c6e missed freeze mode, which
to a simple patch adding the missing argument but Karel pointed out it
would be better to make the rtcwake to tell what arguments are supported
so that possible changes end up to be automatically correct in bash
completion.
Proposed-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 10 Jan 2015 17:07:09 +0000 (17:07 +0000)]
rtcwake: remove RTC_ALM_READ and RTC_ALM_SET compatibility
The RTC_WKALM_RD and RTC_WKALM_SET have been available since 2.6.17, and
preferred way since 2007. Keeping the fallbacks to the old interface is
no longer needed.
Sami Kerola [Fri, 12 Jun 2015 20:25:08 +0000 (21:25 +0100)]
reset: deprecate the script, and remove reset.033c
Most distributions probably ship reset from ncurses, which means
util-linux reset(1) is unlikely to be in use anywhere. Assuming the
previous being true it is almost unimaginable anyone one would be using
the alternative script, so remove it and mark the script deprecated.
Sami Kerola [Tue, 2 Jun 2015 09:18:25 +0000 (10:18 +0100)]
last-deprecated: remove from source tree
The last/lastb(1) from sysvinit has been around for about two years,
and the better implementation is already part of releases 2.24 to 2.26.
It should be safe to remove the unused last code from the source tree.
Karel Zak [Mon, 25 May 2015 13:30:52 +0000 (15:30 +0200)]
sulogin: improve support for locked root account
Some installations and distributions don't use a root account password
for security reasons and use sudo instead. In that case, asking for the
password makes no sense, and it is not even considered as valid as it's just
"*" or "!".
In these cases --force is required to just start a root shell and no
ask for password.
I don't think it's a good idea to automatically start root shell when
locked account is detected. It's possible that the machine is on
public place and for example Ubuntu uses root account disabled by
default (and also Fedora when installed by yum/dnf without anaconda).
The --force option forces admins to think about it...
The distro maintainers can also use --force in their initscripts or
systemd emergency.service if they believe that promiscuous setting is
the right thing for the distro.
Addresses: https://bugs.debian.org/326678 Signed-off-by: Karel Zak <kzak@redhat.com>
Boris Egorov [Fri, 19 Jun 2015 19:41:01 +0000 (01:41 +0600)]
cfdisk: fix condition logic [cppcheck]
[disk-utils/cfdisk.c:1181] -> [disk-utils/cfdisk.c:1181]: (warning)
Possible null pointer dereference: data - otherwise it is redundant to
check it against null.
Boris Egorov [Fri, 19 Jun 2015 19:41:00 +0000 (01:41 +0600)]
libblkid/whereis: simplify some conditions [cppcheck]
[misc-utils/whereis.c:466]: (style) Redundant condition: uflag.
'A && (!A || B)' is equivalent to 'A || B'
[libblkid/src/tag.c:373]: (style) Redundant condition: dev.
'A && (!A || B)' is equivalent to 'A || B'