diff options
author | 2019-05-13 17:18:10 +0000 | |
---|---|---|
committer | 2019-05-13 17:18:10 +0000 | |
commit | fde371e9c20fe5bafd35baf39be166d18704cbd7 (patch) | |
tree | 473f09c001ff9ec43432755c70cff71992eef1e6 /lib/libc | |
parent | Delete tentacles of LC_NUMERIC support. (diff) | |
download | wireguard-openbsd-fde371e9c20fe5bafd35baf39be166d18704cbd7.tar.xz wireguard-openbsd-fde371e9c20fe5bafd35baf39be166d18704cbd7.zip |
The fd used by nlist() isn't application visible, so mark it close-on-exec
to avoid leaking it
ok deraadt@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/nlist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 78db9926728..9a65ea3a66a 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nlist.c,v 1.69 2017/10/27 16:47:08 mpi Exp $ */ +/* $OpenBSD: nlist.c,v 1.70 2019/05/13 17:18:10 guenther Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -292,7 +292,7 @@ nlist(const char *name, struct nlist *list) { int fd, n; - fd = open(name, O_RDONLY, 0); + fd = open(name, O_RDONLY | O_CLOEXEC); if (fd < 0) return (-1); n = __fdnlist(fd, list); |