Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • openldap/openldap
  • hyc/openldap
  • ryan/openldap
  • iboukris/openldap
  • ondra/openldap
  • sshanks-kx/openldap
  • blaggacao/openldap
  • pbrezina/openldap
  • quanah/openldap
  • dragos_h/openldap
  • lorenz/openldap
  • tsaarni/openldap
  • fei.ding/openldap
  • orent/openldap
  • arrowplum/openldap
  • barchiesi/openldap
  • jotik/openldap
  • hamano/openldap
  • ingovoss/openldap
  • henson/openldap
  • jlrine2/openldap
  • howeverAT/openldap
  • nivanova/openldap
  • orbea/openldap
  • rdubner/openldap
  • smckinney/openldap
  • jklowden/openldap
  • dpa-openldap/openldap
  • rouzier/openldap
  • orgads/openldap
  • ffontaine/openldap
  • jiaqingz/openldap
  • dcoutadeur/openldap
  • begeragus/openldap
  • pubellit/openldap
  • glandium/openldap
  • facboy/openldap
  • thesamesam/openldap
  • Johan/openldap
  • fkooman/openldap
  • gburd/openldap
  • h-homma/openldap
  • sgallagher/openldap
  • ahmed_zaki/openldap
  • gnoe/openldap
  • mid/openldap
  • clan/openldap
