mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
various: try to use DEFAULT_USER_SHELL for root too
/bin/sh as a shell is punishing. There is no good reason to make
the occasional root login unpleasant.
Since /bin/sh is usually /bin/bash in compat mode, i.e. if one is
available, the other will be too, /bin/bash is almost as good as a default.
But to avoid a regression in the situation where /bin/bash (or
DEFAULT_USER_SHELL) is not installed, we check with access() and fall back
to /bin/sh. This should make this change in behaviour less risky.
(FWIW, e.g. Fedora/RHEL use /bin/bash as default for root.)
This is a follow-up of sorts for 53350c7bba,
which added the default-user-shell option, but most likely with the idea
of using /bin/bash less ;)
Fixes #24369.
This commit is contained in:
@@ -26,7 +26,7 @@ ExecStart=sh -c 'test %U = $$(id -u)'
|
||||
ExecStart=sh -c 'test %g = $$(id -gn)'
|
||||
ExecStart=sh -c 'test %G = $$(id -g)'
|
||||
ExecStart=test %h = /root
|
||||
ExecStart=sh -c 'test %s = /bin/sh'
|
||||
ExecStart=sh -c 'test -x %s'
|
||||
ExecStart=sh -c 'test %m = $$(cat /etc/machine-id)'
|
||||
ExecStart=sh -c 'test %b = $$(cat /proc/sys/kernel/random/boot_id | sed -e 's/-//g')'
|
||||
ExecStart=sh -c 'test %H = $$(uname -n)'
|
||||
|
||||
@@ -23,7 +23,7 @@ ExecStart=sh -c 'test %U = $$(id -u)'
|
||||
ExecStart=sh -c 'test %g = $$(id -gn)'
|
||||
ExecStart=sh -c 'test %G = $$(id -g)'
|
||||
ExecStart=test %h = /root
|
||||
ExecStart=sh -c 'test %s = /bin/sh'
|
||||
ExecStart=sh -c 'test -x %s'
|
||||
ExecStart=sh -c 'test %m = $$(cat /etc/machine-id)'
|
||||
ExecStart=sh -c 'test %b = $$(cat /proc/sys/kernel/random/boot_id | sed -e 's/-//g')'
|
||||
ExecStart=sh -c 'test %H = $$(uname -n)'
|
||||
|
||||
Reference in New Issue
Block a user