smack: Add DefaultSmackProcessLabel to user.conf and system.conf

DefaultSmackProcessLabel tells systemd what label to assign to its child
process in case SmackProcessLabel is not set in the service file. By
default, when DefaultSmackProcessLabel is not set child processes inherit
label from systemd.

If DefaultSmackProcessLabel is set to "/" (which is an invalid character
for a SMACK label) the DEFAULT_SMACK_PROCESS_LABEL set during compilation
is ignored and systemd act as if the option was unset.
This commit is contained in:
Łukasz Stelmach
2022-07-12 22:47:32 +01:00
committed by Luca Boccassi
parent 8880c3be82
commit aa5ae9711e
9 changed files with 53 additions and 6 deletions
+12
View File
@@ -525,6 +525,18 @@
details. Note that this setting has no effect on the OOM score adjustment value of the service
manager process itself, it retains the original value set during its invocation.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>DefaultSmackProcessLabel=</varname></term>
<listitem><para>Takes a <option>SMACK64</option> security label as the argument. The process executed
by a unit will be started under this label if <varname>SmackProcessLabel=</varname> is not set in the
unit. See <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for the details.</para>
<para>If the value is <literal>/</literal>, only labels specified with <varname>SmackProcessLabel=</varname>
are assigned and the compile-time default is ignored.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>