diff options
| author | guenther <> | 2014-09-15 06:15:48 +0000 |
|---|---|---|
| committer | guenther <> | 2014-09-15 06:15:48 +0000 |
| commit | 7e9937d6e8784a350351cd8743feb02a8f325b83 (patch) | |
| tree | ad712f134771158fecd87a78b6c147ee2b1a2261 /src/lib/libc/net/ruserok.c | |
| parent | 7679690e86922a2dcc0822b02ca8d15b3a8771be (diff) | |
| download | openbsd-7e9937d6e8784a350351cd8743feb02a8f325b83.tar.gz openbsd-7e9937d6e8784a350351cd8743feb02a8f325b83.tar.bz2 openbsd-7e9937d6e8784a350351cd8743feb02a8f325b83.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 '')
| -rw-r--r-- | src/lib/libc/net/ruserok.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/net/ruserok.c b/src/lib/libc/net/ruserok.c index 21646c156b..4d0adfbe4e 100644 --- a/src/lib/libc/net/ruserok.c +++ b/src/lib/libc/net/ruserok.c | |||
| @@ -118,7 +118,7 @@ iruserok_sa(const void *raddr, int rlen, int superuser, const char *ruser, | |||
| 118 | 118 | ||
| 119 | sa = (struct sockaddr *)raddr; | 119 | sa = (struct sockaddr *)raddr; |
| 120 | first = 1; | 120 | first = 1; |
| 121 | hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "r"); | 121 | hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "re"); |
| 122 | again: | 122 | again: |
| 123 | if (hostf) { | 123 | if (hostf) { |
| 124 | if (__ivaliduser_sa(hostf, sa, rlen, luser, ruser) == 0) { | 124 | if (__ivaliduser_sa(hostf, sa, rlen, luser, ruser) == 0) { |
| @@ -144,7 +144,7 @@ again: | |||
| 144 | */ | 144 | */ |
| 145 | uid = geteuid(); | 145 | uid = geteuid(); |
| 146 | (void)seteuid(pwd->pw_uid); | 146 | (void)seteuid(pwd->pw_uid); |
| 147 | hostf = fopen(pbuf, "r"); | 147 | hostf = fopen(pbuf, "re"); |
| 148 | (void)seteuid(uid); | 148 | (void)seteuid(uid); |
| 149 | 149 | ||
| 150 | if (hostf == NULL) | 150 | if (hostf == NULL) |
