libselinux: label_db::db_init(): open file with CLOEXEC mode
Open the file stream with the `e` flag, so that the underlying file descriptor gets closed on an exec in a potential sibling thread. Also drop the flag `b`, since it is ignored on POSIX systems. Found by clang-tidy. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
parent
65f1ccbecc
commit
e1999379df
1 changed files with 1 additions and 1 deletions
|
@ -277,7 +277,7 @@ db_init(const struct selinux_opt *opts, unsigned nopts,
|
|||
if (!path)
|
||||
path = selinux_sepgsql_context_path();
|
||||
|
||||
if ((filp = fopen(path, "rb")) == NULL) {
|
||||
if ((filp = fopen(path, "re")) == NULL) {
|
||||
free(catalog);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue