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
+4
View File
@@ -457,6 +457,8 @@ struct Manager {
/* Reference to RestrictFileSystems= BPF program */
struct restrict_fs_bpf *restrict_fs;
char *default_smack_process_label;
};
static inline usec_t manager_default_timeout_abort_usec(Manager *m) {
@@ -509,6 +511,8 @@ int manager_transient_environment_add(Manager *m, char **plus);
int manager_client_environment_modify(Manager *m, char **minus, char **plus);
int manager_get_effective_environment(Manager *m, char ***ret);
int manager_set_default_smack_process_label(Manager *m, const char *label);
int manager_set_default_rlimits(Manager *m, struct rlimit **default_rlimit);
void manager_trigger_run_queue(Manager *m);