Skip to content

Commit

Permalink
udevadm: explicitly relabel /etc/udev/hwdb.bin after rename
Browse files Browse the repository at this point in the history
This is basically the same change as ea68351.

Cherry-picked from: 4f43161e909cb420aafbc4bebce4361b17b80fdd
Related: #1350756
  • Loading branch information
msekletar committed Jul 8, 2016
1 parent ca82178 commit 0860805
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/udev/udevadm-hwdb.c
Expand Up @@ -26,6 +26,8 @@
#include "util.h"
#include "strbuf.h"
#include "conf-files.h"
#include "label.h"
#include "mkdir.h"

#include "udev.h"
#include "hwdb-internal.h"
Expand Down Expand Up @@ -654,12 +656,13 @@ 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) {
Expand Down
2 changes: 1 addition & 1 deletion src/udev/udevadm.c
Expand Up @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) {

log_parse_environment();
log_open();
mac_selinux_init("/dev");
mac_selinux_init(NULL);

while ((c = getopt_long(argc, argv, "+dhV", options, NULL)) >= 0)
switch (c) {
Expand Down

0 comments on commit 0860805

Please sign in to comment.