chiark / gitweb /
stdout: remove stdout-syslog-bridge since it is now obsoleted by journald
[elogind.git] / src / modules-load.c
index 7efd81f75b925e798f2a2df410ffb9ed6ddc4b92..8dd98f73d82482a30bd9945d8cab97ebf43e61d4 100644 (file)
@@ -46,6 +46,8 @@ int main(int argc, char *argv[]) {
         log_parse_environment();
         log_open();
 
+        umask(0022);
+
         if (!(arguments = strv_new("/sbin/modprobe", "-sab", "--", NULL))) {
                 log_error("Failed to allocate string array");
                 goto finish;
@@ -56,7 +58,9 @@ int main(int argc, char *argv[]) {
         if (conf_files_list(&files, ".conf",
                             "/run/modules-load.d",
                             "/etc/modules-load.d",
+                            "/usr/local/lib/modules-load.d",
                             "/usr/lib/modules-load.d",
+                            "/lib/modules-load.d",
                             NULL) < 0) {
                 log_error("Failed to enumerate modules-load.d files: %s", strerror(-r));
                 goto finish;
@@ -73,7 +77,6 @@ int main(int argc, char *argv[]) {
                                 continue;
 
                         log_error("Failed to open %s: %m", *fn);
-                        free(fn);
                         r = EXIT_FAILURE;
                         continue;
                 }
@@ -127,6 +130,7 @@ finish:
 
         if (n_arguments > 3) {
                 arguments[n_arguments] = NULL;
+                strv_uniq(arguments);
                 execv("/sbin/modprobe", arguments);
 
                 log_error("Failed to execute /sbin/modprobe: %m");