I observe that upon loading of framebuffer drivers, I do not get the
desired system font, but the kernel-level defaults (usually
lib/fonts/font_8x16.c, but your mileage may vary depending on kernel
config and boot options).
The fbcon driver may be loaded at a time way before the first
framebuffer device is active, such that the vconsole setup helper
runs too early.
The existing rule is non-fitting. The going live of the fbcon kernel
component does not indicate the proper time at which to load the
visuals, which really ought to be done when a new vtcon object comes
into existence. (The font table is a per-vtcon property.)
(cherry picked from commit a52750d148)
(cherry picked from commit b83da13fff)
The comparison function we use for qsorting paths is overly indifferent.
Consider these 3 paths for sorting:
/foo
/bar
/foo/foo
qsort() may compare:
"/foo" with "/bar" => 0, indifference
"/bar" with "/foo/foo" => 0, indifference
and assume transitively that "/foo" and "/foo/foo" are also indifferent.
But this is wrong, we want "/foo" sorted before "/foo/foo".
The comparison function must be transitive.
Use path_compare(), which behaves properly.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1184016
(cherry picked from commit a0827e2b12)
(cherry picked from commit 85a6fabdd3)
timedated would set the internal status before calling out to systemd to do
the actual change. When the operation was refused because of a SELinux denial,
the state kept in timedated would get out of sync, and the second call from
timedatectl would appear to succeed.
https://bugzilla.redhat.com/show_bug.cgi?id=1014315
(cherry picked from commit 192b98b8fe)
(cherry picked from commit fb14f86a71)
[Amended to reverse the condition.]
If you've got SELinux policy loaded, label_hnd is your labeling handle.
When systemd is shutting down, we free that handle via mac_selinux_finish().
But: switch_root() calls mkdir_p_label(), which tries to look up a label
using that freed handle, and so we get a bunch of garbage and eventually
SEGV in libselinux.
(This doesn't happen in the switch-root from initramfs to real root because
there's no SELinux policy loaded in initramfs, so label_hnd is NULL and we
never attempt any lookups.)
So: make sure that mac_selinux_finish() actually sets label_hnd to NULL, so
nobody tries to use it after it becomes invalid.
https://bugzilla.redhat.com/show_bug.cgi?id=1185604
(cherry picked from commit f5ce2b4958)
(cherry picked from commit 19e98bf405)
The error-code propagated via sysview is always negative. Avoid
multiplying by -1 before returning it. Otherwise, we will return >0
instead of <0, which will not be detected as error by sysview-core.
(cherry picked from commit 84c3561c58)
(cherry picked from commit c04228cbd9)
The udev-settle guarantees that udevd is no longer processing any of the
events casued by udev-trigger. The way this works is that it sends a
synchronous PING to udevd after udev-trigger has ran, and when that returns
it knows that udevd has started processing the events from udev-trigger.
udev-settle will then wait for the event queue to empty before returning.
However, there was a race here, as we would only update the /run state at
the beginning of the event loop, before reading out new events and before
processing the ping.
That means that if the first uevent arrived in the same event-loop iteration
as the PING, we would return the ping before updating the queue state in /run
(which would happen on the next iteration).
The race window here is tiny (as the /run state would probably get updated
before udev-settle got a chance to read /run), but still a possibility.
Fix the problem by updating the /run state as the last step before returning
the PING.
We must still update it at the beginning of the loop as well, otherwise we
risk being stuck in poll() with a stale state in /run.
Reported-by: Daniel Drake <drake@endlessm.com>
(cherry picked from commit db93e063bd)
(cherry picked from commit 0c9591e78e)
Lack of this caused journalctl not to display a hint about missing groups
properly when the user lacks permissions.
(cherry picked from commit 7b300be75e)
(cherry picked from commit 67c29191b0)
I observe that upon loading of framebuffer drivers, I do not get the
desired system font, but the kernel-level defaults (usually
lib/fonts/font_8x16.c, but your mileage may vary depending on kernel
config and boot options).
The fbcon driver may be loaded at a time way before the first
framebuffer device is active, such that the vconsole setup helper
runs too early.
The existing rule is non-fitting. The going live of the fbcon kernel
component does not indicate the proper time at which to load the
visuals, which really ought to be done when a new vtcon object comes
into existence. (The font table is a per-vtcon property.)
(cherry picked from commit a52750d148)
(cherry picked from commit b83da13fff)
Conflicts:
src/vconsole/90-vconsole.rules
On large system we hit the limit on 512 simultaneous dbus
connections, resulting in tons of annoying messages:
Too many concurrent connections, refusing
This patch raises the limit to 4096.
(cherry picked from commit cbecf9bf92)
(cherry picked from commit 7eaa810935)
Currently the code will silently blank out events if there are more
then 512 epoll events, causing them never to be handled at all. This
patch removes the cap on the number of events for epoll_wait, thereby
avoiding this issue.
(cherry picked from commit 1c724e9e0e)
(cherry picked from commit c2695a243c)
Make sure we don't inspect sun_path of unnamed sockets.
Since we cannot know if two unnamed sockets' adresses refer to the same
socket, just return false.
(cherry picked from commit 710708a54c)
(cherry picked from commit 04691e6f81)
When dbus.socket is updated like this:
-ListenStream=/var/run/dbus/system_bus_socket
+ListenStream=/run/dbus/system_bus_socket
... and daemon-reload is performed, bad things happen.
During deserialization systemd does not recognize that the two paths
refer to the same named socket and replaces the socket file with a new
one. As a result, applications hang when they try talking to dbus.
Fix this by finding a match not only when the path names are equal, but
also when they point to the same inode.
In socket_address_equal() it is necessary to move the address size
comparison into the abstract sockets branch. For path name sockets the
comparison must not be done and for other families it is redundant
(their sizes are constant and checked by socket_address_verify()).
FIFOs and special files can also have multiple pathnames, so compare the
inodes for them as well. Note that previously the pathname checks used
streq_ptr(), but the paths cannot be NULL.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1186018
(cherry picked from commit c78e47a61f)
(cherry picked from commit 25e6978bb3)
On s390 (at least) /sys/class/power_supply is not present. We should
treat this like if this directory was empty, and not an error.
(cherry picked from commit 6d89003462)
(cherry picked from commit 0436d5c5f4)
Printing it at info level was tedious. We don't do that for any other
overrides.
(cherry picked from commit 7933e4266f)
(cherry picked from commit 2439dc6083)
When running in user mode unmounting of mount units when a device
vanishes is unlikely to work, and even if it would work is already done
by PID 1 anyway. HEnce, when creating implicit dependencies between
mount units and their backing devices, created a Wants= type dependency
in --user mode, but leave a BindsTo= dependency in --system mode.
(cherry picked from commit 5bd4b17360)
(cherry picked from commit fc9805756d)
The output of gnutls_certificate_verification_status_print() needs to be
freed.
Noticed this while staring at verify_cert_authorized() to see what could
possibly confuse gcc5 on armv7hl to segfault during compilation.
(cherry picked from commit 9c3cf9693a)
(cherry picked from commit 7057db8b36)
Otherwise systemd-reboot.service will remove the parameter that was set
before. This was broken in commit "b986229efe2cc96157aa14c37bab7843311bbef1
systemctl: bugfix for systemctl reboot command with argument"
(cherry picked from commit c31c4324c5)
The log message talks specifically about services, though it actually
applies to any kind of unit.
(cherry picked from commit 418761f586)
Conflicts:
src/core/unit.c
not while applying the parsed sysctl values. Otherwise
info "Overwriting earlier assignment of %s in file %s" is
visible many times even though the given --prefix doesn't
try to set the overridden value.
This also optimizes the startup tiny bit since we have udev
rules running on network devices and setting sysctl through
the rules.
(cherry picked from commit b99802f769)
- correctly check for local vs. remote transport
- return after receiving error from expand_names()
(cherry picked from commit 3e7eed8497)
Conflicts:
src/systemctl/systemctl.c
Simplify the check from commit 05f73ad to only apply the warning to regular
files instead of enumerating device nodes.
(cherry picked from commit 3f4d56a069)
If setup of per-user runtime dir fails, clean up afterwards by removing
the directory before returning from the function, so we don't leave the
directory behind.
If this is not done, the second time the user logs in logind would
assume that the directory is already set up, even though it isn't.
(cherry picked from commit 4d858e7d9f)
Conflicts:
src/login/logind-user.c
The offline update mechanism is explicitly designed to work with a
separate /var. systemd-update-generator is supposed to run early,
before filesystems are mounted, so it cannot check if the
/system-update symlink actually points to anything.
The update is run *after* filesystems are mounted, so it should be
able to access the target of the symlink without trouble.
https://bugzilla.redhat.com/show_bug.cgi?id=1178978
(cherry picked from commit 6b321a7901)
According to systemctl man page, 'systemctl reboot [arg]' should work
without any errors. However, it does not work because of 'Invalid number
of arguments' error, except for 'reboot [arg]'. This patch fixes the bug
so that both of commands work in exactly the same way.
(cherry picked from commit b986229efe)
We really need to use va_arg() with the right type here as uint64_t and
double might have the same size, but are passed differently as
arguments.
(cherry picked from commit 6cd37a5e59)