From owner-p4-projects@FreeBSD.ORG Fri Jan 26 13:50:40 2007 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 217F316A515; Fri, 26 Jan 2007 13:50:40 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB74A16A511 for ; Fri, 26 Jan 2007 13:50:39 +0000 (UTC) (envelope-from bushman@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id CB3BF13C48C for ; Fri, 26 Jan 2007 13:50:39 +0000 (UTC) (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 l0QDod37041668 for ; Fri, 26 Jan 2007 13:50:39 GMT (envelope-from bushman@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l0QDodvZ041664 for perforce@freebsd.org; Fri, 26 Jan 2007 13:50:39 GMT (envelope-from bushman@freebsd.org) Date: Fri, 26 Jan 2007 13:50:39 GMT Message-Id: <200701261350.l0QDodvZ041664@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 113560 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, 26 Jan 2007 13:50:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=113560 Change 113560 by bushman@bushman_nss_ldap_cached on 2007/01/26 13:50:34 IFC Affected files ... .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/Makefile#4 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldap_group.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldap_passwd.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldap_serv.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldapconf.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldapconn.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldapschema.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldapsearch.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldaptls.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldaptls.h#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldaputil.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/nss_ldap.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/nss_ldap.h#2 integrate Differences ... ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/Makefile#4 (text+ko) ==== @@ -10,10 +10,14 @@ SRCS= nss_ldap.c ldap_group.c ldap_passwd.c ldap_serv.c ldapconn.c\ ldapconf.c ldapschema.c ldapsearch.c ldaptls.c ldaputil.c +CFLAGS+= -DLDAP_DEPRECATED +LDADD+= -lldap + +.if ${MK_INET6_SUPPORT} != "no" CFLAGS+=-DINET6 -I${PREFIX}/include\ -DNSS_LDAP_CONF_PATH=\"${PREFIX}/etc/nss_ldap.conf\" LDFLAGS+= -L${PREFIX}/lib -LDADD+= -lldap +.endif CFLAGS+= -DNSS_LDAP_START_TLS_ENABLED -DNSS_LDAP_SSL_ENABLED ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldap_group.c#2 (text+ko) ==== @@ -36,6 +36,7 @@ #include #include #include +#include #include "hashtable.h" #include "ldapconn.h" #include "ldapschema.h" @@ -188,7 +189,6 @@ struct mapped_user new_mu; struct nss_ldap_search_context *newctx; struct map_group_dn_request *req; - char **cp; char const *uid_attr, *gid_attr; struct processed_group *group_hash_entry_data; struct __pg_he *group_hash_entry; ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldap_passwd.c#2 (text+ko) ==== @@ -28,13 +28,15 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include #include #include #include - +#include +#include #include "ldapconn.h" #include "ldapschema.h" #include "ldapsearch.h" ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldap_serv.c#2 (text+ko) ==== @@ -28,12 +28,14 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include #include #include #include +#include #include "ldapconn.h" #include "ldapschema.h" #include "ldapsearch.h" @@ -140,7 +142,6 @@ (void *)&mdata, buffer, bufsize, nss_ldap_parse_servent, NULL); - printf("== %d\n", rv); if (rv == NS_SUCCESS) *result = serv; @@ -193,7 +194,7 @@ struct services_mdata_ext *serv_mdata_ext; struct servent *serv; - char *buf, **values; + char *buf; size_t buflen; size_t len, memlen; int rv; ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldapconf.c#2 (text+ko) ==== @@ -760,9 +760,8 @@ { FILE *fin; char buffer[1024]; - char *fields[16], *str; - int field_count, line_num, value; - int i, res, rv; + char *fields[16]; + int field_count, line_num, res; assert(conf != NULL); assert(fname != NULL); @@ -870,7 +869,7 @@ #endif } else { snprintf(err->buffer, sizeof(err->buffer), "parse error in " - "configuration file '%s'", fname, line_num); + "configuration file '%s', line %d", fname, line_num); err->line = line_num; } ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldapconn.c#2 (text+ko) ==== @@ -35,9 +35,11 @@ #include #include #include +#include #include #include #include +#include #include "ldapschema.h" #include "ldapsearch.h" #include "ldaptls.h" @@ -309,6 +311,7 @@ assert(conn != NULL); memset(conn, 0, sizeof(struct nss_ldap_connection)); + return (0); } ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldapschema.c#2 (text+ko) ==== @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -301,7 +302,6 @@ struct nss_ldap_schema_rule *rule) { struct nss_ldap_schema_rule *new_coll; - size_t new_eff_size; assert(rules != NULL); assert(rule != NULL); ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldapsearch.c#2 (text+ko) ==== @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ #include "ldapsearch.h" #include "ldaptls.h" #include "ldapconf.h" +#include "ldaputil.h" #include "nss_ldap.h" static int copy_request(struct nss_ldap_search_request *, @@ -263,7 +265,7 @@ BerElement *cookie; char **res_arr, **new_res_arr; char *sbuf, *rbuf; - size_t res_arr_size, res_buf_size, res_buf_offset, res_arr_offset; + size_t res_arr_size, res_buf_offset, res_arr_offset; int range_start, range_end, rv, sf; rv = __nss_ldap_parse_range(attr, &range_start, &range_end); @@ -487,7 +489,7 @@ { LDAPControl **server_controls; char *matcheddn, *errmsg, **referrals; - int errcode, finished, rv; + int errcode, rv; unsigned long abs_rescount; assert(ctx != NULL); @@ -623,17 +625,6 @@ free(ctx); } -static void -end_parsing_def(struct nss_ldap_parse_context *pctx) -{ - - assert(pctx != NULL); - - if (pctx->parse_destroy_fn != NULL) - pctx->parse_destroy_fn(pctx); - free(pctx); -} - struct nss_ldap_search_context * __nss_ldap_start_search(struct nss_ldap_search_method *method, struct nss_ldap_connection *conn, @@ -809,7 +800,6 @@ struct nss_ldap_schema *schema; struct nss_ldap_schema_rule *rule; char **values; - size_t size; int rv; assert(ctx != NULL); ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldaptls.c#2 (text+ko) ==== ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldaptls.h#2 (text+ko) ==== @@ -47,7 +47,7 @@ static void \ name##_keyinit(void) \ { \ - (void)_pthread_key_create(&name##_state_key, name##_endstate); \ + (void)pthread_key_create(&name##_state_key, name##_endstate); \ } \ \ static int \ @@ -56,7 +56,7 @@ static pthread_once_t keyinit = PTHREAD_ONCE_INIT; \ int rv; \ \ - if (!__isthreaded || _pthread_main_np() != 0) { \ + if (!__isthreaded || pthread_main_np() != 0) { \ if (name##_st == NULL) { \ name##_st = (struct name##_state *)malloc( \ sizeof(struct name##_state)); \ @@ -68,16 +68,16 @@ *p = name##_st; \ return (0); \ } \ - rv = _pthread_once(&keyinit, name##_keyinit); \ + rv = pthread_once(&keyinit, name##_keyinit); \ if (rv != 0) \ return (rv); \ - *p = (struct name##_state *)_pthread_getspecific(name##_state_key);\ + *p = (struct name##_state *)pthread_getspecific(name##_state_key);\ if (*p != NULL) \ return (0); \ *p = calloc(1, sizeof(**p)); \ if (*p == NULL) \ return (ENOMEM); \ - rv = _pthread_setspecific(name##_state_key, *p); \ + rv = pthread_setspecific(name##_state_key, *p); \ if (rv != 0) { \ free(*p); \ *p = NULL; \ ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/ldaputil.c#2 (text+ko) ==== @@ -33,6 +33,9 @@ #include #include #include +#include +#include +#include #include #include #include "ldaputil.h" @@ -233,7 +236,6 @@ break; }; -fin: va_end(ap); switch (rv) { ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/nss_ldap.c#2 (text+ko) ==== @@ -43,6 +43,7 @@ #include #include #include +#include #include "ldapschema.h" #include "ldapconn.h" #include "ldaputil.h" @@ -135,7 +136,7 @@ struct nss_ldap_tls_method *, int, char const *, struct nss_ldap_parse_context **, struct nss_ldap_connection *, struct nss_ldap_parse_context *); -static int nss_ldap_parse_context_done(struct nss_ldap_search_method *, +static void nss_ldap_parse_context_done(struct nss_ldap_search_method *, struct nss_ldap_tls_method *, struct nss_ldap_parse_context *, int); @@ -246,7 +247,6 @@ connection_destroy_func(struct nss_ldap_connection *conn) { struct nss_ldap_connection_error conn_error; - int rv; memset(&conn_error, 0, sizeof(conn_error)); (void)__nss_ldap_disconnect(&__nss_ldap_conf->connection_method, @@ -605,7 +605,7 @@ return (rv); } -static int +static void nss_ldap_parse_context_done(struct nss_ldap_search_method *search_method, struct nss_ldap_tls_method *tls_method, struct nss_ldap_parse_context *pctx, int map_id) @@ -956,7 +956,7 @@ pthread_rwlock_unlock(&nss_ldap_lock); } -int +void __nss_ldap_log(int level, char const *fmt, ...) { char error_buf[1024]; @@ -991,8 +991,6 @@ _ldap_nss_module_register(const char *source, unsigned int *mtabsize, nss_module_unregister_fn *unreg) { - int rv; - __nss_ldap_log(NSS_LDAP_LL_DEBUG_INT, "_nss_ldap_nss_module_register called"); ==== //depot/projects/soc2006/nss_ldap_cached_openldap/nss_ldap_port/src/nss_ldap.h#2 (text+ko) ==== @@ -63,7 +63,7 @@ nss_ldap_parse_next_fn, nss_ldap_parse_destroy_fn); extern int __nss_ldap_getent(int, char const *, void *, char *, size_t, nss_ldap_parse_next_fn, nss_ldap_parse_destroy_fn); -extern int __nss_ldap_log(int level, char const *fmt, ...); +extern void __nss_ldap_log(int level, char const *fmt, ...); extern void __nss_ldap_setent(int); #endif