#include "util.h"
static int delete_rule(const char *rule) {
- char *x, *fn, *e;
+ char *x, *fn = NULL, *e;
int r;
assert(rule[0]);
log_parse_environment();
log_open();
+ umask(0022);
+
if (argc > 1) {
r = apply_file(argv[1], false);
} else {
/* Flush out all rules */
write_one_line_file("/proc/sys/fs/binfmt_misc/status", "-1");
- files = conf_files_list(".conf",
- "/run/binfmt.d",
- "/etc/binfmt.d",
- "/usr/lib/binfmt.d",
- NULL);
+ r = conf_files_list(&files, ".conf",
+ "/run/binfmt.d",
+ "/etc/binfmt.d",
+ "/usr/local/lib/binfmt.d",
+ "/usr/lib/binfmt.d",
+ NULL);
+
+ if (r < 0) {
+ log_error("Failed to enumerate binfmt.d files: %s", strerror(-r));
+ goto finish;
+ }
STRV_FOREACH(f, files) {
int k;
strv_free(files);
}
+finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}