47 results
Show changes
Showing
with 25364 additions and 9511 deletions
......@@ -2,7 +2,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2004 The OpenLDAP Foundation.
* Copyright 1998-2005 The OpenLDAP Foundation.
* Portions Copyright 1998-2003 Kurt D. Zeilenga.
* Portions Copyright 1998-2001 Net Boolean Incorporated.
* Portions Copyright 2001-2003 IBM Corporation.
......@@ -196,7 +196,10 @@ main( int argc, char *argv[] )
if( oldpwfile ) {
rc = lutil_get_filed_password( oldpwfile, &oldpw );
if( rc ) return EXIT_FAILURE;
if( rc ) {
rc = EXIT_FAILURE;
goto done;
}
}
if( want_oldpw && oldpw.bv_val == NULL ) {
......@@ -209,7 +212,8 @@ main( int argc, char *argv[] )
strcmp( oldpw.bv_val, ckoldpw ))
{
fprintf( stderr, _("passwords do not match\n") );
return EXIT_FAILURE;
rc = EXIT_FAILURE;
goto done;
}
oldpw.bv_len = strlen( oldpw.bv_val );
......@@ -217,7 +221,10 @@ main( int argc, char *argv[] )
if( newpwfile ) {
rc = lutil_get_filed_password( newpwfile, &newpw );
if( rc ) return EXIT_FAILURE;
if( rc ) {
rc = EXIT_FAILURE;
goto done;
}
}
if( want_newpw && newpw.bv_val == NULL ) {
......@@ -230,7 +237,8 @@ main( int argc, char *argv[] )
strcmp( newpw.bv_val, cknewpw ))
{
fprintf( stderr, _("passwords do not match\n") );
return EXIT_FAILURE;
rc = EXIT_FAILURE;
goto done;
}
newpw.bv_len = strlen( newpw.bv_val );
......@@ -238,7 +246,10 @@ main( int argc, char *argv[] )
if ( pw_file ) {
rc = lutil_get_filed_password( pw_file, &passwd );
if( rc ) return EXIT_FAILURE;
if( rc ) {
rc = EXIT_FAILURE;
goto done;
}
} else if ( want_bindpw ) {
passwd.bv_val = getpassphrase( _("Enter LDAP Password: ") );
......@@ -259,8 +270,8 @@ main( int argc, char *argv[] )
if( ber == NULL ) {
perror( "ber_alloc_t" );
ldap_unbind_ext( ld, NULL, NULL );
return EXIT_FAILURE;
rc = EXIT_FAILURE;
goto done;
}
ber_printf( ber, "{" /*}*/ );
......@@ -289,14 +300,14 @@ main( int argc, char *argv[] )
if( rc < 0 ) {
perror( "ber_flatten2" );
ldap_unbind_ext( ld, NULL, NULL );
return EXIT_FAILURE;
rc = EXIT_FAILURE;
goto done;
}
}
if ( not ) {
rc = LDAP_SUCCESS;
goto skip;
goto done;
}
rc = ldap_extended_operation( ld,
......@@ -307,14 +318,29 @@ main( int argc, char *argv[] )
if( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_extended_operation" );
ldap_unbind_ext( ld, NULL, NULL );
return EXIT_FAILURE;
rc = EXIT_FAILURE;
goto done;
}
rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, NULL, &res );
if ( rc < 0 ) {
ldap_perror( ld, "ldappasswd: ldap_result" );
return rc;
for ( ; ; ) {
struct timeval tv;
if ( tool_check_abandon( ld, id ) ) {
return LDAP_CANCELLED;
}
tv.tv_sec = 0;
tv.tv_usec = 100000;
rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, &tv, &res );
if ( rc < 0 ) {
ldap_perror( ld, "ldappasswd: ldap_result" );
return rc;
}
if ( rc != 0 ) {
break;
}
}
rc = ldap_parse_result( ld, res,
......@@ -322,14 +348,16 @@ main( int argc, char *argv[] )
if( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_parse_result" );
return rc;
rc = EXIT_FAILURE;
goto done;
}
rc = ldap_parse_extended_result( ld, res, &retoid, &retdata, 1 );
if( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_parse_result" );
return rc;
rc = EXIT_FAILURE;
goto done;
}
if( retdata != NULL ) {
......@@ -339,8 +367,8 @@ main( int argc, char *argv[] )
if( ber == NULL ) {
perror( "ber_init" );
ldap_unbind_ext( ld, NULL, NULL );
return EXIT_FAILURE;
rc = EXIT_FAILURE;
goto done;
}
/* we should check the tag */
......@@ -381,9 +409,11 @@ main( int argc, char *argv[] )
ber_memfree( retoid );
ber_bvfree( retdata );
skip:
/* disconnect from server */
ldap_unbind_ext( ld, NULL, NULL );
rc = ( code == LDAP_SUCCESS ) ? EXIT_SUCCESS : EXIT_FAILURE;
return code == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
done:
/* disconnect from server */
tool_unbind( ld );
tool_destroy();
return rc;
}
......@@ -2,7 +2,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2004 The OpenLDAP Foundation.
* Copyright 1998-2005 The OpenLDAP Foundation.
* Portions Copyright 1998-2003 Kurt D. Zeilenga.
* Portions Copyright 1998-2001 Net Boolean Incorporated.
* Portions Copyright 2001-2003 IBM Corporation.
......@@ -48,6 +48,8 @@
#include <ac/errno.h>
#include <sys/stat.h>
#include <ac/signal.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
......@@ -230,7 +232,7 @@ urlize(char *url)
}
const char options[] = "a:Ab:E:F:l:Ls:S:tT:uz:"
const char options[] = "a:Ab:cE:F:l:Ls:S:tT:uz:"
"Cd:D:e:f:h:H:IkKMnO:p:P:QR:U:vVw:WxX:y:Y:Z";
int
......@@ -359,6 +361,7 @@ handle_private_option( int i )
domainScope = 1 + crit;
#endif
#ifdef LDAP_CONTROL_SUBENTRIES
} else if ( strcasecmp( control, "subentries" ) == 0 ) {
if( subentries ) {
......@@ -379,7 +382,7 @@ handle_private_option( int i )
if( crit ) subentries *= -1;
#endif
} else if ( strcasecmp( control, "sync" ) == 0 ) {
} else if ( strcasecmp( control, "sync" ) == 0 ) {
char *cookiep;
char *slimitp;
if ( ldapsync ) {
......@@ -550,7 +553,6 @@ private_conn_setup( LDAP *ld )
}
}
int
main( int argc, char **argv )
{
......@@ -664,31 +666,34 @@ getNextPage:
#ifdef LDAP_CONTROL_PAGEDRESULTS
|| pagedResults
#endif
#ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
|| chaining
#endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
|| ldapsync
|| subentries || valuesReturnFilter )
{
int err;
int i=0;
LDAPControl c[6];
LDAPControl c[10];
#ifdef LDAP_CONTROL_X_DOMAIN_SCOPE
if ( domainScope ) {
c[i].ldctl_oid = LDAP_CONTROL_X_DOMAIN_SCOPE;
c[i].ldctl_value.bv_val = NULL;
c[i].ldctl_value.bv_len = 0;
c[i].ldctl_iscritical = domainScope > 1;
i++;
}
if ( domainScope ) {
c[i].ldctl_oid = LDAP_CONTROL_X_DOMAIN_SCOPE;
c[i].ldctl_value.bv_val = NULL;
c[i].ldctl_value.bv_len = 0;
c[i].ldctl_iscritical = domainScope > 1;
i++;
}
#endif
#ifdef LDAP_CONTROL_SUBENTRIES
if ( subentries ) {
if (( seber = ber_alloc_t(LBER_USE_DER)) == NULL ) {
if (( seber = ber_alloc_t(LBER_USE_DER)) == NULL ) {
return EXIT_FAILURE;
}
err = ber_printf( seber, "b", abs(subentries) == 1 ? 0 : 1 );
if ( err == -1 ) {
if ( err == -1 ) {
ber_free( seber, 1 );
fprintf( stderr, _("Subentries control encoding error!\n") );
return EXIT_FAILURE;
......@@ -922,13 +927,8 @@ getNextPage:
}
#endif
ldap_unbind_ext( ld, NULL, NULL );
#ifdef HAVE_CYRUS_SASL
sasl_done();
#endif
#ifdef HAVE_TLS
ldap_pvt_tls_destroy();
#endif
tool_unbind( ld );
tool_destroy();
return( rc );
}
......@@ -1006,6 +1006,11 @@ static int dosearch(
sortattr ? LDAP_MSG_ALL : LDAP_MSG_ONE,
NULL, &res )) > 0 )
{
rc = tool_check_abandon( ld, msgid );
if ( rc ) {
return rc;
}
if( sortattr ) {
(void) ldap_sort_entries( ld, &res,
( *sortattr == '\0' ) ? NULL : sortattr, strcasecmp );
......@@ -1103,12 +1108,12 @@ static int dosearch(
ldap_msgfree( res );
}
done:
if ( rc == -1 ) {
ldap_perror( ld, "ldap_result" );
return( rc );
}
done:
ldap_msgfree( res );
#ifdef LDAP_CONTROL_PAGEDRESULTS
if ( pagedResults ) {
......
......@@ -2,7 +2,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2004 The OpenLDAP Foundation.
* Copyright 1998-2005 The OpenLDAP Foundation.
* Portions Copyright 1998-2003 Kurt D. Zeilenga.
* Portions Copyright 1998-2001 Net Boolean Incorporated.
* Portions Copyright 2001-2003 IBM Corporation.
......@@ -108,16 +108,18 @@ handle_private_option( int i )
int
main( int argc, char *argv[] )
{
int rc;
char *user = NULL;
int rc;
char *user = NULL;
LDAP *ld = NULL;
LDAP *ld = NULL;
char *matcheddn = NULL, *text = NULL, **refs = NULL;
char *retoid = NULL;
struct berval *retdata = NULL;
char *matcheddn = NULL, *text = NULL, **refs = NULL;
char *retoid = NULL;
struct berval *retdata = NULL;
int id, code;
LDAPMessage *res;
tool_init();
tool_init();
prog = lutil_progname( "ldapwhoami", argc, argv );
/* LDAPv3 only */
......@@ -156,7 +158,51 @@ main( int argc, char *argv[] )
tool_server_controls( ld, NULL, 0 );
}
rc = ldap_whoami_s( ld, &retdata, NULL, NULL );
rc = ldap_whoami( ld, NULL, NULL, &id );
if( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_extended_operation" );
rc = EXIT_FAILURE;
goto skip;
}
for ( ; ; ) {
struct timeval tv;
if ( tool_check_abandon( ld, id ) ) {
return LDAP_CANCELLED;
}
tv.tv_sec = 0;
tv.tv_usec = 100000;
rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, &tv, &res );
if ( rc < 0 ) {
ldap_perror( ld, "ldapwhoami: ldap_result" );
return rc;
}
if ( rc != 0 ) {
break;
}
}
rc = ldap_parse_result( ld, res,
&code, &matcheddn, &text, &refs, NULL, 0 );
if( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_parse_result" );
rc = EXIT_FAILURE;
goto skip;
}
rc = ldap_parse_extended_result( ld, res, &retoid, &retdata, 1 );
if( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_parse_result" );
rc = EXIT_FAILURE;
goto skip;
}
if( retdata != NULL ) {
if( retdata->bv_len == 0 ) {
......@@ -166,8 +212,8 @@ main( int argc, char *argv[] )
}
}
if( verbose || ( rc != LDAP_SUCCESS ) || matcheddn || text || refs ) {
printf( _("Result: %s (%d)\n"), ldap_err2string( rc ), rc );
if( verbose || ( code != LDAP_SUCCESS ) || matcheddn || text || refs ) {
printf( _("Result: %s (%d)\n"), ldap_err2string( code ), code );
if( text && *text ) {
printf( _("Additional info: %s\n"), text );
......@@ -193,7 +239,8 @@ main( int argc, char *argv[] )
skip:
/* disconnect from server */
ldap_unbind (ld);
tool_unbind( ld );
tool_destroy();
return rc == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
return code == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
}
This diff is collapsed.
dnl $OpenLDAP$
dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
dnl
dnl Copyright 1998-2004 The OpenLDAP Foundation.
dnl Copyright 1998-2005 The OpenLDAP Foundation.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
......@@ -23,7 +23,7 @@ define([AC_INIT_BINSH],
# This work is part of OpenLDAP Software <http://www.openldap.org/>.
#
# Copyright 1998-2004 The OpenLDAP Foundation.
# Copyright 1998-2005 The OpenLDAP Foundation.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
......@@ -34,7 +34,7 @@ define([AC_INIT_BINSH],
# top-level directory of the distribution or, alternatively, at
# <http://www.OpenLDAP.org/license.html>.
echo "Copyright 1998-2004 The OpenLDAP Foundation. All rights reserved."
echo "Copyright 1998-2005 The OpenLDAP Foundation. All rights reserved."
echo " Restrictions apply, see COPYRIGHT and LICENSE files."
])dnl
dnl ----------------------------------------------------------------
......@@ -214,7 +214,7 @@ OL_ARG_ENABLE(bdb,[ --enable-bdb enable Berkeley DB backend no|yes|mod],
OL_ARG_ENABLE(dnssrv,[ --enable-dnssrv enable dnssrv backend no|yes|mod],
no, [no yes mod])dnl
OL_ARG_ENABLE(hdb,[ --enable-hdb enable Hierarchical DB backend no|yes|mod],
no, [no yes mod])dnl
yes, [no yes mod])dnl
OL_ARG_ENABLE(ldap,[ --enable-ldap enable ldap backend no|yes|mod],
no, [no yes mod])dnl
OL_ARG_ENABLE(ldbm,[ --enable-ldbm enable ldbm backend no|yes|mod], no,
......@@ -242,20 +242,22 @@ OL_ARG_ENABLE(sql,[ --enable-sql enable sql backend no|yes|mod],
dnl ----------------------------------------------------------------
dnl SLAPD Overlay Options
Overlays="chain denyop dyngroup glue lastmod ppolicy proxycache rwm \
refint syncprov unique"
Overlays="accesslog denyop dyngroup dynlist glue lastmod ppolicy proxycache \
refint rwm syncprov translucent unique"
AC_ARG_WITH(xxslapoverlays,[
SLAPD Overlay Options:])
OL_ARG_ENABLE(overlays,[ --enable-overlays enable all available overlays no|yes|mod],
no, [no yes mod])dnl
OL_ARG_ENABLE(chain,[ --enable-chain LDAP Chain Response no|yes|mod],
OL_ARG_ENABLE(accesslog,[ --enable-accesslog In-Directory Access Logging overlay no|yes|mod],
no, [no yes mod])
OL_ARG_ENABLE(denyop,[ --enable-denyop Deny Operation overlay no|yes|mod],
no, [no yes mod])
OL_ARG_ENABLE(dyngroup,[ --enable-dyngroup Dynamic Group overlay no|yes|mod],
no, [no yes mod])
OL_ARG_ENABLE(dynlist,[ --enable-dynlist Dynamic List overlay no|yes|mod],
no, [no yes mod])
OL_ARG_ENABLE(glue,[ --enable-glue Backend Glue overlay no|yes|mod],
yes, [no yes mod])
OL_ARG_ENABLE(lastmod,[ --enable-lastmod Last Modification overlay no|yes|mod],
......@@ -268,8 +270,10 @@ OL_ARG_ENABLE(refint,[ --enable-refint Referential Integrity overlay no|yes
no, [no yes mod])
OL_ARG_ENABLE(rwm,[ --enable-rwm Rewrite/Remap overlay no|yes|mod],
no, [no yes mod])
OL_ARG_ENABLE(syncprov,[ --enable-syncprov Syncrepl Provider overlay no|yes|mod],
OL_ARG_ENABLE(syncprov,[ --enable-syncprov Syncrepl Provider overlay no|yes|mod],
yes, [no yes mod])
OL_ARG_ENABLE(translucent,[ --enable-translucent Translucent Proxy overlay no|yes|mod],
no, [no yes mod])
OL_ARG_ENABLE(unique,[ --enable-unique Attribute Uniqueness overlay no|yes|mod],
no, [no yes mod])
......@@ -446,10 +450,6 @@ else
fi
fi
if test $ol_enable_chain != no -a $ol_enable_ldap = no ; then
AC_MSG_ERROR([--enable-chain requires --enable-ldap])
fi
if test $ol_enable_meta = yes -a $ol_enable_ldap = no ; then
AC_MSG_ERROR([--enable-meta requires --enable-ldap])
fi
......@@ -524,9 +524,10 @@ BUILD_RELAY=no
BUILD_SHELL=no
BUILD_SQL=no
BUILD_CHAIN=no
BUILD_ACCESSLOG=no
BUILD_DENYOP=no
BUILD_DYNGROUP=no
BUILD_DYNLIST=no
BUILD_GLUE=no
BUILD_LASTMOD=no
BUILD_PPOLICY=no
......@@ -534,14 +535,16 @@ BUILD_PROXYCACHE=no
BUILD_REFINT=no
BUILD_RWM=no
BUILD_SYNCPROV=no
BUILD_TRANSLUCENT=no
BUILD_UNIQUE=no
SLAPD_STATIC_OVERLAYS=
SLAPD_DYNAMIC_OVERLAYS=
SLAPD_MODULES_LDFLAGS=
SLAPD_MODULES_CPPFLAGS=
SLAPD_STATIC_BACKENDS=
SLAPD_STATIC_BACKENDS=back-ldif
SLAPD_DYNAMIC_BACKENDS=
SLAPD_PERL_LDFLAGS=
......@@ -819,18 +822,23 @@ AC_CHECK_HEADERS( \
winsock2.h \
)
dnl ----------------------------------------------------------------
dnl Checks for libraries
AC_CHECK_FUNCS( sigaction sigset )
dnl HP-UX requires -lV3
dnl this is not needed on newer versions of HP-UX
AC_CHECK_LIB(V3, sigset)
if test $ac_cv_func_sigaction = no && test $ac_cv_func_sigaction = no ; then
AC_CHECK_LIB(V3, sigset)
fi
dnl The following is INTENTIONALLY scripted out because shell does not
dnl support variable names with the '@' character, which is what
dnl autoconf would try to generate if one merely used AC_SEARCH_LIBS
if test "$ac_cv_header_winsock_h" = yes; then
dnl
dnl Skip Winsock tests on Cygwin
if test "$ac_cv_cygwin" != yes && test "$ac_cv_header_winsock_h" = yes; then
AC_CACHE_CHECK([for winsock], [ol_cv_winsock],
save_LIBS="$LIBS"
for curlib in ws2_32 wsock32; do
......@@ -968,51 +976,28 @@ fi
dnl ----------------------------------------------------------------
dnl Check for resolver routines
dnl need to check for both res_query and __res_query
dnl need to check -lc, -lbind, and -lresolv
ol_link_dnssrv=no
AC_CHECK_FUNC(res_query,:)
if test $ac_cv_func_res_query = no ; then
AC_CHECK_FUNC(__res_query,:)
ac_cv_func_res_query=$ac_cv_func___res_query
fi
if test $ac_cv_func_res_query = no ; then
AC_CHECK_LIB(bind, res_query)
ac_cv_func_res_query=$ac_cv_lib_bind_res_query
fi
if test $ac_cv_func_res_query = no ; then
AC_CHECK_LIB(bind, __res_query)
ac_cv_func_res_query=$ac_cv_lib_bind___res_query
fi
if test $ac_cv_func_res_query = no ; then
AC_CHECK_LIB(resolv, res_query)
ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
fi
if test $ac_cv_func_res_query = no ; then
AC_CHECK_LIB(resolv, __res_query)
ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
fi
OL_RESOLVER_LINK
if test $ac_cv_func_res_query = no ; then
AC_CHECK_LIB(resolv, _res_9_query)
ac_cv_func_res_query=$ac_cv_lib_resolv_res_9_query
fi
if test "$ac_cv_func_res_query" = yes ; then
ol_link_dnssrv=no
if test "$ol_cv_lib_resolver" != no ; then
AC_DEFINE(HAVE_RES_QUERY,1,
[define if you have res_query()])
if test $ol_enable_dnssrv != no ; then
if test "$ol_enable_dnssrv" != no ; then
ol_link_dnssrv=yes
fi
if test "$ol_cv_lib_resolver" != yes ; then
LIBS="$ol_cv_lib_resolver $LIBS"
fi
fi
if test "$ol_enable_dnssrv" != no -a "$ol_link_dnssrv" = no ; then
AC_MSG_ERROR([DNSSRV requires res_query()])
if test "$ol_enable_dnssrv" = yes -o "$ol_enable_dnssrv" = mod ; then
if test "$ol_link_dnssrv" = no ; then
AC_MSG_ERROR([DNSSRV requires res_query()])
fi
else
ol_enable_dnssrv=no
fi
AC_CHECK_FUNCS( hstrerror )
......@@ -2094,6 +2079,9 @@ if test $ol_enable_sql != no ; then
AC_MSG_ERROR([could not locate SQL headers])
])
sql_LIBS="$LIBS"
LIBS="$LTHREAD_LIBS"
AC_CHECK_LIB(iodbc,SQLDriverConnect,[have_iodbc=yes],[have_iodbc=no])
if test $have_iodbc = yes ; then
ol_link_sql="-liodbc"
......@@ -2104,6 +2092,8 @@ if test $ol_enable_sql != no ; then
fi
fi
LIBS="$sql_LIBS"
if test $ol_link_sql != no ; then
SLAPD_SQL_LIBS="$ol_link_sql"
......@@ -2425,6 +2415,12 @@ AC_DEFINE(LBER_TAG_T,long)
dnl ----------------------------------------------------------------
dnl Checks for library functions.
AC_FUNC_MEMCMP
if test $ac_cv_func_memcmp_clean = no ; then
AC_DEFINE(NEED_MEMCMP_REPLACEMENT,1,
[define if memcmp is not 8-bit clean or is otherwise broken])
fi
dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
AC_FUNC_STRFTIME
dnl AM_FUNC_STRTOD
......@@ -2483,9 +2479,7 @@ AC_CHECK_FUNCS( \
setsid \
setuid \
seteuid \
sigaction \
signal \
sigset \
strdup \
strpbrk \
strrchr \
......@@ -2515,6 +2509,9 @@ if test "$ac_cv_func_getopt" != yes; then
fi
if test "$ac_cv_func_getpeereid" != yes; then
OL_MSGHDR_MSG_ACCRIGHTS
if test "$ac_cv_func_getpeereid" != yes; then
OL_MSGHDR_MSG_CONTROL
fi
LIBSRCS="$LIBSRCS getpeereid.c"
fi
if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
......@@ -2772,15 +2769,16 @@ if test "$ol_link_sql" != no ; then
AC_DEFINE_UNQUOTED(SLAPD_SQL,$MFLAG,[define to support SQL backend])
fi
if test "$ol_enable_chain" != no ; then
BUILD_CHAIN=$ol_enable_chain
if test "$ol_enable_chain" = mod ; then
if test "$ol_enable_accesslog" != no ; then
BUILD_ACCESSLOG=$ol_enable_accesslog
if test "$ol_enable_accesslog" = mod ; then
MFLAG=SLAPD_MOD_DYNAMIC
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS chain.la"
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS accesslog.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS accesslog.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_CHAIN,$MFLAG,[define for Dynamic Group overlay])
AC_DEFINE_UNQUOTED(SLAPD_OVER_ACCESSLOG,$MFLAG,[define for In-Directory Access Logging overlay])
fi
if test "$ol_enable_denyop" != no ; then
......@@ -2790,6 +2788,7 @@ if test "$ol_enable_denyop" != no ; then
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS denyop.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS denyop.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_DENYOP,$MFLAG,[define for Dynamic Group overlay])
fi
......@@ -2801,10 +2800,23 @@ if test "$ol_enable_dyngroup" != no ; then
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dyngroup.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dyngroup.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNGROUP,$MFLAG,[define for Dynamic Group overlay])
fi
if test "$ol_enable_dynlist" != no ; then
BUILD_DYNLIST=$ol_enable_dynlist
if test "$ol_enable_dynlist" = mod ; then
MFLAG=SLAPD_MOD_DYNAMIC
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dynlist.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dynlist.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNLIST,$MFLAG,[define for Dynamic List overlay])
fi
if test "$ol_enable_glue" != no ; then
BUILD_GLUE=$ol_enable_glue
if test "$ol_enable_glue" = mod ; then
......@@ -2812,6 +2824,7 @@ if test "$ol_enable_glue" != no ; then
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS glue.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS glue.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_GLUE,$MFLAG,[define for Backend Glue overlay])
fi
......@@ -2823,6 +2836,7 @@ if test "$ol_enable_lastmod" != no ; then
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS lastmod.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS lastmod.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_LASTMOD,$MFLAG,[define for Last Modification overlay])
fi
......@@ -2834,6 +2848,7 @@ if test "$ol_enable_ppolicy" != no ; then
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS ppolicy.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS ppolicy.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_PPOLICY,$MFLAG,[define for Password Policy overlay])
fi
......@@ -2845,6 +2860,7 @@ if test "$ol_enable_proxycache" != no ; then
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS pcache.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS pcache.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_PROXYCACHE,$MFLAG,[define for Proxy Cache overlay])
fi
......@@ -2856,6 +2872,7 @@ if test "$ol_enable_refint" != no ; then
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS refint.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS refint.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_REFINT,$MFLAG,[define for Referential Integrity overlay])
fi
......@@ -2868,6 +2885,7 @@ if test "$ol_enable_rwm" != no ; then
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS rwm.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS rwm_x.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_RWM,$MFLAG,[define for Rewrite/Remap overlay])
fi
......@@ -2879,10 +2897,23 @@ if test "$ol_enable_syncprov" != no ; then
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS syncprov.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS syncprov.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_SYNCPROV,$MFLAG,[define for Syncrepl Provider overlay])
fi
if test "$ol_enable_translucent" != no ; then
BUILD_TRANSLUCENT=$ol_enable_translucent
if test "$ol_enable_translucent" = mod ; then
MFLAG=SLAPD_MOD_DYNAMIC
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS translucent.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS translucent.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_TRANSLUCENT,$MFLAG,[define for Translucent Proxy overlay])
fi
if test "$ol_enable_unique" != no ; then
BUILD_UNIQUE=$ol_enable_unique
if test "$ol_enable_unique" = mod ; then
......@@ -2890,6 +2921,7 @@ if test "$ol_enable_unique" != no ; then
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS unique.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS unique.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_UNIQUE,$MFLAG,[define for Attribute Uniqueness overlay])
fi
......@@ -2924,62 +2956,6 @@ else
PLAT=UNIX
fi
if test -z "$SLAPD_STATIC_BACKENDS"; then
SLAPD_NO_STATIC='#'
else
SLAPD_NO_STATIC=
fi
dnl Generate static backend header file
BACKEND_HEADER=servers/slapd/backend.h
cat > $BACKEND_HEADER << EOF
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2004 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in the file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
/* This file is automatically generated by configure; please do not edit.
*/
EOF
for b in $SLAPD_STATIC_BACKENDS; do
bb=`echo "$b" | sed -e 's;back-;;'`
cat >> $BACKEND_HEADER << EOF
extern BI_init ${bb}_back_initialize;
EOF
done
cat >> $BACKEND_HEADER << EOF
static BackendInfo binfo[[]] = {
EOF
for b in $SLAPD_STATIC_BACKENDS; do
bb=`echo "$b" | sed -e 's;back-;;'`
cat >> $BACKEND_HEADER << EOF
{ "$bb", ${bb}_back_initialize },
EOF
done
cat >> $BACKEND_HEADER << EOF
{ NULL, NULL }
};
/* end of generated file */
EOF
dnl done generating static backend header file
AC_SUBST(LIBSRCS)
AC_SUBST(PLAT)
AC_SUBST(WITH_SASL)
......@@ -3006,9 +2982,10 @@ dnl backends
AC_SUBST(BUILD_SHELL)
AC_SUBST(BUILD_SQL)
dnl overlays
AC_SUBST(BUILD_CHAIN)
AC_SUBST(BUILD_ACCESSLOG)
AC_SUBST(BUILD_DENYOP)
AC_SUBST(BUILD_DYNGROUP)
AC_SUBST(BUILD_DYNLIST)
AC_SUBST(BUILD_GLUE)
AC_SUBST(BUILD_LASTMOD)
AC_SUBST(BUILD_PPOLICY)
......@@ -3016,6 +2993,7 @@ dnl overlays
AC_SUBST(BUILD_REFINT)
AC_SUBST(BUILD_RWM)
AC_SUBST(BUILD_SYNCPROV)
AC_SUBST(BUILD_TRANSLUCENT)
AC_SUBST(BUILD_UNIQUE)
AC_SUBST(BUILD_SLURPD)
......@@ -3033,6 +3011,7 @@ AC_SUBST(SLAPD_MODULES_LDFLAGS)
AC_SUBST(SLAPD_NO_STATIC)
AC_SUBST(SLAPD_STATIC_BACKENDS)
AC_SUBST(SLAPD_DYNAMIC_BACKENDS)
AC_SUBST(SLAPD_STATIC_OVERLAYS)
AC_SUBST(SLAPD_DYNAMIC_OVERLAYS)
AC_SUBST(PERL_CPPFLAGS)
......@@ -3082,7 +3061,7 @@ libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.
libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk \
libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk \
libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk \
libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-shared.mk \
servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
......@@ -3090,6 +3069,7 @@ servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefi
servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/Makefile.in:build/mod.mk \
servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
servers/slapd/back-ldif/Makefile:build/top.mk:servers/slapd/back-ldif/Makefile.in:build/mod.mk \
servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
......@@ -3108,5 +3088,57 @@ tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
,[
chmod +x tests/run
date > stamp-h
BACKENDSC="servers/slapd/backends.c"
echo "Making $BACKENDSC"
rm -f $BACKENDSC
cat > $BACKENDSC << ENDX
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in the file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
/* This file is automatically generated by configure; please do not edit. */
#include "portable.h"
#include "slap.h"
ENDX
if test "${STATIC_BACKENDS}"; then
for b in config ${STATIC_BACKENDS}; do
bb=`echo "${b}" | sed -e 's/back-//'`
cat >> $BACKENDSC << ENDX
extern BI_init ${bb}_back_initialize;
ENDX
done
cat >> $BACKENDSC << ENDX
BackendInfo slap_binfo[[]] = {
ENDX
for b in config ${STATIC_BACKENDS}; do
bb=`echo "${b}" | sed -e 's/back-//'`
echo " Add ${bb} ..."
cat >> $BACKENDSC << ENDX
{ "${bb}", ${bb}_back_initialize },
ENDX
done
cat >> $BACKENDSC << ENDX
{ NULL, NULL },
};
/* end of generated file */
ENDX
fi
echo Please run \"make depend\" to build dependencies
])
],[STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"])
......@@ -11,14 +11,6 @@ Current contributions:
LDAP C++ API
Contributed by SuSE Gmbh.
ldapsasl
LDAP SASL auxprop plugin
Contributed by Symas Corp.
ldaptcl
LDAP TCL API
Contributed by NeoSoft
slapd-modules
Native modules
......
Copyright 1998-2004 The OpenLDAP Foundation
Copyright 1998-2005 The OpenLDAP Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
......
# Makefile.in generated by automake 1.7.2 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -16,7 +16,6 @@
# Copyright 2000-2003, OpenLDAP Foundation, All Rights Reserved.
# COPYING RESTRICTIONS APPLY, see COPYRIGHT file
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
......@@ -24,7 +23,6 @@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
......@@ -38,11 +36,49 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS TODO \
acconfig.h config.guess config.sub depcomp install-sh \
ltmain.sh missing mkinstalldirs
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
......@@ -53,6 +89,7 @@ CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
......@@ -64,6 +101,8 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
......@@ -88,8 +127,10 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
......@@ -97,7 +138,10 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
......@@ -118,6 +162,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
......@@ -125,43 +170,43 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
EXTRA_DIST = BUGS
SUBDIRS = src examples
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
ps-recursive install-info-recursive uninstall-info-recursive \
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive
DIST_COMMON = README AUTHORS Makefile.am Makefile.in TODO acconfig.h \
aclocal.m4 config.guess config.sub configure configure.in \
depcomp install-sh ltmain.sh missing mkinstalldirs
DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive
.SUFFIXES:
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): configure.in
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
mostlyclean-libtool:
......@@ -181,7 +226,13 @@ uninstall-info-am:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
......@@ -193,7 +244,7 @@ $(RECURSIVE_TARGETS):
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
......@@ -201,7 +252,13 @@ $(RECURSIVE_TARGETS):
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
......@@ -222,7 +279,7 @@ maintainer-clean-recursive:
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
......@@ -233,14 +290,6 @@ ctags-recursive:
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ETAGS = etags
ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
......@@ -249,14 +298,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
......@@ -265,10 +323,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
......@@ -291,19 +350,6 @@ GTAGS:
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .
distdir = $(PACKAGE)-$(VERSION)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
distdir: $(DISTFILES)
$(am__remove_distdir)
......@@ -319,7 +365,7 @@ distdir: $(DISTFILES)
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
......@@ -334,15 +380,17 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
list='$(SUBDIRS)'; for subdir in $$list; do \
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" \
distdir=../$(distdir)/$$subdir \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
......@@ -353,26 +401,53 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
$(am__remove_distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/=build \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
......@@ -385,21 +460,22 @@ distcheck: dist
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
&& rm -f $(distdir).tar.gz \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x'
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
cd $(distuninstallcheck_dir) \
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
......@@ -408,11 +484,11 @@ distuninstallcheck:
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
if test '$(srcdir)' = . ; then \
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
......@@ -421,7 +497,6 @@ check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
......@@ -433,7 +508,7 @@ install-am: all-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
......@@ -441,7 +516,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
......@@ -452,6 +527,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
......@@ -459,6 +535,8 @@ dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
......@@ -475,7 +553,8 @@ installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf autom4te.cache
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
......@@ -494,23 +573,20 @@ uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
clean-generic clean-libtool clean-recursive ctags \
ctags-recursive dist dist-all dist-gzip distcheck distclean \
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-generic clean-libtool clean-recursive \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-libtool distclean-recursive \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am dvi-recursive info info-am info-recursive install \
install-am install-data install-data-am install-data-recursive \
install-exec install-exec-am install-exec-recursive \
install-info install-info-am install-info-recursive install-man \
install-recursive install-strip installcheck installcheck-am \
installdirs installdirs-am installdirs-recursive \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-libtool mostlyclean-recursive pdf pdf-am \
pdf-recursive ps ps-am ps-recursive tags tags-recursive \
uninstall uninstall-am uninstall-info-am \
uninstall-info-recursive uninstall-recursive
mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,10 @@
# Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
# COPYING RESTRICTIONS APPLY, see COPYRIGHT file
##
noinst_PROGRAMS = main
noinst_PROGRAMS = main readSchema
main_SOURCES = main.cpp
main_LDADD = ../src/libldapcpp.la
readSchema_SOURCES = readSchema.cpp
readSchema_LDADD = ../src/libldapcpp.la
This diff is collapsed.
#include<iostream.h>
#include<strstream>
#include "LDAPConnection.h"
#include "LDAPConstraints.h"
#include "LDAPSearchReference.h"
#include "LDAPSearchResults.h"
#include "LDAPAttribute.h"
#include "LDAPAttributeList.h"
#include "LDAPEntry.h"
#include "LDAPException.h"
#include "LDAPModification.h"
#include "LDAPReferralException.h"
#include "LDAPSchema.h"
#include"debug.h"
int main(){
LDAPConnection *lc=new LDAPConnection("192.168.3.128",389);
cout << "----------------------doing bind...." << endl;
try{
lc->bind("uid=admin,dc=home,dc=local" , "secret");
cout << lc->getHost() << endl;
StringList tmp;
tmp.add("subschemasubentry");
LDAPSearchResults* entries = lc->search("",
LDAPConnection::SEARCH_BASE,
"(objectClass=*)",
tmp );
LDAPEntry* rootDse = entries->getNext();
std::string schemabase="cn=subschema";
if(rootDse){
const LDAPAttribute* schemaAttr = rootDse->getAttributes()->getAttributeByName("subschemaSubentry");
schemabase = *(schemaAttr->getValues().begin());
}
StringList attrs;
attrs.add("objectClasses");
attrs.add("attributeTypes");
entries = lc->search(schemabase, LDAPConnection::SEARCH_BASE, "(objectClass=*)",
attrs);
if (entries != 0){
LDAPEntry* entry = entries->getNext();
if(entry != 0){
const LDAPAttribute* oc = entry->getAttributes()->getAttributeByName("objectClasses");
LDAPSchema schema;
schema.setObjectClasses((oc->getValues()));
LDAPObjClass test = schema.getObjectClassByName("inetOrgPerson");
cout << test.getDesc() << endl;
// StringList mustAttr = test.getMay();
// for( StringList::const_iterator i = mustAttr.begin(); i != mustAttr.end(); i++ ){
// cout << *i << endl;
// }
StringList sup = test.getSup();
for( StringList::const_iterator i = sup.begin(); i != sup.end(); i++ ){
cout << *i << endl;
}
}
}
lc->unbind();
delete lc;
}catch (LDAPException e){
cout << "------------------------- caught Exception ---------"<< endl;
cout << e << endl;
}
}
This diff is collapsed.
......@@ -56,8 +56,11 @@ void LDAPAsynConnection::init(const string& hostname, int port){
ldap_set_option(cur_session, LDAP_OPT_PROTOCOL_VERSION, &opt);
}
int LDAPAsynConnection::start_tls(){
return ldap_start_tls_s( cur_session, NULL, NULL );
void LDAPAsynConnection::start_tls(){
int resCode;
if( ldap_start_tls_s( cur_session, NULL, NULL ) != LDAP_SUCCESS ) {
throw LDAPException(this);
}
}
LDAPMessageQueue* LDAPAsynConnection::bind(const string& dn,
......
......@@ -92,10 +92,11 @@ class LDAPAsynConnection{
/**
* Start TLS on this connection. This isn't in the constructor,
* because it could fail (i.e. server doesn't have SSL cert, client
* api wasn't compiled against OpenSSL, etc.). If you need TLS,
* then you should error if this call fails with an error code.
* api wasn't compiled against OpenSSL, etc.).
* @throws LDAPException if the TLS Layer could not be setup
* correctly
*/
int start_tls();
void start_tls();
/** Simple authentication to a LDAP-Server
*
......
......@@ -13,8 +13,6 @@ LDAPAttrType::LDAPAttrType(){
oid = string ();
desc = string ();
equality = string ();
syntax = string ();
names = StringList ();
single = false;
}
......@@ -25,8 +23,6 @@ LDAPAttrType::LDAPAttrType (const LDAPAttrType &at){
oid = at.oid;
desc = at.desc;
equality = at.equality;
syntax = at.syntax;
names = at.names;
single = at.single;
}
......@@ -44,8 +40,6 @@ LDAPAttrType::LDAPAttrType (string at_item) {
if (a) {
this->setNames (a->at_names);
this->setDesc (a->at_desc);
this->setEquality (a->at_equality_oid);
this->setSyntax (a->at_syntax_oid);
this->setOid (a->at_oid);
this->setSingle (a->at_single_value);
}
......@@ -70,20 +64,6 @@ void LDAPAttrType::setDesc (char *at_desc) {
desc = at_desc;
}
void LDAPAttrType::setEquality (char *at_equality_oid) {
equality = string ();
if (at_equality_oid) {
equality = at_equality_oid;
}
}
void LDAPAttrType::setSyntax (char *at_syntax_oid) {
syntax = string ();
if (at_syntax_oid) {
syntax = at_syntax_oid;
}
}
void LDAPAttrType::setOid (char *at_oid) {
oid = string ();
if (at_oid)
......@@ -102,14 +82,6 @@ string LDAPAttrType::getDesc () {
return desc;
}
string LDAPAttrType::getEquality () {
return equality;
}
string LDAPAttrType::getSyntax () {
return syntax;
}
StringList LDAPAttrType::getNames () {
return names;
}
......
......@@ -22,7 +22,7 @@ using namespace std;
class LDAPAttrType{
private :
StringList names;
string desc, oid, equality, syntax;
string desc, oid;
bool single;
public :
......@@ -63,16 +63,6 @@ class LDAPAttrType{
*/
string getOid ();
/**
* Returns equality matching rule
*/
string getEquality ();
/**
* Returns attribute syntax definition
*/
string getSyntax ();
/**
* Returns attribute name (first one if there are more of them)
*/
......@@ -84,14 +74,12 @@ class LDAPAttrType{
StringList getNames();
/**
* Returns true if attribute type allows only single value
* Returns true if attribute type hllows only single value
*/
bool isSingle();
void setNames (char **at_names);
void setDesc (char *at_desc);
void setEquality (char *at_equality_oid);
void setSyntax (char *at_syntax_oid);
void setOid (char *at_oid);
void setSingle (int at_single_value);
......