PERFORCE change 113560 for review
Michael Bushkov
bushman at FreeBSD.org
Fri Jan 26 13:50:40 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=113560
Change 113560 by bushman at 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 <ldap.h>
#include <grp.h>
#include <stringlist.h>
+#include <stdlib.h>
#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 <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <sys/types.h>
#include <assert.h>
#include <errno.h>
#include <nsswitch.h>
#include <ldap.h>
#include <pwd.h>
#include <stringlist.h>
-
+#include <stdlib.h>
+#include <unistd.h>
#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 <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <arpa/inet.h>
#include <assert.h>
#include <errno.h>
#include <nsswitch.h>
#include <ldap.h>
#include <netdb.h>
#include <stringlist.h>
+#include <stdlib.h>
#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 <errno.h>
#include <fcntl.h>
#include <ldap.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stringlist.h>
+#include <unistd.h>
#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 <sys/types.h>
#include <assert.h>
#include <ldap.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stringlist.h>
@@ -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 <assert.h>
#include <errno.h>
#include <ldap.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stringlist.h>
@@ -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 <lber.h>
#include <ldap.h>
#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
#include <string.h>
#include <stringlist.h>
#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 <stdlib.h>
#include <stringlist.h>
#include <syslog.h>
+#include <unistd.h>
#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
More information about the p4-projects
mailing list