summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/getusershell.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-09-15 06:15:48 +0000
committerguenther <guenther@openbsd.org>2014-09-15 06:15:48 +0000
commit241db05998f1091df691c528a16b6ca3ab8719d3 (patch)
tree3f038d1b6f858c1d54403aea4e05196b78947f43 /lib/libc/gen/getusershell.c
parentPass O_CLOEXEC to open() or mkostemp() instead of setting FD_CLOEXEC afterwards (diff)
downloadwireguard-openbsd-241db05998f1091df691c528a16b6ca3ab8719d3.tar.xz
wireguard-openbsd-241db05998f1091df691c528a16b6ca3ab8719d3.zip
When fopen()ing internal to libc (the API doesn't support the use
of the resulting FILE *), then pass fopen() the 'e' mode letter to mark it close-on-exec. ok miod@
Diffstat (limited to 'lib/libc/gen/getusershell.c')
-rw-r--r--lib/libc/gen/getusershell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/getusershell.c b/lib/libc/gen/getusershell.c
index 56ad2093b72..c3517b19e06 100644
--- a/lib/libc/gen/getusershell.c
+++ b/lib/libc/gen/getusershell.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getusershell.c,v 1.13 2014/01/19 21:01:06 tobias Exp $ */
+/* $OpenBSD: getusershell.c,v 1.14 2014/09/15 06:15:48 guenther Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -95,7 +95,7 @@ initshells(void)
if (strings != NULL)
free(strings);
strings = NULL;
- if ((fp = fopen(_PATH_SHELLS, "r")) == NULL)
+ if ((fp = fopen(_PATH_SHELLS, "re")) == NULL)
return (okshells);
if (fstat(fileno(fp), &statb) == -1) {
(void)fclose(fp);