diff options
Diffstat (limited to 'nss')
-rw-r--r-- | nss/nss_dns/dns-host.c | 39 | ||||
-rw-r--r-- | nss/nsswitch.c | 12 |
2 files changed, 37 insertions, 14 deletions
diff --git a/nss/nss_dns/dns-host.c b/nss/nss_dns/dns-host.c index eaa9e81218..f8116fed34 100644 --- a/nss/nss_dns/dns-host.c +++ b/nss/nss_dns/dns-host.c @@ -17,19 +17,14 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Parts of this file are plain copies of the file `getnetnamadr.c' from +/* Parts of this file are plain copies of the file `gethtnamadr.c' from the bind package and it has the following copyright. */ -/* Copyright (c) 1993 Carlos Leandro and Rui Salgueiro - * Dep. Matematica Universidade de Coimbra, Portugal, Europe - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - */ /* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. + * ++Copyright++ 1985, 1988, 1993 + * - + * Copyright (c) 1985, 1988, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,8 +36,8 @@ Boston, MA 02111-1307, USA. */ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. + * This product includes software developed by the University of + * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -58,6 +53,26 @@ Boston, MA 02111-1307, USA. */ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * - + * Portions Copyright (c) 1993 by Digital Equipment Corporation. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies, and that + * the name of Digital Equipment Corporation not be used in advertising or + * publicity pertaining to distribution of the document or software without + * specific, written prior permission. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT + * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * - + * --Copyright-- */ #include <ctype.h> diff --git a/nss/nsswitch.c b/nss/nsswitch.c index 69b1be5e08..099f405c6e 100644 --- a/nss/nsswitch.c +++ b/nss/nsswitch.c @@ -189,8 +189,16 @@ __nss_configure_lookup (const char *dbname, const char *service_line) size_t cnt; for (cnt = 0; cnt < sizeof databases; ++cnt) - if (strcmp (dbname, databases[cnt].name) == 0) - break; + { + int cmp = strcmp (dbname, databases[cnt].name); + if (cmp == 0) + break; + if (cmp > 0) + { + errno = EINVAL; + return -1; + } + } if (cnt == sizeof databases) { |