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 13358 additions and 13752 deletions
......@@ -2,7 +2,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2008 The OpenLDAP Foundation.
* Copyright 1998-2009 The OpenLDAP Foundation.
* Portions Copyright 1998-2003 Kurt D. Zeilenga.
* Portions Copyright 1998-2001 Net Boolean Incorporated.
* Portions Copyright 2001-2003 IBM Corporation.
......@@ -126,11 +126,16 @@ usage( void )
fprintf( stderr, _(" -E [!]<ext>[=<extparam>] search extensions (! indicates criticality)\n"));
fprintf( stderr, _(" [!]domainScope (domain scope)\n"));
fprintf( stderr, _(" !dontUseCopy (Don't Use Copy)\n"));
fprintf( stderr, _(" [!]mv=<filter> (matched values filter)\n"));
fprintf( stderr, _(" [!]pr=<size>[/prompt|noprompt] (paged results/prompt)\n"));
fprintf( stderr, _(" [!]subentries[=true|false] (subentries)\n"));
fprintf( stderr, _(" [!]sync=ro[/<cookie>] (LDAP Sync refreshOnly)\n"));
fprintf( stderr, _(" rp[/<cookie>][/<slimit>] (LDAP Sync refreshAndPersist)\n"));
fprintf( stderr, _(" [!]mv=<filter> (RFC 3876 matched values filter)\n"));
fprintf( stderr, _(" [!]pr=<size>[/prompt|noprompt] (RFC 2696 paged results/prompt)\n"));
fprintf( stderr, _(" [!]sss=[-]<attr[:OID]>[/[-]<attr[:OID]>...]\n"));
fprintf( stderr, _(" (RFC 2891 server side sorting)\n"));
fprintf( stderr, _(" [!]subentries[=true|false] (RFC 3672 subentries)\n"));
fprintf( stderr, _(" [!]sync=ro[/<cookie>] (RFC 4533 LDAP Sync refreshOnly)\n"));
fprintf( stderr, _(" rp[/<cookie>][/<slimit>] (refreshAndPersist)\n"));
#ifdef LDAP_CONTROL_X_DEREF
fprintf( stderr, _(" [!]deref=derefAttr:attr[,...][;derefAttr:attr[,...][;...]]\n"));
#endif
fprintf( stderr, _(" [!]<oid>=:<value> (generic control; no response handling)\n"));
fprintf( stderr, _(" -F prefix URL prefix for files (default: %s)\n"), def_urlpre);
fprintf( stderr, _(" -l limit time limit (in seconds, or \"none\" or \"max\") for search\n"));
......@@ -199,6 +204,9 @@ static int dontUseCopy = 0;
static int domainScope = 0;
static int sss = 0;
static LDAPSortKey **sss_keys = NULL;
static int ldapsync = 0;
static struct berval sync_cookie = { 0, NULL };
static int sync_slimit = -1;
......@@ -218,6 +226,12 @@ static LDAPControl *c = NULL;
static int nctrls = 0;
static int save_nctrls = 0;
#ifdef LDAP_CONTROL_X_DEREF
static int derefcrit;
static LDAPDerefSpec *ds;
static struct berval derefval;
#endif
static int
ctrl_add( void )
{
......@@ -251,7 +265,7 @@ urlize(char *url)
const char options[] = "a:Ab:cE:F:l:Ls:S:tT:uz:"
"Cd:D:e:f:h:H:IMnO:o:p:P:QR:U:vVw:WxX:y:Y:Z";
"Cd:D:e:f:h:H:IMnNO:o:p:P:QR:U:vVw:WxX:y:Y:Z";
int
handle_private_option( int i )
......@@ -395,6 +409,31 @@ handle_private_option( int i )
domainScope = 1 + crit;
} else if ( strcasecmp( control, "sss" ) == 0 ) {
char *keyp;
if( sss ) {
fprintf( stderr,
_("server side sorting control previously specified\n"));
exit( EXIT_FAILURE );
}
if( cvalue == NULL ) {
fprintf( stderr,
_("missing specification of sss control\n") );
exit( EXIT_FAILURE );
}
keyp = cvalue;
while ( ( keyp = strchr(keyp, '/') ) != NULL ) {
*keyp++ = ' ';
}
if ( ldap_create_sort_keylist( &sss_keys, cvalue )) {
fprintf( stderr,
_("server side sorting control value \"%s\" invalid\n"),
cvalue );
exit( EXIT_FAILURE );
}
sss = 1 + crit;
} else if ( strcasecmp( control, "subentries" ) == 0 ) {
if( subentries ) {
fprintf( stderr,
......@@ -461,6 +500,51 @@ handle_private_option( int i )
}
if ( crit ) ldapsync *= -1;
#ifdef LDAP_CONTROL_X_DEREF
} else if ( strcasecmp( control, "deref" ) == 0 ) {
int ispecs;
char **specs;
/* cvalue is something like
*
* derefAttr:attr[,attr[...]][;derefAttr:attr[,attr[...]]]"
*/
specs = ldap_str2charray( cvalue, ";" );
if ( specs == NULL ) {
fprintf( stderr, _("deref specs \"%s\" invalid\n"),
cvalue );
exit( EXIT_FAILURE );
}
for ( ispecs = 0; specs[ ispecs ] != NULL; ispecs++ )
/* count'em */
ds = ldap_memcalloc( ispecs + 1, sizeof( LDAPDerefSpec ) );
if ( ds == NULL ) {
perror( "malloc" );
exit( EXIT_FAILURE );
}
for ( ispecs = 0; specs[ ispecs ] != NULL; ispecs++ ) {
char *ptr;
ptr = strchr( specs[ ispecs ], ':' );
if ( ptr == NULL ) {
fprintf( stderr, _("deref specs \"%s\" invalid\n"),
cvalue );
exit( EXIT_FAILURE );
}
ds[ ispecs ].derefAttr = specs[ ispecs ];
*ptr++ = '\0';
ds[ ispecs ].attributes = ldap_str2charray( ptr, "," );
}
derefcrit = 1 + crit;
ldap_memfree( specs );
#endif /* LDAP_CONTROL_X_DEREF */
} else if ( tool_is_oid( control ) ) {
if ( ctrl_add() ) {
exit( EXIT_FAILURE );
......@@ -750,10 +834,14 @@ getNextPage:
if ( nctrls > 0
#ifdef LDAP_CONTROL_DONTUSECOPY
|| dontUseCopy
#endif
#ifdef LDAP_CONTROL_X_DEREF
|| derefcrit
#endif
|| domainScope
|| pagedResults
|| ldapsync
|| sss
|| subentries
|| valuesReturnFilter )
{
......@@ -825,13 +913,13 @@ getNextPage:
&sync_cookie );
}
if ( err == LBER_ERROR ) {
if ( err == -1 ) {
ber_free( syncber, 1 );
fprintf( stderr, _("ldap sync control encoding error!\n") );
return EXIT_FAILURE;
}
if ( ber_flatten( syncber, &syncbvalp ) == LBER_ERROR ) {
if ( ber_flatten( syncber, &syncbvalp ) == -1 ) {
return EXIT_FAILURE;
}
......@@ -886,6 +974,52 @@ getNextPage:
c[i].ldctl_iscritical = pagedResults > 1;
i++;
}
if ( sss ) {
if ( ctrl_add() ) {
return EXIT_FAILURE;
}
if ( ldap_create_sort_control_value( ld,
sss_keys, &c[i].ldctl_value ) )
{
return EXIT_FAILURE;
}
c[i].ldctl_oid = LDAP_CONTROL_SORTREQUEST;
c[i].ldctl_iscritical = sss > 1;
i++;
}
#ifdef LDAP_CONTROL_X_DEREF
if ( derefcrit ) {
if ( derefval.bv_val == NULL ) {
int i;
assert( ds != NULL );
if ( ldap_create_deref_control_value( ld, ds, &derefval ) != LDAP_SUCCESS ) {
return EXIT_FAILURE;
}
for ( i = 0; ds[ i ].derefAttr != NULL; i++ ) {
ldap_memfree( ds[ i ].derefAttr );
ldap_charray_free( ds[ i ].attributes );
}
ldap_memfree( ds );
ds = NULL;
}
if ( ctrl_add() ) {
exit( EXIT_FAILURE );
}
c[ i ].ldctl_iscritical = derefcrit > 1;
c[ i ].ldctl_oid = LDAP_CONTROL_X_DEREF;
c[ i ].ldctl_value = derefval;
i++;
}
#endif /* LDAP_CONTROL_X_DEREF */
}
tool_server_controls( ld, c, i );
......@@ -968,6 +1102,16 @@ getNextPage:
(pagedResults > 1) ? _("critical ") : "",
pageSize );
}
if ( sss ) {
printf(_("\n# with server side sorting %scontrol"),
sss > 1 ? _("critical ") : "" );
}
#ifdef LDAP_CONTROL_X_DEREF
if ( sss ) {
printf(_("\n# with dereference %scontrol"),
sss > 1 ? _("critical ") : "" );
}
#endif
printf( _("\n#\n\n") );
......@@ -1051,6 +1195,12 @@ getNextPage:
if ( control != NULL ) {
ber_memfree( control );
}
if ( sss_keys != NULL ) {
ldap_free_sort_keylist( sss_keys );
}
if ( derefval.bv_val != NULL ) {
ldap_memfree( derefval.bv_val );
}
if ( c ) {
for ( ; save_nctrls-- > 0; ) {
......@@ -1092,14 +1242,15 @@ static int dosearch(
int cancel_msgid = -1;
if( filtpatt != NULL ) {
size_t max_fsize = strlen( filtpatt ) + strlen( value ) + 1;
size_t max_fsize = strlen( filtpatt ) + strlen( value ) + 1, outlen;
filter = malloc( max_fsize );
if( filter == NULL ) {
perror( "malloc" );
return EXIT_FAILURE;
}
if( snprintf( filter, max_fsize, filtpatt, value ) >= max_fsize ) {
outlen = snprintf( filter, max_fsize, filtpatt, value );
if( outlen >= max_fsize ) {
fprintf( stderr, "Bad filter pattern: \"%s\"\n", filtpatt );
free( filter );
return EXIT_FAILURE;
......@@ -1564,7 +1715,7 @@ static int print_result(
tool_write_ldif( LDIF_PUT_TEXT,
"text", line,
next ? next - line : strlen( line ) );
next ? (size_t) (next - line) : strlen( line ));
line = next ? next + 1 : NULL;
}
......
/* ldapurl -- a tool for generating LDAP URLs */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 2008-2009 The OpenLDAP Foundation.
* Portions Copyright 2008 Pierangelo Masarati, SysNet
* 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>.
*/
/* Portions Copyright (c) 1992-1996 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission. This
* software is provided ``as is'' without express or implied warranty.
*/
/* ACKNOWLEDGEMENTS:
* This work was originally developed by Pierangelo Masarati
* for inclusion in OpenLDAP software.
*/
#include "portable.h"
#include <ac/stdlib.h>
#include <stdio.h>
#include <ac/unistd.h>
#include "ldap.h"
#include "ldap_pvt.h"
#include "lutil.h"
static int
usage(void)
{
fprintf( stderr, _("usage: %s [options]\n\n"), "ldapurl" );
fprintf( stderr, _("generates RFC 4516 LDAP URL with extensions\n\n" ) );
fprintf( stderr, _("URL options:\n"));
fprintf( stderr, _(" -a attrs comma separated list of attributes\n" ) );
fprintf( stderr, _(" -b base (RFC 4514 LDAP DN)\n" ) );
fprintf( stderr, _(" -E ext (format: \"ext=value\"; multiple occurrences allowed)\n" ) );
fprintf( stderr, _(" -f filter (RFC 4515 LDAP filter)\n" ) );
fprintf( stderr, _(" -h host \n" ) );
fprintf( stderr, _(" -p port (default: 389 for ldap, 636 for ldaps)\n" ) );
fprintf( stderr, _(" -s scope (RFC 4511 searchScope and extensions)\n" ) );
fprintf( stderr, _(" -S scheme (RFC 4516 LDAP URL scheme and extensions)\n" ) );
exit( EXIT_FAILURE );
}
static int
do_uri_create( LDAPURLDesc *lud )
{
char *uri;
if ( lud->lud_scheme == NULL ) {
lud->lud_scheme = "ldap";
}
if ( lud->lud_port == -1 ) {
if ( strcasecmp( lud->lud_scheme, "ldap" ) == 0 ) {
lud->lud_port = LDAP_PORT;
} else if ( strcasecmp( lud->lud_scheme, "ldaps" ) == 0 ) {
lud->lud_port = LDAPS_PORT;
} else if ( strcasecmp( lud->lud_scheme, "ldapi" ) == 0 ) {
lud->lud_port = 0;
} else {
/* forgiving... */
lud->lud_port = 0;
}
}
if ( lud->lud_scope == -1 ) {
lud->lud_scope = LDAP_SCOPE_DEFAULT;
}
uri = ldap_url_desc2str( lud );
if ( lud->lud_attrs != NULL ) {
ldap_charray_free( lud->lud_attrs );
lud->lud_attrs = NULL;
}
if ( lud->lud_exts != NULL ) {
free( lud->lud_exts );
lud->lud_exts = NULL;
}
if ( uri == NULL ) {
fprintf( stderr, "unable to generate URI\n" );
exit( EXIT_FAILURE );
}
printf( "%s\n", uri );
free( uri );
return 0;
}
static int
do_uri_explode( const char *uri )
{
LDAPURLDesc *lud;
int rc;
rc = ldap_url_parse( uri, &lud );
if ( rc != LDAP_URL_SUCCESS ) {
fprintf( stderr, "unable to parse URI \"%s\"\n", uri );
return 1;
}
if ( lud->lud_scheme != NULL && lud->lud_scheme[0] != '\0' ) {
printf( "scheme: %s\n", lud->lud_scheme );
}
if ( lud->lud_host != NULL && lud->lud_host[0] != '\0' ) {
printf( "host: %s\n", lud->lud_host );
}
if ( lud->lud_port != 0 ) {
printf( "port: %d\n", lud->lud_port );
}
if ( lud->lud_dn != NULL && lud->lud_dn[0] != '\0' ) {
printf( "dn: %s\n", lud->lud_dn );
}
if ( lud->lud_attrs != NULL ) {
int i;
for ( i = 0; lud->lud_attrs[i] != NULL; i++ ) {
printf( "selector: %s\n", lud->lud_attrs[i] );
}
}
if ( lud->lud_scope != LDAP_SCOPE_DEFAULT ) {
printf( "scope: %s\n", ldap_pvt_scope2str( lud->lud_scope ) );
}
if ( lud->lud_filter != NULL && lud->lud_filter[0] != '\0' ) {
printf( "filter: %s\n", lud->lud_filter );
}
if ( lud->lud_exts != NULL ) {
int i;
for ( i = 0; lud->lud_exts[i] != NULL; i++ ) {
printf( "extension: %s\n", lud->lud_exts[i] );
}
}
return 0;
}
int
main( int argc, char *argv[])
{
LDAPURLDesc lud = { 0 };
char *uri = NULL;
int gotlud = 0;
int nexts = 0;
lud.lud_port = -1;
lud.lud_scope = -1;
while ( 1 ) {
int opt = getopt( argc, argv, "S:h:p:b:a:s:f:E:H:" );
if ( opt == EOF ) {
break;
}
if ( opt == 'H' ) {
if ( gotlud ) {
fprintf( stderr, "option -H incompatible with previous options\n" );
usage();
}
if ( uri != NULL ) {
fprintf( stderr, "URI already provided\n" );
usage();
}
uri = optarg;
continue;
}
switch ( opt ) {
case 'S':
case 'h':
case 'p':
case 'b':
case 'a':
case 's':
case 'f':
case 'E':
if ( uri != NULL ) {
fprintf( stderr, "option -%c incompatible with -H\n", opt );
usage();
}
gotlud++;
}
switch ( opt ) {
case 'S':
if ( lud.lud_scheme != NULL ) {
fprintf( stderr, "scheme already provided\n" );
usage();
}
lud.lud_scheme = optarg;
break;
case 'h':
if ( lud.lud_host != NULL ) {
fprintf( stderr, "host already provided\n" );
usage();
}
lud.lud_host = optarg;
break;
case 'p':
if ( lud.lud_port != -1 ) {
fprintf( stderr, "port already provided\n" );
usage();
}
if ( lutil_atoi( &lud.lud_port, optarg ) ) {
fprintf( stderr, "unable to parse port \"%s\"\n", optarg );
usage();
}
break;
case 'b':
if ( lud.lud_dn != NULL ) {
fprintf( stderr, "base already provided\n" );
usage();
}
lud.lud_dn = optarg;
break;
case 'a':
if ( lud.lud_attrs != NULL ) {
fprintf( stderr, "attrs already provided\n" );
usage();
}
lud.lud_attrs = ldap_str2charray( optarg, "," );
if ( lud.lud_attrs == NULL ) {
fprintf( stderr, "unable to parse attrs list \"%s\"\n", optarg );
usage();
}
break;
case 's':
if ( lud.lud_scope != -1 ) {
fprintf( stderr, "scope already provided\n" );
usage();
}
lud.lud_scope = ldap_pvt_str2scope( optarg );
if ( lud.lud_scope == -1 ) {
fprintf( stderr, "unable to parse scope \"%s\"\n", optarg );
usage();
}
break;
case 'f':
if ( lud.lud_filter != NULL ) {
fprintf( stderr, "filter already provided\n" );
usage();
}
lud.lud_filter = optarg;
break;
case 'E':
lud.lud_exts = (char **)realloc( lud.lud_exts,
sizeof( char * ) * ( nexts + 2 ) );
lud.lud_exts[ nexts++ ] = optarg;
lud.lud_exts[ nexts ] = NULL;
break;
default:
assert( opt != 'H' );
usage();
}
}
if ( uri != NULL ) {
return do_uri_explode( uri );
}
return do_uri_create( &lud );
}
......@@ -2,7 +2,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2008 The OpenLDAP Foundation.
* Copyright 1998-2009 The OpenLDAP Foundation.
* Portions Copyright 1998-2003 Kurt D. Zeilenga.
* Portions Copyright 1998-2001 Net Boolean Incorporated.
* Portions Copyright 2001-2003 IBM Corporation.
......@@ -62,7 +62,7 @@ usage( void )
const char options[] = ""
"d:D:e:h:H:InO:o:p:QR:U:vVw:WxX:y:Y:Z";
"d:D:e:h:H:InNO:o:p:QR:U:vVw:WxX:y:Y:Z";
int
handle_private_option( int i )
......
This diff is collapsed.
dnl $OpenLDAP$
dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
dnl
dnl Copyright 1998-2008 The OpenLDAP Foundation.
dnl Copyright 1998-2009 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_LIBTOOL_LANG_F77_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])dnl
dnl ================================================================
dnl Configure.in for OpenLDAP
AC_COPYRIGHT([[Copyright 1998-2008 The OpenLDAP Foundation. All rights reserved.
AC_COPYRIGHT([[Copyright 1998-2009 The OpenLDAP Foundation. All rights reserved.
Restrictions apply, see COPYRIGHT and LICENSE files.]])
AC_REVISION([$OpenLDAP$])
AC_INIT([OpenLDAP],,[http://www.openldap.org/its/])
......@@ -96,7 +96,7 @@ AH_TOP([
/* begin of portable.h.pre */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2008 The OpenLDAP Foundation
* Copyright 1998-2009 The OpenLDAP Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
......@@ -242,6 +242,8 @@ OL_ARG_WITH(cyrus_sasl,[ --with-cyrus-sasl with Cyrus SASL support],
auto, [auto yes no] )
OL_ARG_WITH(fetch,[ --with-fetch with fetch(3) URL support],
auto, [auto yes no] )
OL_ARG_WITH(gssapi,[ --with-gssapi with GSSAPI support],
auto, [auto yes no] )
OL_ARG_WITH(threads,[ --with-threads with threads],
auto, [auto nt posix mach pth lwp yes no manual] )
OL_ARG_WITH(tls,[ --with-tls with TLS/SSL support auto|openssl|gnutls],
......@@ -253,8 +255,8 @@ OL_ARG_WITH(mp,
[ --with-mp with multiple precision statistics auto|longlong|long|bignum|gmp],
auto, [auto longlong long bignum gmp yes no])
OL_ARG_WITH(odbc,
[ --with-odbc with specific ODBC support iodbc|unixodbc|auto],
auto, [auto iodbc unixodbc] )
[ --with-odbc with specific ODBC support iodbc|unixodbc|odbc32|auto],
auto, [auto iodbc unixodbc odbc32] )
dnl ----------------------------------------------------------------
dnl Server options
......@@ -286,6 +288,7 @@ Backends="bdb \
ldap \
meta \
monitor \
ndb \
null \
passwd \
perl \
......@@ -311,6 +314,8 @@ OL_ARG_ENABLE(meta,[ --enable-meta enable metadirectory backend],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(monitor,[ --enable-monitor enable monitor backend],
yes, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(ndb,[ --enable-ndb enable MySQL NDB Cluster backend],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(null,[ --enable-null enable null backend],
no, [no yes mod], ol_enable_backends)dnl
OL_ARG_ENABLE(passwd,[ --enable-passwd enable passwd backend],
......@@ -330,8 +335,10 @@ dnl ----------------------------------------------------------------
dnl SLAPD Overlay Options
Overlays="accesslog \
auditlog \
collect \
constraint \
dds \
deref \
dyngroup \
dynlist \
memberof \
......@@ -355,10 +362,14 @@ OL_ARG_ENABLE(accesslog,[ --enable-accesslog In-Directory Access Logging ov
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(auditlog,[ --enable-auditlog Audit Logging overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(collect,[ --enable-collect Collect overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(constraint,[ --enable-constraint Attribute Constraint overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(dds,[ --enable-dds Dynamic Directory Services overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(deref,[ --enable-deref Dereference overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(dyngroup,[ --enable-dyngroup Dynamic Group overlay],
no, [no yes mod], ol_enable_overlays)
OL_ARG_ENABLE(dynlist,[ --enable-dynlist Dynamic List overlay],
......@@ -460,6 +471,7 @@ elif test $ol_enable_modules != yes &&
test $ol_enable_ldap = no &&
test $ol_enable_meta = no &&
test $ol_enable_monitor = no &&
test $ol_enable_ndb = no &&
test $ol_enable_null = no &&
test $ol_enable_passwd = no &&
test $ol_enable_perl = no &&
......@@ -500,6 +512,8 @@ dnl ----------------------------------------------------------------
dnl Initialize vars
LDAP_LIBS=
BDB_LIBS=
SLAPD_NDB_LIBS=
SLAPD_NDB_INCS=
LTHREAD_LIBS=
LUTIL_LIBS=
......@@ -518,6 +532,7 @@ BUILD_HDB=no
BUILD_LDAP=no
BUILD_META=no
BUILD_MONITOR=no
BUILD_NDB=no
BUILD_NULL=no
BUILD_PASSWD=no
BUILD_PERL=no
......@@ -566,6 +581,7 @@ SLAPD_SQL_INCLUDES=
KRB4_LIBS=
KRB5_LIBS=
SASL_LIBS=
GSSAPI_LIBS=
TLS_LIBS=
MODULES_LIBS=
SLAPI_LIBS=
......@@ -675,12 +691,14 @@ if test $ol_enable_perl != no ; then
fi
AC_PROG_CPP
OL_MSVC
dnl ----------------------------------------------------------------
dnl Checks for Windows NT
case $host_os in
*mingw32* ) ac_cv_mingw32=yes ;;
*cygwin* ) ac_cv_cygwin=yes ;;
*interix* ) ac_cv_interix=yes ;;
esac
dnl ----------------------------------------------------------------
......@@ -826,7 +844,10 @@ AC_CHECK_HEADERS( \
)
dnl Only check Winsock on MinGW
if test "$ac_cv_mingw32" = yes ; then
if test "$ac_cv_mingw32" = yes \
-o "$ac_cv_interix" = yes \
-o "$ol_cv_msvc" = yes
then
AC_CHECK_HEADERS( winsock.h winsock2.h )
fi
......@@ -858,37 +879,48 @@ if test $ac_cv_func_sigaction = no && test $ac_cv_func_sigaction = no ; then
AC_CHECK_LIB(V3, sigset)
fi
if test $ol_cv_msvc ; then
ol_cv_winsock=yes
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
AC_CACHE_CHECK([for winsock], [ol_cv_winsock],
save_LIBS="$LIBS"
for curlib in ws2_32 wsock32; do
LIBS="$LIBS -l$curlib"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>
AC_CACHE_CHECK([for winsock], [ol_cv_winsock],[
save_LIBS="$LIBS"
for curlib in none ws2_32 wsock32; do
if test curlib != none ; then
LIBS="$save_LIBS -l$curlib"
fi
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>
]], [[
socket(0,0,0);
select(0,NULL,NULL,NULL,NULL);
closesocket(0);
gethostname(NULL,0);
]])],[ol_cv_winsock=yes],[ol_cv_winsock=no])
if test $ol_cv_winsock = yes; then
AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
ac_cv_func_socket=yes
ac_cv_func_select=yes
ac_cv_func_closesocket=yes
ac_cv_func_gethostname=yes
if test $curlib = ws2_32; then
ol_cv_winsock=winsock2
AC_DEFINE(HAVE_WINSOCK2, 1,
[define if you have winsock2])
]])],[ol_cv_winsock=$curlib],[ol_cv_winsock=no])
test "$ol_cv_winsock" != no && break
done
LIBS="$save_LIBS"
])
if test $ol_cv_winsock != no ; then
AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
ac_cv_func_socket=yes
ac_cv_func_select=yes
ac_cv_func_closesocket=yes
ac_cv_func_gethostname=yes
if test $ol_cv_winsock != none -a $ol_cv_winsock != yes ; then
LIBS="$LIBS -l$ol_cv_winsock"
fi
break
if test $ol_cv_winsock = ws2_32 -o $ol_cv_winsock = yes ; then
AC_DEFINE(HAVE_WINSOCK2, 1, [define if you have winsock2])
fi
fi
LIBS="$save_LIBS"
done)
fi
dnl Find socket()
......@@ -953,7 +985,6 @@ then
fi
dnl ----------------------------------------------------------------
# strerror checks
OL_STRERROR
dnl ----------------------------------------------------------------
......@@ -981,12 +1012,14 @@ dnl UUID Support
have_uuid=no
AC_CHECK_HEADERS(sys/uuid.h)
dnl The HAVE_UUID_TO_STR code path also needs uuid_create
if test $ac_cv_header_sys_uuid_h = yes ; then
save_LIBS="$LIBS"
AC_SEARCH_LIBS([uuid_to_str], [uuid], [have_uuid=yes], :)
AC_SEARCH_LIBS([uuid_create], [uuid], :, [have_uuid=no])
LIBS="$save_LIBS"
if test have_uuid = yes ; then
if test $have_uuid = yes ; then
AC_DEFINE(HAVE_UUID_TO_STR,1,
[define if you have uuid_to_str()])
......@@ -996,14 +1029,16 @@ if test $ac_cv_header_sys_uuid_h = yes ; then
fi
dnl Look for uuid_generate
dnl The HAVE_UUID_GENERATE code path also needs uuid_unparse_lower
if test $have_uuid = no ; then
AC_CHECK_HEADERS(uuid/uuid.h)
if test $ac_cv_header_uuid_uuid_h = yes ; then
save_LIBS="$LIBS"
AC_SEARCH_LIBS([uuid_generate], [uuid], [have_uuid=yes], :)
AC_SEARCH_LIBS([uuid_unparse_lower], [uuid], :, [have_uuid=no])
LIBS="$save_LIBS"
if test have_uuid = yes ; then
if test $have_uuid = yes ; then
AC_DEFINE(HAVE_UUID_GENERATE,1,
[define if you have uuid_generate()])
......@@ -1110,6 +1145,63 @@ if test $ol_enable_local != no ; then
fi
fi
dnl ----------------------------------------------------------------
dnl GSSAPI
ol_link_gssapi=no
case $ol_with_gssapi in yes | auto)
ol_header_gssapi=no
AC_CHECK_HEADERS(gssapi/gssapi.h)
if test $ac_cv_header_gssapi_gssapi_h = yes ; then
ol_header_gssapi=yes
else
AC_CHECK_HEADERS(gssapi.h)
if test $ac_cv_header_gssapi_h = yes ; then
ol_header_gssapi=yes
fi
dnl## not every gssapi has gss_oid_to_str()
dnl## as it's not defined in the GSSAPI V2 API
dnl## anymore
saveLIBS="$LIBS"
LIBS="$LIBS $GSSAPI_LIBS"
AC_CHECK_FUNCS(gss_oid_to_str)
LIBS="$saveLIBS"
fi
if test $ol_header_gssapi = yes ; then
dnl## we check for gss_wrap
dnl## as it's new to the GSSAPI V2 API
AC_CHECK_LIB(gssapi, gss_wrap,
[ol_link_gssapi=yes;GSSAPI_LIBS="-lgssapi"],
[ol_link_gssapi=no])
if test $ol_link_gssapi != yes ; then
AC_CHECK_LIB(gssapi_krb5, gss_wrap,
[ol_link_gssapi=yes;GSSAPI_LIBS="-lgssapi_krb5"],
[ol_link_gssapi=no])
fi
if test $ol_link_gssapi != yes ; then
AC_CHECK_LIB(gss, gss_wrap,
[ol_link_gssapi=yes;GSSAPI_LIBS="-lgss"],
[ol_link_gssapi=no])
fi
fi
;;
esac
WITH_GSSAPI=no
if test $ol_link_gssapi = yes; then
AC_DEFINE(HAVE_GSSAPI, 1, [define if you have GSSAPI])
WITH_GSSAPI=yes
elif test $ol_with_gssapi = auto ; then
AC_MSG_WARN([Could not locate GSSAPI package])
AC_MSG_WARN([GSSAPI authentication not supported!])
elif test $ol_with_gssapi = yes ; then
AC_MSG_ERROR([GSSAPI detection failed])
fi
dnl ----------------------------------------------------------------
dnl TLS/SSL
......@@ -1840,12 +1932,6 @@ if test $ol_enable_bdb/$ol_enable_hdb != no/no; then
BDB_LIBS="$BDB_LIBS $ol_cv_lib_db"
fi
OL_BDB_COMPAT
if test $ol_cv_bdb_compat != yes ; then
AC_MSG_ERROR([BDB/HDB: BerkeleyDB version incompatible])
fi
SLAPD_LIBS="$SLAPD_LIBS \$(BDB_LIBS)"
ol_link_bdb=yes
......@@ -1929,7 +2015,7 @@ if test $ol_enable_sql != no ; then
LIBS="$LTHREAD_LIBS"
if test $ol_with_odbc = auto ; then
ol_with_odbc="iodbc unixodbc"
ol_with_odbc="iodbc unixodbc odbc32"
fi
for odbc in $ol_with_odbc ; do
......@@ -1949,6 +2035,13 @@ if test $ol_enable_sql != no ; then
fi
;;
odbc32)
AC_CHECK_LIB(odbc32, SQLDriverConnect, [have_odbc32=yes], [have_odbc32=no])
if test $have_odbc32 = yes ; then
ol_link_sql="-lodbc32"
fi
;;
*)
AC_MSG_ERROR([unknown ODBC library])
;;
......@@ -1966,6 +2059,47 @@ if test $ol_enable_sql != no ; then
fi
fi
dnl ----------------------------------------------------------------
dnl MySQL NDBapi
dnl Note: uses C++, but we don't want to add C++ test overhead to
dnl the rest of the libtool machinery.
ol_link_ndb=no
if test $ol_enable_ndb != no ; then
AC_CHECK_PROG(MYSQL,mysql_config,yes)
if test "$MYSQL" != yes ; then
AC_MSG_ERROR([could not locate mysql_config])
fi
SQL_INC=`mysql_config --include`
SLAPD_NDB_INCS="$SQL_INC $SQL_INC/storage/ndb $SQL_INC/storage/ndb/ndbapi"
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$SLAPD_NDB_INCS"
AC_MSG_CHECKING(for NdbApi.hpp)
AC_PREPROC_IFELSE(
[AC_LANG_SOURCE([[#include <NdbApi.hpp>]])],
AC_MSG_RESULT(yes),
AC_MSG_ERROR([could not locate NdbApi headers])
)
CPPFLAGS="$save_CPPFLAGS"
SQL_LIB=`mysql_config --libs_r`
SLAPD_NDB_LIBS="$SQL_LIB -lndbclient -lstdc++"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
LDFLAGS="$SQL_LIB"
AC_CHECK_LIB(ndbclient,ndb_init,[: ok],[
AC_MSG_ERROR([could not locate ndbclient library])
],[-lstdc++])
LIBS="$save_LIBS"
LDFLAGS="$save_LDFLAGS"
if test "$ol_enable_ndb" = yes ; then
SLAPD_LIBS="$SLAPD_LIBS \$(SLAPD_NDB_LIBS)"
fi
fi
dnl ----------------------------------------------------------------
dnl International Components for Unicode
OL_ICU
......@@ -2292,9 +2426,12 @@ AC_CHECK_FUNC(_snprintf, [ac_cv_func_snprintf=yes
AC_DEFINE(snprintf, _snprintf, [define to snprintf routine])
])
AC_CHECK_FUNC(_vsnprintf, [ac_cv_func_vsnprintf=yes
AC_CHECK_FUNCS(vsnprintf _vsnprintf)
if test $ac_cv_func_vsnprintf = no -a $ac_cv_func__vsnprintf = yes ; then
ac_cv_func_vsnprintf=yes
AC_DEFINE(vsnprintf, _vsnprintf, [define to vsnprintf routine])
])
fi
AC_FUNC_VPRINTF
......@@ -2313,6 +2450,7 @@ AC_CHECK_FUNCS( \
flock \
fstat \
getdtablesize \
geteuid \
getgrgid \
gethostname \
getpass \
......@@ -2572,6 +2710,19 @@ if test "$ol_enable_meta" != no ; then
AC_DEFINE_UNQUOTED(SLAPD_META,$MFLAG,[define to support LDAP Metadirectory backend])
fi
if test "$ol_enable_ndb" != no ; then
BUILD_SLAPD=yes
BUILD_NDB=$ol_enable_ndb
if test "$ol_enable_ndb" = mod ; then
SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ndb"
MFLAG=SLAPD_MOD_DYNAMIC
else
SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ndb"
MFLAG=SLAPD_MOD_STATIC
fi
AC_DEFINE_UNQUOTED(SLAPD_NDB,$MFLAG,[define to support NDB backend])
fi
if test "$ol_enable_null" != no ; then
BUILD_SLAPD=yes
BUILD_NULL=$ol_enable_null
......@@ -2690,6 +2841,18 @@ if test "$ol_enable_auditlog" != no ; then
AC_DEFINE_UNQUOTED(SLAPD_OVER_AUDITLOG,$MFLAG,[define for Audit Logging overlay])
fi
if test "$ol_enable_collect" != no ; then
BUILD_COLLECT=$ol_enable_collect
if test "$ol_enable_collect" = mod ; then
MFLAG=SLAPD_MOD_DYNAMIC
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS collect.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS collect.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_COLLECT,$MFLAG,[define for Collect overlay])
fi
if test "$ol_enable_constraint" != no ; then
BUILD_CONSTRAINT=$ol_enable_constraint
if test "$ol_enable_constraint" = mod ; then
......@@ -2714,6 +2877,18 @@ if test "$ol_enable_dds" != no ; then
AC_DEFINE_UNQUOTED(SLAPD_OVER_DDS,$MFLAG,[define for Dynamic Directory Services overlay])
fi
if test "$ol_enable_deref" != no ; then
BUILD_DDS=$ol_enable_deref
if test "$ol_enable_deref" = mod ; then
MFLAG=SLAPD_MOD_DYNAMIC
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS deref.la"
else
MFLAG=SLAPD_MOD_STATIC
SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS deref.o"
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_DEREF,$MFLAG,[define for Dynamic Directory Services overlay])
fi
if test "$ol_enable_dyngroup" != no ; then
BUILD_DYNGROUP=$ol_enable_dyngroup
if test "$ol_enable_dyngroup" = mod ; then
......@@ -2889,7 +3064,7 @@ dnl For Windows build, we don't want to include -dlopen flags.
dnl They hurt more than they help.
dnl
if test "$ac_cv_mingw32" = yes ; then
if test "$ac_cv_mingw32" = yes -o $ol_cv_msvc = yes ; then
PLAT=NT
SLAPD_MODULES_LDFLAGS=
else
......@@ -2916,6 +3091,7 @@ dnl backends
AC_SUBST(BUILD_LDAP)
AC_SUBST(BUILD_META)
AC_SUBST(BUILD_MONITOR)
AC_SUBST(BUILD_NDB)
AC_SUBST(BUILD_NULL)
AC_SUBST(BUILD_PASSWD)
AC_SUBST(BUILD_RELAY)
......@@ -2926,6 +3102,7 @@ dnl backends
dnl overlays
AC_SUBST(BUILD_ACCESSLOG)
AC_SUBST(BUILD_AUDITLOG)
AC_SUBST(BUILD_COLLECT)
AC_SUBST(BUILD_CONSTRAINT)
AC_SUBST(BUILD_DDS)
AC_SUBST(BUILD_DENYOP)
......@@ -2947,6 +3124,8 @@ dnl overlays
AC_SUBST(LDAP_LIBS)
AC_SUBST(SLAPD_LIBS)
AC_SUBST(BDB_LIBS)
AC_SUBST(SLAPD_NDB_LIBS)
AC_SUBST(SLAPD_NDB_INCS)
AC_SUBST(LTHREAD_LIBS)
AC_SUBST(LUTIL_LIBS)
AC_SUBST(WRAP_LIBS)
......@@ -2967,6 +3146,7 @@ AC_SUBST(MOD_PERL_LDFLAGS)
AC_SUBST(KRB4_LIBS)
AC_SUBST(KRB5_LIBS)
AC_SUBST(SASL_LIBS)
AC_SUBST(GSSAPI_LIBS)
AC_SUBST(TLS_LIBS)
AC_SUBST(MODULES_LIBS)
AC_SUBST(SLAPI_LIBS)
......@@ -3017,6 +3197,7 @@ AC_CONFIG_FILES([Makefile:build/top.mk:Makefile.in:build/dir.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-ndb/Makefile:build/top.mk:servers/slapd/back-ndb/Makefile.in:build/mod.mk]
[servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk]
[servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk]
[servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk]
......@@ -3040,7 +3221,7 @@ rm -f $BACKENDSC
cat > $BACKENDSC << ENDX
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2008 The OpenLDAP Foundation.
* Copyright 1998-2009 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
......@@ -3091,7 +3272,7 @@ rm -f $OVERLAYSC
cat > $OVERLAYSC << ENDX
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2008 The OpenLDAP Foundation.
* Copyright 1998-2009 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
......
......@@ -2,3 +2,5 @@ List of OpenLDAP Configuration OIDs allocated to contrib modules
OLcfgCt{Oc|At}:1 smbk5pwd
OLcfgCt{Oc|At}:2 autogroup
OLcfgCt{Oc|At}:3 nssov
OLcfgCt{Oc|At}:4 cloak
Copyright 1998-2008 The OpenLDAP Foundation
Copyright 1998-2009 The OpenLDAP Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
......
# $OpenLDAP$
##
# Copyright 2000-2003, OpenLDAP Foundation, All Rights Reserved.
# Copyright 2000-2008, OpenLDAP Foundation, All Rights Reserved.
# COPYING RESTRICTIONS APPLY, see COPYRIGHT file
##
EXTRA_DIST = BUGS
EXTRA_DIST=COPYRIGHT doxygen.rc LICENSE version.var version.sh
SUBDIRS = src examples
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 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,7 @@
# $OpenLDAP$
# Copyright 2000-2003, OpenLDAP Foundation, All Rights Reserved.
# Copyright 2000-2008, OpenLDAP Foundation, All Rights Reserved.
# COPYING RESTRICTIONS APPLY, see COPYRIGHT file
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
......@@ -93,6 +93,7 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
......@@ -115,7 +116,9 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OPENLDAP_CPP_API_VERSION = @OPENLDAP_CPP_API_VERSION@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
......@@ -180,7 +183,7 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = BUGS
EXTRA_DIST = COPYRIGHT doxygen.rc LICENSE version.var version.sh
SUBDIRS = src examples
all: all-recursive
......@@ -303,8 +306,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
......@@ -329,8 +332,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
......@@ -340,13 +343,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
......@@ -417,6 +419,10 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
......@@ -443,6 +449,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
......@@ -594,8 +602,8 @@ uninstall-am:
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-libtool distclean-tags \
dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \
distclean distclean-generic distclean-libtool distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
......
This diff is collapsed.
This diff is collapsed.
dnl $OpenLDAP$
dnl Copyright 2000-2003, OpenLDAP Foundation, All Rights Reserved.
dnl Copyright 2000-2008, OpenLDAP Foundation, All Rights Reserved.
dnl COPYING RESTRICTIONS APPLY, see COPYRIGHT file
dnl Process this file with autoconf to produce a configure script.
dnl disable config.cache
dnl define([AC_CACHE_LOAD], )
dnl define([AC_CACHE_SAVE], )
AC_INIT(ldapcpplib, 0.0.5)
AC_COPYRIGHT([[Copyright 2000-2009 The OpenLDAP Foundation. All rights reserved.
Restrictions apply, see COPYRIGHT and LICENSE files.]])
AC_REVISION([$OpenLDAP$])
AC_INIT(ldapcpplib, [] , [http://www.openldap.org/its/] )
AC_CONFIG_SRCDIR(src/LDAPConnection.h)
AM_INIT_AUTOMAKE(foreign)
AM_CONFIG_HEADER(src/config.h)
eval `$ac_aux_dir/version.sh`
if test -z "$OL_CPP_API_RELEASE"; then
AC_MSG_ERROR([could not determine version])
fi
VERSION=$OL_CPP_API_RELEASE
OPENLDAP_CPP_API_VERSION=$OL_CPP_API_VERSION
AC_SUBST(VERSION)
AC_SUBST(OPENLDAP_CPP_API_VERSION)
dnl Checks for programs.
AC_PROG_INSTALL
dnl AC_PROG_CC
......@@ -26,9 +33,7 @@ dnl AC_PROG_MAKE_SET
AC_ARG_ENABLE(debug,[ --enable-debug],[
CXXFLAGS="-g -O0 -Wall"
AC_DEFINE(WITH_DEBUG,[],[Define to 1 ot enable debug logging])
],[
CXXFLAGS="-O0"
]
],
)
AC_ARG_WITH(libldap,[ --with-libldap=DIR Path to the libldap library [/usr/local/lib]],[
......
# Makefile.in generated by automake 1.10 from Makefile.am.
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008 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.
......@@ -54,7 +54,7 @@ readSchema_DEPENDENCIES = ../src/libldapcpp.la
am_urlTest_OBJECTS = urlTest.$(OBJEXT)
urlTest_OBJECTS = $(am_urlTest_OBJECTS)
urlTest_DEPENDENCIES = ../src/libldapcpp.la
DEFAULT_INCLUDES = -I. -I$(top_builddir)/src@am__isrc@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
......@@ -91,6 +91,7 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
......@@ -113,7 +114,9 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OPENLDAP_CPP_API_VERSION = @OPENLDAP_CPP_API_VERSION@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
......@@ -280,8 +283,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
......@@ -293,8 +296,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
......@@ -304,13 +307,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
......
......@@ -19,18 +19,7 @@ LDAPAttrType::LDAPAttrType(){
usage = 0;
}
LDAPAttrType::LDAPAttrType (const LDAPAttrType &at){
DEBUG(LDAP_DEBUG_CONSTRUCT,
"LDAPAttrType::LDAPAttrType( )" << endl);
oid = at.oid;
desc = at.desc;
names = at.names;
single = at.single;
usage = at.usage;
}
LDAPAttrType::LDAPAttrType (string at_item) {
LDAPAttrType::LDAPAttrType (string at_item, int flags ) {
DEBUG(LDAP_DEBUG_CONSTRUCT,
"LDAPAttrType::LDAPAttrType( )" << endl);
......@@ -38,7 +27,7 @@ LDAPAttrType::LDAPAttrType (string at_item) {
LDAPAttributeType *a;
int ret;
const char *errp;
a = ldap_str2attributetype (at_item.c_str(), &ret, &errp,SCHEMA_PARSE_FLAG);
a = ldap_str2attributetype (at_item.c_str(), &ret, &errp, flags);
if (a) {
this->setNames( a->at_names );
......@@ -46,6 +35,11 @@ LDAPAttrType::LDAPAttrType (string at_item) {
this->setOid( a->at_oid );
this->setSingle( a->at_single_value );
this->setUsage( a->at_usage );
this->setSuperiorOid( a->at_sup_oid );
this->setEqualityOid( a->at_equality_oid );
this->setOrderingOid( a->at_ordering_oid );
this->setSubstringOid( a->at_substr_oid );
this->setSyntaxOid( a->at_syntax_oid );
}
// else? -> error
}
......@@ -58,17 +52,17 @@ void LDAPAttrType::setSingle (int at_single) {
single = (at_single == 1);
}
void LDAPAttrType::setNames (char **at_names) {
names = StringList (at_names);
void LDAPAttrType::setNames ( char **at_names ) {
names = StringList(at_names);
}
void LDAPAttrType::setDesc (char *at_desc) {
void LDAPAttrType::setDesc (const char *at_desc) {
desc = string ();
if (at_desc)
desc = at_desc;
}
void LDAPAttrType::setOid (char *at_oid) {
void LDAPAttrType::setOid (const char *at_oid) {
oid = string ();
if (at_oid)
oid = at_oid;
......@@ -78,23 +72,48 @@ void LDAPAttrType::setUsage (int at_usage) {
usage = at_usage;
}
bool LDAPAttrType::isSingle () {
return single;
void LDAPAttrType::setSuperiorOid( const char *oid ){
if ( oid )
superiorOid = oid;
}
void LDAPAttrType::setEqualityOid( const char *oid ){
if ( oid )
equalityOid = oid;
}
void LDAPAttrType::setOrderingOid( const char *oid ){
if ( oid )
orderingOid = oid;
}
void LDAPAttrType::setSubstringOid( const char *oid ){
if ( oid )
substringOid = oid;
}
void LDAPAttrType::setSyntaxOid( const char *oid ){
if ( oid )
syntaxOid = oid;
}
string LDAPAttrType::getOid () {
bool LDAPAttrType::isSingle() const {
return single;
}
string LDAPAttrType::getOid() const {
return oid;
}
string LDAPAttrType::getDesc () {
string LDAPAttrType::getDesc() const {
return desc;
}
StringList LDAPAttrType::getNames () {
StringList LDAPAttrType::getNames() const {
return names;
}
string LDAPAttrType::getName () {
string LDAPAttrType::getName() const {
if (names.empty())
return "";
......@@ -102,6 +121,28 @@ string LDAPAttrType::getName () {
return *(names.begin());
}
int LDAPAttrType::getUsage () {
int LDAPAttrType::getUsage() const {
return usage;
}
std::string LDAPAttrType::getSuperiorOid() const {
return superiorOid;
}
std::string LDAPAttrType::getEqualityOid() const {
return equalityOid;
}
std::string LDAPAttrType::getOrderingOid() const {
return orderingOid;
}
std::string LDAPAttrType::getSubstringOid() const {
return substringOid;
}
std::string LDAPAttrType::getSyntaxOid() const {
return syntaxOid;
}
......@@ -12,9 +12,6 @@
#include "StringList.h"
#define SCHEMA_PARSE_FLAG 0x03
using namespace std;
/**
......@@ -23,10 +20,11 @@ using namespace std;
class LDAPAttrType{
private :
StringList names;
string desc, oid;
std::string desc, oid, superiorOid, equalityOid;
std::string orderingOid, substringOid, syntaxOid;
bool single;
int usage;
public :
/**
......@@ -34,11 +32,6 @@ class LDAPAttrType{
*/
LDAPAttrType();
/**
* Copy constructor
*/
LDAPAttrType (const LDAPAttrType& oc);
/**
* Constructs new object and fills the data structure by parsing the
* argument.
......@@ -47,7 +40,8 @@ class LDAPAttrType{
* "( SuSE.YaST.Attr:19 NAME ( 'skelDir' ) DESC ''
* EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"
*/
LDAPAttrType (string at_item);
LDAPAttrType (string at_item, int flags = LDAP_SCHEMA_ALLOW_NO_OID |
LDAP_SCHEMA_ALLOW_QUOTED );
/**
* Destructor
......@@ -58,40 +52,50 @@ class LDAPAttrType{
/**
* Returns attribute description
*/
string getDesc ();
string getDesc() const;
/**
* Returns attribute oid
*/
string getOid ();
string getOid() const;
/**
* Returns attribute name (first one if there are more of them)
*/
string getName ();
string getName() const;
/**
* Returns all attribute names
*/
StringList getNames();
StringList getNames() const;
/**
* Returns true if attribute type allows only single value
*/
bool isSingle();
bool isSingle() const;
/**
* Return the 'usage' value:
* (0=userApplications, 1=directoryOperation, 2=distributedOperation,
* 3=dSAOperation)
*/
int getUsage ();
int getUsage () const;
std::string getSuperiorOid() const;
std::string getEqualityOid() const;
std::string getOrderingOid() const;
std::string getSubstringOid() const;
std::string getSyntaxOid() const;
void setNames (char **at_names);
void setDesc (char *at_desc);
void setOid (char *at_oid);
void setSingle (int at_single_value);
void setUsage (int at_usage );
void setNames( char **at_names);
void setDesc(const char *at_desc);
void setOid(const char *at_oid);
void setSingle(int at_single_value);
void setUsage(int at_usage );
void setSuperiorOid( const char *oid );
void setEqualityOid( const char *oid );
void setOrderingOid( const char *oid );
void setSubstringOid( const char *oid );
void setSyntaxOid( const char *oid );
};
#endif // LDAP_ATTRTYPE_H
......@@ -140,22 +140,30 @@ void LDAPAttributeList::addAttribute(const LDAPAttribute& attr){
}
}
void LDAPAttributeList::replaceAttribute(const LDAPAttribute& attr)
void LDAPAttributeList::delAttribute(const std::string& type)
{
DEBUG(LDAP_DEBUG_TRACE,"LDAPAttribute::replaceAttribute()" << endl);
DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
" attr:" << attr << endl);
DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER, " type: " << type << endl);
LDAPAttributeList::iterator i;
for( i = m_attrs.begin(); i != m_attrs.end(); i++){
if(attr.getName().size() == i->getName().size()){
if(equal(attr.getName().begin(), attr.getName().end(), i->getName().begin(),
if(type.size() == i->getName().size()){
if(equal(type.begin(), type.end(), i->getName().begin(),
nocase_compare)){
m_attrs.erase(i);
break;
}
}
}
}
void LDAPAttributeList::replaceAttribute(const LDAPAttribute& attr)
{
DEBUG(LDAP_DEBUG_TRACE,"LDAPAttribute::replaceAttribute()" << endl);
DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
" attr:" << attr << endl);
LDAPAttributeList::iterator i;
this->delAttribute( attr.getName() );
m_attrs.push_back(attr);
}
......
......@@ -90,6 +90,12 @@ class LDAPAttributeList{
* @param attr The attribute to add to the list.
*/
void addAttribute(const LDAPAttribute& attr);
/**
* Deletes all values of an Attribute for the list
* @param type The attribute type to be deleted.
*/
void delAttribute(const std::string& type);
/**
* Replace an Attribute in the List
......
......@@ -10,13 +10,6 @@
using namespace std;
LDAPCtrl::LDAPCtrl(const LDAPCtrl& c){
DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPCtrl::LDAPCtrl(&)" << endl);
m_oid=c.m_oid;
m_data=c.m_data;
m_isCritical=c.m_isCritical;
}
LDAPCtrl::LDAPCtrl(const char *oid, bool critical, const char* data,
int length){
DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPCtrl::LDAPCtrl()" << endl);
......@@ -28,10 +21,10 @@ LDAPCtrl::LDAPCtrl(const char *oid, bool critical, const char* data,
m_data.assign(data,length);
}else{
m_data=string();
m_noData=true;
}
}
LDAPCtrl::LDAPCtrl(const string& oid, bool critical, const string& data){
DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPCtrl::LDAPCtrl()" << endl);
DEBUG(LDAP_DEBUG_CONSTRUCT | LDAP_DEBUG_PARAMETER,
......@@ -39,6 +32,7 @@ LDAPCtrl::LDAPCtrl(const string& oid, bool critical, const string& data){
m_oid=oid;
m_isCritical=critical;
m_data=data;
m_noData=false;
}
LDAPCtrl::LDAPCtrl(const LDAPControl* ctrl){
......@@ -62,6 +56,10 @@ bool LDAPCtrl::isCritical()const {
return m_isCritical;
}
bool LDAPCtrl::hasData() const{
return !m_noData;
}
string LDAPCtrl::getData() const {
DEBUG(LDAP_DEBUG_TRACE,"LDAPCtrl::getData()" << endl);
return m_data;
......@@ -73,9 +71,14 @@ LDAPControl* LDAPCtrl::getControlStruct() const {
ret->ldctl_oid= new char[m_oid.size() + 1];
m_oid.copy(ret->ldctl_oid,string::npos);
ret->ldctl_oid[m_oid.size()]=0;
ret->ldctl_value.bv_len=m_data.size();
ret->ldctl_value.bv_val= new char[m_data.size()];
m_data.copy(ret->ldctl_value.bv_val,string::npos);
if ( m_noData ) {
ret->ldctl_value.bv_len = 0;
ret->ldctl_value.bv_val = NULL;
} else {
ret->ldctl_value.bv_len=m_data.size();
ret->ldctl_value.bv_val= new char[m_data.size()];
m_data.copy(ret->ldctl_value.bv_val,string::npos);
}
ret->ldctl_iscritical = ( m_isCritical ? 1:0);
return ret;
}
......
......@@ -16,11 +16,6 @@
*/
class LDAPCtrl{
public :
/**
* Copy-constructor
*/
LDAPCtrl(const LDAPCtrl& c);
/**
* Constructor.
* @param oid: The Object Identifier of the Control
......@@ -29,7 +24,7 @@ class LDAPCtrl{
* @param data: If there is data for the control, put it here.
* @param length: The length of the data field
*/
LDAPCtrl(const char *oid, bool critical, const char *data=0,
LDAPCtrl(const char *oid, bool critical=false, const char *data=0,
int length=0);
/**
......@@ -39,8 +34,8 @@ class LDAPCtrl{
* critical by the server.
* @param data: If there is data for the control, put it here.
*/
LDAPCtrl(const std::string& oid, bool critical=false,
const std::string& data=std::string());
LDAPCtrl(const std::string& oid, bool critical,
const std::string& data);
/**
* Creates a copy of the Control that "ctrl is pointing to
......@@ -58,7 +53,13 @@ class LDAPCtrl{
std::string getOID() const;
/**
* @return The Data of the control as a std::string-Objekt
* @return true if there is no "Control Value" (there is a
* difference between no and an empty control value)
*/
bool hasData() const;
/**
* @return The Data of the control as a std::string-Object
*/
std::string getData() const;
......@@ -80,6 +81,7 @@ class LDAPCtrl{
std::string m_oid;
std::string m_data;
bool m_isCritical;
bool m_noData;
};
#endif //LDAP_CONTROL_H
......@@ -88,6 +88,11 @@ void LDAPEntry::addAttribute(const LDAPAttribute& attr)
m_attrs->addAttribute(attr);
}
void LDAPEntry::delAttribute(const std::string& type)
{
m_attrs->delAttribute(type);
}
void LDAPEntry::replaceAttribute(const LDAPAttribute& attr)
{
m_attrs->replaceAttribute(attr);
......