chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
getty: simplify things a bit
[elogind.git]
/
src
/
binfmt.c
diff --git
a/src/binfmt.c
b/src/binfmt.c
index 619f6e4aa781b37c1e36d4c6c4489dc68b2865f9..552d8cc227ec5131c1071573560197782e1b6181 100644
(file)
--- a/
src/binfmt.c
+++ b/
src/binfmt.c
@@
-127,6
+127,8
@@
int main(int argc, char *argv[]) {
log_parse_environment();
log_open();
log_parse_environment();
log_open();
+ umask(0022);
+
if (argc > 1) {
r = apply_file(argv[1], false);
} else {
if (argc > 1) {
r = apply_file(argv[1], false);
} else {
@@
-135,11
+137,17
@@
int main(int argc, char *argv[]) {
/* Flush out all rules */
write_one_line_file("/proc/sys/fs/binfmt_misc/status", "-1");
/* 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_FOREACH(f, files) {
int k;
@@
-151,5
+159,6
@@
int main(int argc, char *argv[]) {
strv_free(files);
}
strv_free(files);
}
+finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}