udevadm: explicitly relabel /etc/udev/hwdb.bin after rename (#3686)

This is basically the same change as ea68351.
This commit is contained in:
Michal Sekletar 2016-07-08 17:43:05 +02:00 committed by Lennart Poettering
parent 224d3d8266
commit 905c37e60e

View file

@ -28,6 +28,8 @@
#include "fs-util.h"
#include "hwdb-internal.h"
#include "hwdb-util.h"
#include "label.h"
#include "mkdir.h"
#include "strbuf.h"
#include "string-util.h"
#include "udev.h"
@ -656,12 +658,16 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
rc = EXIT_FAILURE;
goto out;
}
mkdir_parents(hwdb_bin, 0755);
mkdir_parents_label(hwdb_bin, 0755);
err = trie_store(trie, hwdb_bin);
if (err < 0) {
log_error_errno(err, "Failure writing database %s: %m", hwdb_bin);
rc = EXIT_FAILURE;
}
label_fix(hwdb_bin, false, false);
}
if (test) {