chiark / gitweb /
udev: do not allow to change the DEVPATH of a device
[elogind.git] / src / udev / udevd.c
index c4127cd03b45017309229b554b0d575e4b21ee8a..1c2d00f03b2e3af25c6dc4d12e90dc8759839d68 100644 (file)
@@ -779,10 +779,11 @@ static void handle_signal(struct udev *udev, int signo)
 
                                 if (WIFEXITED(status)) {
                                         if (WEXITSTATUS(status) != 0)
-                                                log_error("worker [%u] exit with return code %i\n", pid, WEXITSTATUS(status));
+                                                log_error("worker [%u] exit with return code %i\n",
+                                                          pid, WEXITSTATUS(status));
                                 } else if (WIFSIGNALED(status)) {
                                         log_error("worker [%u] terminated by signal %i (%s)\n",
-                                            pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
+                                                  pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
                                 } else if (WIFSTOPPED(status)) {
                                         log_error("worker [%u] stopped\n", pid);
                                 } else if (WIFCONTINUED(status)) {
@@ -923,7 +924,10 @@ int main(int argc, char *argv[])
         log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
+
         udev_set_log_fn(udev, udev_main_log);
+        log_set_max_level(udev_get_log_priority(udev));
+
         log_debug("version %s\n", VERSION);
         label_init("/dev");
 
@@ -1197,7 +1201,9 @@ int main(int argc, char *argv[])
         }
         log_debug("set children_max to %u\n", children_max);
 
-        udev_rules_apply_static_dev_perms(rules);
+        rc = udev_rules_apply_static_dev_perms(rules);
+        if (rc < 0)
+                log_error("failed to apply permissions on static device nodes - %s\n", strerror(-rc));
 
         udev_list_node_init(&event_list);
         udev_list_node_init(&worker_list);