diff options
Diffstat (limited to 'selinux')
-rw-r--r-- | selinux/setfiles.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/selinux/setfiles.c b/selinux/setfiles.c index d567f83aa..8eb04e635 100644 --- a/selinux/setfiles.c +++ b/selinux/setfiles.c | |||
@@ -554,7 +554,7 @@ int setfiles_main(int argc, char **argv) | |||
554 | if ((applet_name[0] == 's') && (flags & OPT_c)) { | 554 | if ((applet_name[0] == 's') && (flags & OPT_c)) { |
555 | FILE *policystream; | 555 | FILE *policystream; |
556 | 556 | ||
557 | policystream = xfopen(policyfile, "r"); | 557 | policystream = xfopen_for_read(policyfile); |
558 | if (sepol_set_policydb_from_file(policystream) < 0) { | 558 | if (sepol_set_policydb_from_file(policystream) < 0) { |
559 | bb_error_msg_and_die("sepol_set_policydb_from_file on %s", policyfile); | 559 | bb_error_msg_and_die("sepol_set_policydb_from_file on %s", policyfile); |
560 | } | 560 | } |
@@ -575,7 +575,7 @@ int setfiles_main(int argc, char **argv) | |||
575 | if (flags & OPT_o) { | 575 | if (flags & OPT_o) { |
576 | outfile = stdout; | 576 | outfile = stdout; |
577 | if (NOT_LONE_CHAR(out_filename, '-')) { | 577 | if (NOT_LONE_CHAR(out_filename, '-')) { |
578 | outfile = xfopen(out_filename, "w"); | 578 | outfile = xfopen_for_write(out_filename); |
579 | } | 579 | } |
580 | } | 580 | } |
581 | if (applet_name[0] == 'r') { /* restorecon */ | 581 | if (applet_name[0] == 'r') { /* restorecon */ |
@@ -620,7 +620,7 @@ int setfiles_main(int argc, char **argv) | |||
620 | FILE *f = stdin; | 620 | FILE *f = stdin; |
621 | 621 | ||
622 | if (NOT_LONE_CHAR(input_filename, '-')) | 622 | if (NOT_LONE_CHAR(input_filename, '-')) |
623 | f = xfopen(input_filename, "r"); | 623 | f = xfopen_for_read(input_filename); |
624 | while ((len = getline(&buf, &buf_len, f)) > 0) { | 624 | while ((len = getline(&buf, &buf_len, f)) > 0) { |
625 | buf[len - 1] = '\0'; | 625 | buf[len - 1] = '\0'; |
626 | errors |= process_one(buf); | 626 | errors |= process_one(buf); |