From owner-p4-projects@FreeBSD.ORG Fri Jun 30 13:40:44 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3EA7216A716; Fri, 30 Jun 2006 13:40:44 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D98CB16A5DB for ; Fri, 30 Jun 2006 13:40:43 +0000 (UTC) (envelope-from bushman@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5ABC44074 for ; Fri, 30 Jun 2006 13:17:08 +0000 (GMT) (envelope-from bushman@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5UDH1aF043237 for ; Fri, 30 Jun 2006 13:17:01 GMT (envelope-from bushman@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5UDH1dg043234 for perforce@freebsd.org; Fri, 30 Jun 2006 13:17:01 GMT (envelope-from bushman@freebsd.org) Date: Fri, 30 Jun 2006 13:17:01 GMT Message-Id: <200606301317.k5UDH1dg043234@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bushman@freebsd.org using -f From: Michael Bushkov To: Perforce Change Reviews Cc: Subject: PERFORCE change 100349 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2006 13:40:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=100349 Change 100349 by bushman@bushman_nss_ldap_cached on 2006/06/30 13:16:54 shells "dns" source error fixed; some minor bugs in getusershell.c fixed Affected files ... .. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/gen/getusershell.c#3 edit .. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/dns_shells.c#2 edit .. //depot/projects/soc2006/nss_ldap_cached/tests/getusershell_test/Makefile#4 edit .. //depot/projects/soc2006/nss_ldap_cached/tests/getusershell_test/getusershell_test.c#4 edit Differences ... ==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/gen/getusershell.c#3 (text+ko) ==== @@ -50,6 +50,8 @@ #include #include #include "un-namespace.h" +#include "nss_tls.h" +#include "reentrant.h" static const ns_src defaultsrc[] = { { NSSRC_FILES, NS_SUCCESS }, @@ -94,7 +96,7 @@ ret_errno = 0; *retval = NULL; - rv = nsdispatch(retval, dtab, NSDB_SHELLS, "getusershell_r", + rv = _nsdispatch(retval, dtab, NSDB_SHELLS, "getusershell_r", defaultsrc, buffer, bufsize, &ret_errno); if (rv == NS_SUCCESS) @@ -152,7 +154,7 @@ { NULL, NULL, NULL } }; - nsdispatch(NULL, dtab, NSDB_SHELLS, "setusershell"); + _nsdispatch(NULL, dtab, NSDB_SHELLS, "setusershell", defaultsrc); } void @@ -162,5 +164,5 @@ { NULL, NULL, NULL } }; - nsdispatch(NULL, dtab, NSDB_SHELLS, "setusershell"); + _nsdispatch(NULL, dtab, NSDB_SHELLS, "setusershell", defaultsrc); } ==== //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/dns_shells.c#2 (text+ko) ==== @@ -120,7 +120,10 @@ if (linesize >= buflen) { *errnop = ERANGE; r = NS_RETURN; - } + } else { + *((char **)rv) = buffer; + r = NS_SUCCESS; + } } hesiod_end(context); ==== //depot/projects/soc2006/nss_ldap_cached/tests/getusershell_test/Makefile#4 (text+ko) ==== ==== //depot/projects/soc2006/nss_ldap_cached/tests/getusershell_test/getusershell_test.c#4 (text+ko) ==== @@ -326,23 +326,23 @@ if ((_res.options & RES_INIT) == 0 && res_init() == -1) return NULL; - printf(":::: %d\n", __LINE__); + //printf(":::: %d %d %s\n", __LINE__, qclass, name); /* Construct the query. */ n = res_mkquery(QUERY, name, qclass, T_TXT, NULL, 0, NULL, qbuf, PACKETSZ); if (n < 0) return NULL; - printf(":::: %d\n", __LINE__); + //printf(":::: %d\n", __LINE__); /* Send the query. */ n = res_send(qbuf, n, abuf, MAX_HESRESP); if (n < 0 || n > MAX_HESRESP) { - printf("%s %d %d %d\n", name, errno, h_errno, n); + //printf("%s %d %d %d\n", name, errno, h_errno, n); errno = ECONNREFUSED; /* XXX */ return NULL; } - printf(":::: %d\n", __LINE__); + //printf(":::: %d\n", __LINE__); /* Parse the header of the result. */ hp = (HEADER *) (void *) abuf; ancount = ntohs(hp->ancount); @@ -350,7 +350,7 @@ p = abuf + sizeof(HEADER); eom = abuf + n; - printf(":::: %d\n", __LINE__); + //printf(":::: %d\n", __LINE__); /* * Skip questions, trying to get to the answer section * which follows. @@ -364,7 +364,7 @@ p += skip + QFIXEDSZ; } - printf(":::: %d\n", __LINE__); + //printf(":::: %d\n", __LINE__); /* Allocate space for the text record answers. */ list = malloc((ancount + 1) * sizeof(char *)); if (!list) { @@ -874,10 +874,10 @@ return (r); snprintf(shellname, sizeof(shellname)-1, "shells-%d", st->counter++); - printf("::%d %s\n", __LINE__, shellname); + //printf("::%d %s\n", __LINE__, shellname); hp = hesiod_resolve(context, shellname, "shells"); if (hp == NULL) { - printf("::%d %d\n", __LINE__, errno); + //printf("::%d %d\n", __LINE__, errno); st->counter = -1; if (errno == ENOENT) @@ -886,22 +886,23 @@ *errnop = errno; r = NS_UNAVAIL; } - printf("::%d\n", __LINE__); + //printf("::%d\n", __LINE__); } else { - printf("::%d\n", __LINE__); + //printf("::%d\n", __LINE__); linesize = strlcpy(buffer, hp[0], buflen); hesiod_free_list(context, hp); - printf("::%d\n", __LINE__); + //printf("::%d\n", __LINE__); if (linesize >= buflen) { *errnop = ERANGE; r = NS_RETURN; } - printf("::%d\n", __LINE__); + //printf("::%d\n", __LINE__); + *((char **)rv) = buffer; } hesiod_end(context); - printf("::%d\n", __LINE__); + //printf("::%d\n", __LINE__); return (r); }