summaryrefslogtreecommitdiff
path: root/src/login/logind-user.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-03-27 07:38:26 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commitd3bc5662dd8436ea2ddcd49d18a48e9a4818bb44 (patch)
treebaccb383396362a65c110d1dacb630b7e659a804 /src/login/logind-user.c
parent33da2d049720dfa17bbbbf70200130fd977bfb33 (diff)
label: rework label_fix() implementations (#8583)
This reworks the SELinux and SMACK label fixing calls in a number of ways: 1. The two separate boolean arguments of these functions are converted into a flags type LabelFixFlags. 2. The operations are now implemented based on O_PATH. This should resolve TTOCTTOU races between determining the label for the file system object and applying it, as it it allows to pin the object while we are operating on it. 3. When changing a label fails we'll query the label previously set, and if matches what we want to set anyway we'll suppress the error. Also, all calls to label_fix() are now (void)ified, when we ignore the return values. Fixes: #8566
Diffstat (limited to 'src/login/logind-user.c')
-rw-r--r--src/login/logind-user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index 155ec6a5a..20b8601c1 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -374,7 +374,7 @@ static int user_mkdir_runtime_path(User *u) {
}
}
- r = label_fix(u->runtime_path, false, false);
+ r = label_fix(u->runtime_path, 0);
if (r < 0)
log_warning_errno(r, "Failed to fix label of '%s', ignoring: %m", u->runtime_path);
}