mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
Suck in latest changes from -devel. Besides the usually lint removal,
the patch includes slapd malloc/free fixes in the slapd dn2entry code.
This commit is contained in:
parent
93f78b91c6
commit
d5bc2084be
190
aclocal.m4
vendored
190
aclocal.m4
vendored
@ -506,193 +506,3 @@ AC_DEFUN(AM_TYPE_PTRDIFF_T,
|
||||
fi
|
||||
])
|
||||
|
||||
#serial 4
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl FIXME: this should migrate into libit.
|
||||
|
||||
AC_DEFUN(AM_FUNC_MKTIME,
|
||||
[AC_REQUIRE([AC_HEADER_TIME])dnl
|
||||
AC_CHECK_HEADERS(sys/time.h unistd.h)
|
||||
AC_CHECK_FUNCS(alarm)
|
||||
AC_CACHE_CHECK([for working mktime], am_cv_func_working_mktime,
|
||||
[AC_TRY_RUN(
|
||||
changequote(<<, >>)dnl
|
||||
<</* Test program from Paul Eggert (eggert@twinsun.com)
|
||||
and Tony Leneis (tony@plaza.ds.adp.com). */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if !HAVE_ALARM
|
||||
# define alarm(X) /* empty */
|
||||
#endif
|
||||
|
||||
/* Work around redefinition to rpl_putenv by other config tests. */
|
||||
#undef putenv
|
||||
|
||||
static time_t time_t_max;
|
||||
|
||||
/* Values we'll use to set the TZ environment variable. */
|
||||
static const char *const tz_strings[] = {
|
||||
(const char *) 0, "GMT0", "JST-9",
|
||||
"EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
|
||||
};
|
||||
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
|
||||
|
||||
static void
|
||||
mktime_test (now)
|
||||
time_t now;
|
||||
{
|
||||
struct tm *lt;
|
||||
if ((lt = localtime (&now)) && mktime (lt) != now)
|
||||
exit (1);
|
||||
now = time_t_max - now;
|
||||
if ((lt = localtime (&now)) && mktime (lt) != now)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static void
|
||||
irix_6_4_bug ()
|
||||
{
|
||||
/* Based on code from Ariel Faigon. */
|
||||
struct tm tm;
|
||||
tm.tm_year = 96;
|
||||
tm.tm_mon = 3;
|
||||
tm.tm_mday = 0;
|
||||
tm.tm_hour = 0;
|
||||
tm.tm_min = 0;
|
||||
tm.tm_sec = 0;
|
||||
tm.tm_isdst = -1;
|
||||
mktime (&tm);
|
||||
if (tm.tm_mon != 2 || tm.tm_mday != 31)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static void
|
||||
bigtime_test (j)
|
||||
int j;
|
||||
{
|
||||
struct tm tm;
|
||||
time_t now;
|
||||
tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
|
||||
/* This test makes some buggy mktime implementations loop.
|
||||
Give up after 10 seconds. */
|
||||
alarm (10);
|
||||
now = mktime (&tm);
|
||||
alarm (0);
|
||||
if (now != (time_t) -1)
|
||||
{
|
||||
struct tm *lt = localtime (&now);
|
||||
if (! (lt
|
||||
&& lt->tm_year == tm.tm_year
|
||||
&& lt->tm_mon == tm.tm_mon
|
||||
&& lt->tm_mday == tm.tm_mday
|
||||
&& lt->tm_hour == tm.tm_hour
|
||||
&& lt->tm_min == tm.tm_min
|
||||
&& lt->tm_sec == tm.tm_sec
|
||||
&& lt->tm_yday == tm.tm_yday
|
||||
&& lt->tm_wday == tm.tm_wday
|
||||
&& ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
|
||||
== (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
time_t t, delta;
|
||||
int i, j;
|
||||
|
||||
for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
|
||||
continue;
|
||||
time_t_max--;
|
||||
delta = time_t_max / 997; /* a suitable prime number */
|
||||
for (i = 0; i < N_STRINGS; i++)
|
||||
{
|
||||
if (tz_strings[i])
|
||||
putenv (tz_strings[i]);
|
||||
|
||||
for (t = 0; t <= time_t_max - delta; t += delta)
|
||||
mktime_test (t);
|
||||
mktime_test ((time_t) 60 * 60);
|
||||
mktime_test ((time_t) 60 * 60 * 24);
|
||||
|
||||
for (j = 1; 0 < j; j *= 2)
|
||||
bigtime_test (j);
|
||||
bigtime_test (j - 1);
|
||||
}
|
||||
irix_6_4_bug ();
|
||||
exit (0);
|
||||
}
|
||||
>>,
|
||||
changequote([, ])dnl
|
||||
am_cv_func_working_mktime=yes, am_cv_func_working_mktime=no,
|
||||
dnl When crosscompiling, assume mktime is missing or broken.
|
||||
am_cv_func_working_mktime=no)
|
||||
])
|
||||
if test $am_cv_func_working_mktime = no; then
|
||||
LIBOBJS="$LIBOBJS mktime.o"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AC_DEFUN(AM_FUNC_STRTOD,
|
||||
[AC_CACHE_CHECK(for working strtod, am_cv_func_strtod,
|
||||
[AC_TRY_RUN([
|
||||
double strtod ();
|
||||
int
|
||||
main()
|
||||
{
|
||||
{
|
||||
/* Some versions of Linux strtod mis-parse strings with leading '+'. */
|
||||
char *string = " +69";
|
||||
char *term;
|
||||
double value;
|
||||
value = strtod (string, &term);
|
||||
if (value != 69 || term != (string + 4))
|
||||
exit (1);
|
||||
}
|
||||
|
||||
{
|
||||
/* Under Solaris 2.4, strtod returns the wrong value for the
|
||||
terminating character under some conditions. */
|
||||
char *string = "NaN";
|
||||
char *term;
|
||||
strtod (string, &term);
|
||||
if (term != string && *(term - 1) == 0)
|
||||
exit (1);
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
], am_cv_func_strtod=yes, am_cv_func_strtod=no, am_cv_func_strtod=no)])
|
||||
test $am_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
|
||||
AC_SUBST(LIBOBJS)dnl
|
||||
am_cv_func_strtod_needs_libm=no
|
||||
if test $am_cv_func_strtod = no; then
|
||||
AC_CHECK_FUNCS(pow)
|
||||
if test $ac_cv_func_pow = no; then
|
||||
AC_CHECK_LIB(m, pow, [am_cv_func_strtod_needs_libm=yes],
|
||||
[AC_MSG_WARN(can't find library containing definition of pow)])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
@ -281,7 +281,7 @@ format( char *str, int width, int lead )
|
||||
*/
|
||||
s = original = strdup(str);
|
||||
for (;;) {
|
||||
if ((strlen(s) + lead) < width) {
|
||||
if (((int) strlen(s) + lead) < width) {
|
||||
printf("%s%s\n", leader, s);
|
||||
Free(leader);
|
||||
Free(original);
|
||||
@ -352,7 +352,7 @@ format2(
|
||||
i = "";
|
||||
|
||||
/* now do the first line */
|
||||
if ((strlen(s) + strlen(first_tag) + first_indent) < width) {
|
||||
if (((int) strlen(s) + (int) strlen(first_tag) + first_indent) < width) {
|
||||
printf("%s%s%s\n", fi, first_tag, s);
|
||||
Free(fi);
|
||||
Free(i);
|
||||
@ -391,7 +391,7 @@ format2(
|
||||
|
||||
/* now do all of the other lines */
|
||||
for (;;) {
|
||||
if ((strlen(s) + strlen(tag) + indent) < width) {
|
||||
if (((int) strlen(s) + (int) strlen(tag) + indent) < width) {
|
||||
printf("%s%s%s\n", i, tag, s);
|
||||
Free(fi);
|
||||
Free(i);
|
||||
|
@ -966,9 +966,11 @@ AC_CHECK_HEADERS( \
|
||||
sys/resource.h \
|
||||
sys/socket.h \
|
||||
sys/syslog.h \
|
||||
sys/time.h \
|
||||
sys/types.h \
|
||||
syslog.h \
|
||||
termios.h \
|
||||
unistd.h \
|
||||
)
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
@ -999,9 +1001,9 @@ fi
|
||||
dnl ----------------------------------------------------------------
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_MEMCMP
|
||||
AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
|
||||
dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
|
||||
AC_FUNC_STRFTIME
|
||||
AM_FUNC_STRTOD
|
||||
dnl AM_FUNC_STRTOD
|
||||
AC_FUNC_VPRINTF
|
||||
|
||||
if test $ac_cv_func_vprintf = yes ; then
|
||||
|
@ -18,18 +18,20 @@ Larger than life projects
|
||||
LDAPv3 support <kurt@openldap.org>
|
||||
LDAP C API (draft-ietf-ldapext-ldap-c-api-xx) support <kurt@openldap.org>
|
||||
Schema Repository
|
||||
Modify -lldap to be operation-level multithreaded <kurt@openldap.org>
|
||||
|
||||
Large projects
|
||||
--------------
|
||||
redesign slapd threading
|
||||
autoconf support <kurt@openldap.org>
|
||||
Modify -lldap to be session-level multithreaded <kurt@openldap.org>
|
||||
Port slapd (incl back-ldbm & tools) to NT
|
||||
|
||||
|
||||
Medium projects
|
||||
---------------
|
||||
Modify -lldap to be reentrant/threadsafe <kurt@openldap.org>
|
||||
Modify -llthread to have private interface
|
||||
Port slurpd to NT
|
||||
|
||||
|
||||
Small projects
|
||||
|
@ -28,8 +28,8 @@
|
||||
# endif
|
||||
|
||||
# ifndef HAVE_MEMCPY
|
||||
# define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
# define memmove(d, s, n) bcopy ((s), (d), (n))
|
||||
# define memcpy(d, s, n) ((void) bcopy ((s), (d), (n)))
|
||||
# define memmove(d, s, n) ((void) bcopy ((s), (d), (n)))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -37,13 +37,13 @@
|
||||
/* strdup() is missing, declare our own version */
|
||||
extern char *strdup( const char *s );
|
||||
#else
|
||||
/* some systems fail to declare strdup altogether */
|
||||
/* some systems have strdup, but fail to declare it */
|
||||
extern char *strdup();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* some systems fail to declare strcasecmp() and strncasecmp()
|
||||
* we need them defined so we obtain pointers to them
|
||||
* we need them declared so we can obtain pointers to them
|
||||
*/
|
||||
extern int strcasecmp(), strncasecmp();
|
||||
|
||||
|
@ -14,6 +14,8 @@
|
||||
/* crypt() may be defined in a separate include file */
|
||||
#if HAVE_CRYPT_H
|
||||
# include <crypt.h>
|
||||
#else
|
||||
extern char *crypt();
|
||||
#endif
|
||||
|
||||
/* getopt() defines may be in separate include file */
|
||||
|
@ -119,8 +119,6 @@ typedef void *(*VFP)();
|
||||
#define PTHREAD_SHARE_PRIVATE USYNC_THREAD
|
||||
#define PTHREAD_SHARE_PROCESS USYNC_PROCESS
|
||||
|
||||
|
||||
#if !defined(__SunOS_5_6)
|
||||
/* thread attributes and thread type */
|
||||
typedef int pthread_attr_t;
|
||||
typedef thread_t pthread_t;
|
||||
@ -132,7 +130,6 @@ typedef mutex_t pthread_mutex_t;
|
||||
/* condition variable attributes and condition variable type */
|
||||
typedef int pthread_condattr_t;
|
||||
typedef cond_t pthread_cond_t;
|
||||
#endif /* ! sunos56 */
|
||||
|
||||
LDAP_END_DECL
|
||||
|
||||
|
@ -278,9 +278,6 @@ is provided ``as is'' without express or implied warranty.
|
||||
/* The number of bytes in a short. */
|
||||
#undef SIZEOF_SHORT
|
||||
|
||||
/* Define if you have the alarm function. */
|
||||
#undef HAVE_ALARM
|
||||
|
||||
/* Define if you have the bcopy function. */
|
||||
#undef HAVE_BCOPY
|
||||
|
||||
@ -314,9 +311,6 @@ is provided ``as is'' without express or implied warranty.
|
||||
/* Define if you have the mkstemp function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define if you have the pow function. */
|
||||
#undef HAVE_POW
|
||||
|
||||
/* Define if you have the pthread_attr_create function. */
|
||||
#undef HAVE_PTHREAD_ATTR_CREATE
|
||||
|
||||
|
@ -59,7 +59,7 @@ main( int argc, char **argv )
|
||||
fprintf( stderr, "ber_scanf returns -1\n" );
|
||||
exit( 1 );
|
||||
}
|
||||
printf( "got int %d\n", i );
|
||||
printf( "got int %ld\n", i );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ wait4msg( LDAP *ld, int msgid, int all, struct timeval *timeout,
|
||||
0, 0, 0 );
|
||||
} else {
|
||||
Debug( LDAP_DEBUG_TRACE, "wait4msg (timeout %ld sec, %ld usec)\n",
|
||||
timeout->tv_sec, timeout->tv_usec, 0 );
|
||||
(long) timeout->tv_sec, (long) timeout->tv_usec, 0 );
|
||||
}
|
||||
#endif /* LDAP_DEBUG */
|
||||
|
||||
@ -246,7 +246,7 @@ wait4msg( LDAP *ld, int msgid, int all, struct timeval *timeout,
|
||||
}
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "wait4msg: %ld secs to go\n",
|
||||
tv.tv_sec, 0, 0 );
|
||||
(long) tv.tv_sec, 0, 0 );
|
||||
start_time = tmp_time;
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ lutil_passwd(
|
||||
|
||||
ldap_MD5Init(&MD5context);
|
||||
ldap_MD5Update(&MD5context,
|
||||
cred, strlen(cred));
|
||||
(const unsigned char *)cred, strlen(cred));
|
||||
ldap_MD5Final(MD5digest, &MD5context);
|
||||
|
||||
if ( b64_ntop(MD5digest, sizeof(MD5digest),
|
||||
@ -63,7 +63,7 @@ lutil_passwd(
|
||||
|
||||
ldap_SHA1Init(&SHA1context);
|
||||
ldap_SHA1Update(&SHA1context,
|
||||
(unsigned char *) cred, strlen(cred));
|
||||
(const unsigned char *) cred, strlen(cred));
|
||||
ldap_SHA1Final(SHA1digest, &SHA1context);
|
||||
|
||||
if (b64_ntop(SHA1digest, sizeof(SHA1digest),
|
||||
|
@ -6,13 +6,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <ac/string.h>
|
||||
|
||||
#if defined( HAVE_STDARG_H ) && __STDC__
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
#include <ac/setproctitle.h>
|
||||
#include <ac/string.h>
|
||||
#include <ac/stdarg.h>
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990,1991 Regents of the University of Michigan.
|
||||
@ -36,7 +32,7 @@ int Argc; /* original argc */
|
||||
|
||||
/* VARARGS */
|
||||
void setproctitle
|
||||
#if defined( HAVE_STDARG_H ) && __STDC__
|
||||
#if defined( HAVE_STDARG )
|
||||
( const char *fmt, ... )
|
||||
#else
|
||||
( fmt, va_alist )
|
||||
@ -50,7 +46,7 @@ va_dcl
|
||||
char buf[ 1024 ];
|
||||
va_list ap;
|
||||
|
||||
#if defined( HAVE_STDARG_H ) && __STDC__
|
||||
#if defined( HAVE_STDARG )
|
||||
va_start(ap, fmt);
|
||||
#else
|
||||
va_start(ap);
|
||||
|
@ -72,8 +72,8 @@ access_allowed(
|
||||
|
||||
if (a) {
|
||||
for (i = 0; i < MAXREMATCHES && matches[i].rm_so > 0; i++) {
|
||||
Debug( LDAP_DEBUG_ARGS, "=> match[%d]: %d %d ",
|
||||
i, matches[i].rm_so, matches[i].rm_eo );
|
||||
Debug( LDAP_DEBUG_ARGS, "=> match[%d]: %d %d ", i,
|
||||
(int)matches[i].rm_so, (int)matches[i].rm_eo );
|
||||
|
||||
if( matches[i].rm_so <= matches[0].rm_eo ) {
|
||||
for ( n = matches[i].rm_so; n < matches[i].rm_eo; n++) {
|
||||
@ -129,7 +129,7 @@ acl_get_applicable(
|
||||
for ( i = 1, a = be->be_acl; a != NULL; a = a->acl_next, i++ ) {
|
||||
if (a->acl_dnpat != NULL) {
|
||||
Debug( LDAP_DEBUG_TRACE, "=> dnpat: [%d] %s nsub: %d\n",
|
||||
i, a->acl_dnpat, a->acl_dnre.re_nsub);
|
||||
i, a->acl_dnpat, (int) a->acl_dnre.re_nsub);
|
||||
|
||||
if (regexec(&a->acl_dnre, edn, nmatch, matches, 0))
|
||||
continue;
|
||||
@ -160,7 +160,7 @@ acl_get_applicable(
|
||||
for ( i = 1, a = global_acl; a != NULL; a = a->acl_next, i++ ) {
|
||||
if (a->acl_dnpat != NULL) {
|
||||
Debug( LDAP_DEBUG_TRACE, "=> dnpat: [%d] %s nsub: %d\n",
|
||||
i, a->acl_dnpat, a->acl_dnre.re_nsub);
|
||||
i, a->acl_dnpat, (int) a->acl_dnre.re_nsub);
|
||||
|
||||
if (regexec(&a->acl_dnre, edn, nmatch, matches, 0)) {
|
||||
continue;
|
||||
@ -478,7 +478,7 @@ string_expand(
|
||||
newbuf[0] = '\0';
|
||||
|
||||
flag = 0;
|
||||
for ( dp = newbuf, sp = pat; size < 512 && *sp ; sp++) {
|
||||
for ( dp = newbuf, sp = pat; size < bufsiz && *sp ; sp++) {
|
||||
/* did we previously see a $ */
|
||||
if (flag) {
|
||||
if (*sp == '$') {
|
||||
|
@ -82,7 +82,6 @@ ldbm_back_add(
|
||||
if ( (pdn = dn_parent( be, dn )) != NULL ) {
|
||||
char *matched;
|
||||
/* no parent */
|
||||
matched = NULL;
|
||||
|
||||
/* get entry with reader lock */
|
||||
if ( (p = dn2entry_r( be, pdn, &matched )) == NULL ) {
|
||||
@ -90,6 +89,7 @@ ldbm_back_add(
|
||||
0, 0 );
|
||||
send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT,
|
||||
matched, "" );
|
||||
|
||||
if ( matched != NULL ) {
|
||||
free( matched );
|
||||
}
|
||||
@ -97,9 +97,6 @@ ldbm_back_add(
|
||||
rc = -1;
|
||||
goto return_results;
|
||||
}
|
||||
if ( matched != NULL ) {
|
||||
free( matched );
|
||||
}
|
||||
|
||||
if ( ! access_allowed( be, conn, op, p, "children", NULL,
|
||||
op->o_dn, ACL_WRITE ) ) {
|
||||
|
@ -113,7 +113,7 @@ char *derefDN ( Backend *be,
|
||||
{
|
||||
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
|
||||
char *matched;
|
||||
char *newDN;
|
||||
char *newDN = NULL;
|
||||
int depth;
|
||||
Entry *eMatched;
|
||||
Entry *eDeref;
|
||||
@ -135,7 +135,7 @@ char *derefDN ( Backend *be,
|
||||
/* free reader lock */
|
||||
cache_return_entry_r(&li->li_cache, eMatched);
|
||||
|
||||
if (*matched) {
|
||||
if ((matched != NULL) && *matched) {
|
||||
char *submatch;
|
||||
|
||||
/*
|
||||
@ -155,7 +155,9 @@ char *derefDN ( Backend *be,
|
||||
|
||||
if ((eNew = derefAlias_r( be, conn, op, eMatched )) == NULL) {
|
||||
free (matched);
|
||||
matched = NULL;
|
||||
free (newDN);
|
||||
newDN = NULL;
|
||||
free (remainder);
|
||||
break; /* no associated entry, dont deref */
|
||||
}
|
||||
@ -166,7 +168,9 @@ char *derefDN ( Backend *be,
|
||||
if (!strcasecmp (matched, eNew->e_dn)) {
|
||||
/* newDN same as old so not an alias, no need to go further */
|
||||
free (newDN);
|
||||
newDN = NULL;
|
||||
free (matched);
|
||||
matched = NULL;
|
||||
free (remainder);
|
||||
break;
|
||||
}
|
||||
@ -176,13 +180,13 @@ char *derefDN ( Backend *be,
|
||||
* the new dn together
|
||||
*/
|
||||
free (newDN);
|
||||
free (matched);
|
||||
|
||||
newDN = ch_malloc (strlen(eMatched->e_dn) + rlen + 1);
|
||||
strcpy (newDN, remainder);
|
||||
strcat (newDN, eMatched->e_dn);
|
||||
Debug( LDAP_DEBUG_TRACE, "<= expanded to %s\n", newDN, 0, 0 );
|
||||
|
||||
free (matched);
|
||||
matched = NULL;
|
||||
free (remainder);
|
||||
|
||||
/* free reader lock */
|
||||
@ -226,10 +230,13 @@ char *derefDN ( Backend *be,
|
||||
send_ldap_result( conn, op, LDAP_ALIAS_PROBLEM, "",
|
||||
"Maximum alias dereference depth exceeded for base" );
|
||||
}
|
||||
|
||||
if (newDN == NULL) {
|
||||
newDN = strdup ( dn );
|
||||
}
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "<= returning deref DN of %s\n", newDN, 0, 0 );
|
||||
|
||||
free(matched);
|
||||
if (matched != NULL) free(matched);
|
||||
|
||||
return newDN;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ ldbm_back_bind(
|
||||
Entry *e;
|
||||
Attribute *a;
|
||||
int rc;
|
||||
char *matched = NULL;
|
||||
char *matched;
|
||||
#ifdef HAVE_KERBEROS
|
||||
char krbname[MAX_K_NAME_SZ + 1];
|
||||
AUTH_DAT ad;
|
||||
|
@ -29,6 +29,8 @@ ldbm_back_compare(
|
||||
/* get entry with reader lock */
|
||||
if ( (e = dn2entry_r( be, dn, &matched )) == NULL ) {
|
||||
send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT, matched, "" );
|
||||
|
||||
if(matched == NULL) free(matched);
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ ldbm_back_delete(
|
||||
)
|
||||
{
|
||||
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
|
||||
char *matched = NULL;
|
||||
char *matched;
|
||||
char *pdn = NULL;
|
||||
Entry *e, *p;
|
||||
|
||||
@ -66,7 +66,6 @@ ldbm_back_delete(
|
||||
|
||||
/* XXX delete from parent's id2children entry XXX */
|
||||
pdn = dn_parent( be, dn );
|
||||
matched = NULL;
|
||||
p = dn2entry_r( be, pdn, &matched );
|
||||
if ( id2children_remove( be, p, e ) != 0 ) {
|
||||
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, "","" );
|
||||
@ -93,9 +92,11 @@ ldbm_back_delete(
|
||||
|
||||
/* free entry and writer lock */
|
||||
cache_return_entry_w( &li->li_cache, e );
|
||||
if ( p )
|
||||
if ( p != NULL )
|
||||
cache_return_entry_r( &li->li_cache, p );
|
||||
|
||||
if ( matched != NULL ) free(matched);
|
||||
|
||||
send_ldap_result( conn, op, LDAP_SUCCESS, "", "" );
|
||||
|
||||
return( 0 );
|
||||
@ -104,8 +105,10 @@ error_return:;
|
||||
/* free entry and writer lock */
|
||||
cache_return_entry_w( &li->li_cache, e );
|
||||
|
||||
if( p )
|
||||
if( p != NULL )
|
||||
cache_return_entry_r( &li->li_cache, p );
|
||||
|
||||
if ( matched != NULL ) free(matched);
|
||||
|
||||
return( -1 );
|
||||
}
|
||||
|
@ -166,18 +166,19 @@ dn2entry(
|
||||
{
|
||||
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
|
||||
ID id;
|
||||
Entry *e;
|
||||
Entry *e = NULL;
|
||||
char *pdn;
|
||||
|
||||
Debug(LDAP_DEBUG_TRACE, "dn2entry_%s: dn: %s\n",
|
||||
rw ? "w" : "r", dn, 0);
|
||||
|
||||
*matched = NULL;
|
||||
|
||||
if ( (id = dn2id( be, dn )) != NOID &&
|
||||
(e = id2entry( be, id, rw )) != NULL )
|
||||
{
|
||||
return( e );
|
||||
}
|
||||
*matched = NULL;
|
||||
|
||||
/* stop when we get to the suffix */
|
||||
if ( be_issuffix( be, dn ) ) {
|
||||
@ -199,19 +200,6 @@ dn2entry(
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (e->e_state == ENTRY_STATE_DELETED)
|
||||
continue;
|
||||
|
||||
if (strcmp(dn, e->e_dn) != 0)
|
||||
continue;
|
||||
|
||||
/* return locked entry entry */
|
||||
return(e);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Entry *
|
||||
dn2entry_r(
|
||||
Backend *be,
|
||||
|
@ -45,7 +45,8 @@ ldbm_back_group(
|
||||
free(matched);
|
||||
return( 1 );
|
||||
}
|
||||
Debug( LDAP_DEBUG_ARGS, "=> ldbm_back_group: found bdn: %s matched: %s\n", bdn, (matched ? matched : ""), 0 );
|
||||
|
||||
Debug( LDAP_DEBUG_ARGS, "=> ldbm_back_group: found bdn: %s\n", bdn, 0, 0 );
|
||||
|
||||
/* check for deleted */
|
||||
|
||||
|
@ -25,7 +25,7 @@ ldbm_back_modify(
|
||||
)
|
||||
{
|
||||
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
|
||||
char *matched = NULL;
|
||||
char *matched;
|
||||
Entry *e;
|
||||
int i, err;
|
||||
LDAPMod *mod;
|
||||
|
@ -49,7 +49,7 @@ ldbm_back_search(
|
||||
ID id;
|
||||
Entry *e;
|
||||
Attribute *ref;
|
||||
char *matched = NULL;
|
||||
char *matched;
|
||||
int rmaxsize, nrefs;
|
||||
char *rbuf, *rcur, *r;
|
||||
int nentries = 0;
|
||||
|
@ -129,8 +129,8 @@ connection_activity(
|
||||
"ber_get_next on fd %d failed errno %d (%s)\n",
|
||||
conn->c_sb.sb_sd, errno, errno > -1 && errno < sys_nerr ?
|
||||
sys_errlist[errno] : "unknown" );
|
||||
Debug( LDAP_DEBUG_TRACE, "*** got %d of %lu so far\n",
|
||||
conn->c_currentber->ber_rwptr - conn->c_currentber->ber_buf,
|
||||
Debug( LDAP_DEBUG_TRACE, "*** got %ld of %lu so far\n",
|
||||
(long)(conn->c_currentber->ber_rwptr - conn->c_currentber->ber_buf),
|
||||
conn->c_currentber->ber_len, 0 );
|
||||
|
||||
if ( errno != EWOULDBLOCK && errno != EAGAIN ) {
|
||||
|
@ -44,7 +44,7 @@ replog(
|
||||
i++ ) {
|
||||
fprintf( fp, "replica: %s\n", be->be_replica[i] );
|
||||
}
|
||||
fprintf( fp, "time: %ld\n", currenttime );
|
||||
fprintf( fp, "time: %ld\n", (long) currenttime );
|
||||
fprintf( fp, "dn: %s\n", dn );
|
||||
|
||||
switch ( optype ) {
|
||||
|
@ -36,9 +36,10 @@ parse_oc(
|
||||
do {
|
||||
i++;
|
||||
if ( i < argc ) {
|
||||
char **s = str2charray( argv[i], "," );
|
||||
last = argv[i][strlen( argv[i] ) - 1];
|
||||
charray_merge( &oc->oc_required,
|
||||
str2charray( argv[i], "," ) );
|
||||
charray_merge( &oc->oc_required, s );
|
||||
charray_free( s );
|
||||
}
|
||||
} while ( i < argc && last == ',' );
|
||||
|
||||
@ -47,9 +48,11 @@ parse_oc(
|
||||
do {
|
||||
i++;
|
||||
if ( i < argc ) {
|
||||
char **s = str2charray( argv[i], "," );
|
||||
last = argv[i][strlen( argv[i] ) - 1];
|
||||
charray_merge( &oc->oc_allowed,
|
||||
str2charray( argv[i], "," ) );
|
||||
|
||||
charray_merge( &oc->oc_allowed, s );
|
||||
charray_free( s );
|
||||
}
|
||||
} while ( i < argc && last == ',' );
|
||||
|
||||
|
@ -270,6 +270,7 @@ main( int argc, char **argv )
|
||||
|
||||
data = ldbm_fetch( db->dbc_db,
|
||||
key );
|
||||
free( dn );
|
||||
if ( data.dptr == NULL ) {
|
||||
dn_normalize( val );
|
||||
if ( ! be_issuffix( be,
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ac/string.h>
|
||||
#include <unistd.h> /* get unlink() */
|
||||
#include <ac/unistd.h>
|
||||
|
||||
#include <ldbm.h>
|
||||
#include <lber.h>
|
||||
|
Loading…
Reference in New Issue
Block a user