Joshua Hudson [Wed, 24 Jun 2015 08:15:08 +0000 (09:15 +0100)]
mkfs.minix: increase maximum minix v2 and v3 file system sizes
mkfs.minix misbehaves when attempting to create a large v2 or v3
filesystem. I finally traced it down to attempting to create too many
inodes so that the first zone is past 65535 blocks in. This obviously
doesn't work as the on-disk superblock says this is a 16 bit integer.
I wrote a patch that catches this, clamps to the absolute v2/v3 limit
(like it already does for v1), and sets the blocks per inode to a more
reasonable ratio when exceeding half a gigabyte. Having a half-gig
filesystem with most files being smaller than 3k isn't really reasonable.
I suppose if you don't want to adjust inode sizes automatically you could
take that part out, and it will just crab sooner.
Given the non-attention in the code, I suspect nobody ever had cause to
try such a big minix filesystem. Well I have my reasons involving some
deeply embedded work where ext2 would place too much strain on the
hardware.
Reviewed-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Joshua Hudson <joshudson@gmail.com>
Karel Zak [Thu, 30 Jul 2015 07:28:19 +0000 (09:28 +0200)]
libmount: make mnt_get_filesystems() more robust [clang analyze]
The mnt_free_filesystems() relies on NULL as the last item in the
filesystems array. It's necessary to keep NULL there after failed
strdup() too, because we call mnt_free_filesystems() to deallocate
after error.
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.