diff options
author | casper <none@none> | 2006-05-01 11:23:49 -0700 |
---|---|---|
committer | casper <none@none> | 2006-05-01 11:23:49 -0700 |
commit | 004388ebfdfe2ed7dfd2d153a876dfcc22d2c006 (patch) | |
tree | 9f3972760e2696f63065521871e50e1440bfbb75 /usr/src/lib/libresolv2/common/resolv | |
parent | 0ade2cf005fcaecc5255dacf7d76683de855a9da (diff) | |
download | illumos-joyent-004388ebfdfe2ed7dfd2d153a876dfcc22d2c006.tar.gz |
4916205 libcmd should not use file operation routines from C library
6234782 Kerberos and GSSAPI should not use fopen
6259671 vold won't be killed by TERM signal when several removable devices are managed
6386770 pam_authenticate can fail if open files are >= 255 and the soft fd limit is greater than 256
6414401 Remove shadow stdio implementation obsoleted by PSARC 2006/162
6414404 __rpc_openchild never called and not exported by library
6416815 ON needs to be hardened against the 32-bit fopen/255 problem
--HG--
rename : usr/src/lib/libnsl/common/nsl_stdio_prv.c => deleted_files/usr/src/lib/libnsl/common/nsl_stdio_prv.c
rename : usr/src/lib/libnsl/include/nsl_stdio_prv.h => deleted_files/usr/src/lib/libnsl/include/nsl_stdio_prv.h
rename : usr/src/lib/libnsl/rpc/openchild.c => deleted_files/usr/src/lib/libnsl/rpc/openchild.c
rename : usr/src/lib/libnsl/rpc/xdr_stdio_prv.c => deleted_files/usr/src/lib/libnsl/rpc/xdr_stdio_prv.c
rename : usr/src/lib/libresolv2/req.flg => deleted_files/usr/src/lib/libresolv2/req.flg
rename : usr/src/lib/nsswitch/compat/req.flg => deleted_files/usr/src/lib/nsswitch/compat/req.flg
rename : usr/src/lib/nsswitch/files/req.flg => deleted_files/usr/src/lib/nsswitch/files/req.flg
rename : usr/src/lib/nsswitch/req.flg => deleted_files/usr/src/lib/nsswitch/req.flg
rename : usr/src/lib/nsswitch/user/req.flg => deleted_files/usr/src/lib/nsswitch/user/req.flg
Diffstat (limited to 'usr/src/lib/libresolv2/common/resolv')
-rw-r--r-- | usr/src/lib/libresolv2/common/resolv/res_init.c | 22 | ||||
-rw-r--r-- | usr/src/lib/libresolv2/common/resolv/res_query.c | 27 |
2 files changed, 7 insertions, 42 deletions
diff --git a/usr/src/lib/libresolv2/common/resolv/res_init.c b/usr/src/lib/libresolv2/common/resolv/res_init.c index 06b35591b1..e0eac579e4 100644 --- a/usr/src/lib/libresolv2/common/resolv/res_init.c +++ b/usr/src/lib/libresolv2/common/resolv/res_init.c @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -99,9 +99,6 @@ static const char rcsid[] = "$Id: res_init.c,v 8.32 2003/04/03 06:31:10 marka Ex #include <netdb.h> #include "port_after.h" -#ifdef SUNW_AVOIDSTDIO_FDLIMIT -#include "../../../libnsl/include/nsl_stdio_prv.h" -#endif /* ensure that sockaddr_in6 and IN6ADDR_ANY_INIT are declared / defined */ #include <resolv.h> @@ -176,11 +173,7 @@ res_ninit(res_state statp) { /* This function has to be reachable by res_data.c but not publically. */ int __res_vinit(res_state statp, int preinit) { -#ifdef SUNW_AVOIDSTDIO_FDLIMIT - register __NSL_FILE *fp; -#else register FILE *fp; -#endif register char *cp, **pp; register int n; char buf[BUFSIZ]; @@ -396,15 +389,13 @@ __res_vinit(res_state statp, int preinit) { nserv = 0; -#ifdef SUNW_AVOIDSTDIO_FDLIMIT - if ((fp = __nsl_fopen(_PATH_RESCONF, "r")) != NULL) { - /* read the config file */ - while (__nsl_fgets(buf, sizeof(buf), fp) != NULL) { +#ifdef SUNW_AVOIDSTDIO_FDLIMIT + if ((fp = fopen(_PATH_RESCONF, "rF")) != NULL) { #else if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) { +#endif /* read the config file */ while (fgets(buf, sizeof(buf), fp) != NULL) { -#endif /* skip comments */ if (*buf == ';' || *buf == '#') continue; @@ -550,12 +541,7 @@ __res_vinit(res_state statp, int preinit) { #ifdef RESOLVSORT statp->nsort = nsort; #endif - -#ifdef SUNW_AVOIDSTDIO_FDLIMIT - (void) __nsl_fclose(fp); -#else (void) fclose(fp); -#endif } /* * Last chance to get a nameserver. This should not normally diff --git a/usr/src/lib/libresolv2/common/resolv/res_query.c b/usr/src/lib/libresolv2/common/resolv/res_query.c index 55746f572f..b592f4e72f 100644 --- a/usr/src/lib/libresolv2/common/resolv/res_query.c +++ b/usr/src/lib/libresolv2/common/resolv/res_query.c @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -94,9 +94,6 @@ static const char rcsid[] = "$Id: res_query.c,v 8.24 2003/01/31 15:25:58 vixie E #include <stdlib.h> #include <string.h> #include "port_after.h" -#ifdef SUNW_AVOIDSTDIO_FDLIMIT -#include "../../../libnsl/include/nsl_stdio_prv.h" -#endif /* Options. Leave them on. */ #define DEBUG @@ -407,30 +404,20 @@ const char * res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) { char *file, *cp1, *cp2; char buf[BUFSIZ]; -#ifdef SUNW_AVOIDSTDIO_FDLIMIT - __NSL_FILE *fp; -#else FILE *fp; -#endif if (statp->options & RES_NOALIASES) return (NULL); file = getenv("HOSTALIASES"); -#ifdef SUNW_AVOIDSTDIO_FDLIMIT - if (file == NULL || (fp = __nsl_fopen(file, "r")) == NULL) +#ifdef SUNW_AVOIDSTDIO_FDLIMIT + if (file == NULL || (fp = fopen(file, "rF")) == NULL) #else if (file == NULL || (fp = fopen(file, "r")) == NULL) #endif return (NULL); -#ifndef SUNW_AVOIDSTDIO_FDLIMIT setbuf(fp, NULL); -#endif buf[sizeof(buf) - 1] = '\0'; -#ifdef SUNW_AVOIDSTDIO_FDLIMIT - while (__nsl_fgets(buf, sizeof(buf), fp)) { -#else while (fgets(buf, sizeof(buf), fp)) { -#endif for (cp1 = buf; *cp1 && !isspace((unsigned char)*cp1); ++cp1) ; if (!*cp1) @@ -447,18 +434,10 @@ res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) { *cp2 = '\0'; strncpy(dst, cp1, siz - 1); dst[siz - 1] = '\0'; -#ifdef SUNW_AVOIDSTDIO_FDLIMIT - __nsl_fclose(fp); -#else fclose(fp); -#endif return (dst); } } -#ifdef SUNW_AVOIDSTDIO_FDLIMIT - __nsl_fclose(fp); -#else fclose(fp); -#endif return (NULL); } |