Revert "core/execute: set HOME, USER also for root users"
This reverts commit 8b89628a10
.
This broke #5246
This commit is contained in:
parent
6f844e3a3f
commit
23deef88b9
|
@ -1705,7 +1705,9 @@
|
||||||
<term><varname>$SHELL</varname></term>
|
<term><varname>$SHELL</varname></term>
|
||||||
|
|
||||||
<listitem><para>User name (twice), home directory, and the
|
<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>.
|
<citerefentry project='die-net'><refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
|
@ -815,10 +815,13 @@ static int get_fixed_user(const ExecContext *c, const char **user,
|
||||||
|
|
||||||
assert(c);
|
assert(c);
|
||||||
|
|
||||||
|
if (!c->user)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Note that we don't set $HOME or $SHELL if they are not particularly enlightening anyway
|
/* Note that we don't set $HOME or $SHELL if they are not particularly enlightening anyway
|
||||||
* (i.e. are "/" or "/bin/nologin"). */
|
* (i.e. are "/" or "/bin/nologin"). */
|
||||||
|
|
||||||
name = c->user ?: "root";
|
name = c->user;
|
||||||
r = get_user_creds_clean(&name, uid, gid, home, shell);
|
r = get_user_creds_clean(&name, uid, gid, home, shell);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in a new issue