mirror of
https://github.com/systemd/systemd.git
synced 2025-03-25 18:50:18 +03:00
Revert "core/execute: set HOME, USER also for root users"
This reverts commit 8b89628a10af3863bfc97872912e9da4076a5929. This broke #5246
This commit is contained in:
parent
6f844e3a3f
commit
23deef88b9
@ -1705,7 +1705,9 @@
|
||||
<term><varname>$SHELL</varname></term>
|
||||
|
||||
<listitem><para>User name (twice), home directory, and the
|
||||
login shell. See
|
||||
login shell. The variables are set for the units that have
|
||||
<varname>User=</varname> set, which includes user
|
||||
<command>systemd</command> instances. See
|
||||
<citerefentry project='die-net'><refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
@ -815,10 +815,13 @@ static int get_fixed_user(const ExecContext *c, const char **user,
|
||||
|
||||
assert(c);
|
||||
|
||||
if (!c->user)
|
||||
return 0;
|
||||
|
||||
/* Note that we don't set $HOME or $SHELL if they are not particularly enlightening anyway
|
||||
* (i.e. are "/" or "/bin/nologin"). */
|
||||
|
||||
name = c->user ?: "root";
|
||||
name = c->user;
|
||||
r = get_user_creds_clean(&name, uid, gid, home, shell);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
Loading…
x
Reference in New Issue
Block a user