diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-03-27 07:38:26 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-03-27 07:38:26 +0200 |
commit | 08c849815c8db19ab0ab1ca226354d4a104041f0 (patch) | |
tree | 8e7004dc8d46fd9f5ddbca3d9f855b7c83433653 /src/hwdb/hwdb.c | |
parent | ffb3c2bd705409ca5bbbb9ccef4c59349ea787cf (diff) | |
download | systemd-08c849815c8db19ab0ab1ca226354d4a104041f0.tar.gz systemd-08c849815c8db19ab0ab1ca226354d4a104041f0.tar.bz2 systemd-08c849815c8db19ab0ab1ca226354d4a104041f0.zip |
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/hwdb/hwdb.c')
-rw-r--r-- | src/hwdb/hwdb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c index f579ef737e..a60809ca65 100644 --- a/src/hwdb/hwdb.c +++ b/src/hwdb/hwdb.c @@ -688,7 +688,7 @@ static int hwdb_update(int argc, char *argv[], void *userdata) { if (r < 0) return log_error_errno(r, "Failure writing database %s: %m", hwdb_bin); - return label_fix(hwdb_bin, false, false); + return label_fix(hwdb_bin, 0); } static void help(void) { |