Unverified Commit f6eea250 by Wolfgang Bumiller Committed by Christian Brauner

apparmor: use fopen_cloexec

parent 28968d7d
......@@ -32,6 +32,7 @@
#include "lsm.h"
#include "conf.h"
#include "utils.h"
#include "initutils.h"
lxc_log_define(apparmor, lsm);
......@@ -68,7 +69,7 @@ static int apparmor_enabled(void)
char e;
int ret;
fin = fopen(AA_ENABLED_FILE, "r");
fin = fopen_cloexec(AA_ENABLED_FILE, "r");
if (!fin)
return 0;
ret = fscanf(fin, "%c", &e);
......@@ -95,7 +96,7 @@ static char *apparmor_process_label_get(pid_t pid)
return NULL;
}
again:
f = fopen(path, "r");
f = fopen_cloexec(path, "r");
if (!f) {
SYSERROR("opening %s", path);
free(buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment