log_parse_environment();
log_open();
+ umask(0022);
+
if (!(arguments = strv_new("/sbin/modprobe", "-sab", "--", NULL))) {
log_error("Failed to allocate string array");
goto finish;
n_arguments = n_allocated = 3;
- files = conf_files_list(".conf",
- "/run/modules-load.d",
- "/etc/modules-load.d",
- "/usr/lib/modules-load.d",
- NULL);
- if (files == NULL) {
- log_error("Failed to enumerate modules-load.d files: %m");
+ 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;
}
continue;
log_error("Failed to open %s: %m", *fn);
- free(fn);
r = EXIT_FAILURE;
continue;
}
if (n_arguments > 3) {
arguments[n_arguments] = NULL;
+ strv_uniq(arguments);
execv("/sbin/modprobe", arguments);
log_error("Failed to execute /sbin/modprobe: %m");