aboutsummaryrefslogtreecommitdiff
path: root/selinux
diff options
context:
space:
mode:
Diffstat (limited to 'selinux')
-rw-r--r--selinux/setfiles.c6
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)
if ((applet_name[0] == 's') && (flags & OPT_c)) {
FILE *policystream;
- policystream = xfopen(policyfile, "r");
+ policystream = xfopen_for_read(policyfile);
if (sepol_set_policydb_from_file(policystream) < 0) {
bb_error_msg_and_die("sepol_set_policydb_from_file on %s", policyfile);
}
@@ -575,7 +575,7 @@ int setfiles_main(int argc, char **argv)
if (flags & OPT_o) {
outfile = stdout;
if (NOT_LONE_CHAR(out_filename, '-')) {
- outfile = xfopen(out_filename, "w");
+ outfile = xfopen_for_write(out_filename);
}
}
if (applet_name[0] == 'r') { /* restorecon */
@@ -620,7 +620,7 @@ int setfiles_main(int argc, char **argv)
FILE *f = stdin;
if (NOT_LONE_CHAR(input_filename, '-'))
- f = xfopen(input_filename, "r");
+ f = xfopen_for_read(input_filename);
while ((len = getline(&buf, &buf_len, f)) > 0) {
buf[len - 1] = '\0';
errors |= process_one(buf);