summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/nsdispatch.c
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2004-04-01 19:12:45 +0000
committernectar <nectar@FreeBSD.org>2004-04-01 19:12:45 +0000
commitebdf5cfddd596e2dc77d372b7914fcdcd0535688 (patch)
treed83eb1fd83cda4bb71ec6c51ae83556ee9779bd0 /lib/libc/net/nsdispatch.c
parentd03618b7cd32c4a2653d7c188c23ff62585ed6d1 (diff)
downloadFreeBSD-src-ebdf5cfddd596e2dc77d372b7914fcdcd0535688.zip
FreeBSD-src-ebdf5cfddd596e2dc77d372b7914fcdcd0535688.tar.gz
The previous commit changed the behavior of nsdispatch() in the
case where an /etc/nsswitch.conf file was present, but could not be opened (e.g. due to permissions). Previously, the open failure condition was suppressed, and the built-in defaults were used. In revision 1.11, however, propagated the open failure causing all nsdispatch() invocations to return NS_UNAVAIL, and thus many APIs including getpwnam and gethostbyname unconditionally failed. This commit restores the previous behavior. Pointy hat: nectar (+1 for obstinance; ache had to use clue bat) Reported by: ache
Diffstat (limited to 'lib/libc/net/nsdispatch.c')
-rw-r--r--lib/libc/net/nsdispatch.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c
index 7dd9086..c9be763 100644
--- a/lib/libc/net/nsdispatch.c
+++ b/lib/libc/net/nsdispatch.c
@@ -343,10 +343,8 @@ nss_configure(void)
goto fin2;
}
_nsyyin = fopen(path, "r");
- if (_nsyyin == NULL) {
- result = errno;
+ if (_nsyyin == NULL)
goto fin;
- }
VECTOR_FREE(_nsmap, &_nsmapsize, sizeof(*_nsmap),
(vector_free_elem)ns_dbt_free);
VECTOR_FREE(_nsmod, &_nsmodsize, sizeof(*_nsmod),
OpenPOWER on IntegriCloud