Commit 77a925d7 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Sync with HEAD in prep for 2.3.3beta

parent 21dd34e8
......@@ -201,6 +201,22 @@ do
--mode) prevopt="--mode" prev=mode ;;
--mode=*) mode="$optarg" ;;
--tag=*)
case "$optarg" in
CC)
;;
disable-shared)
build_libtool_libs=no
;;
disable-static)
build_old_libs=no
;;
*)
echo "unknown tag"
exit 1;
esac
;;
--preserve-dup-deps) duplicate_deps="yes" ;;
--quiet | --silent)
......
......@@ -70,7 +70,8 @@ MKDEP_CFLAGS = @OL_MKDEP_FLAGS@
MKVERSION = $(top_srcdir)/build/mkversion -v "$(VERSION)"
LIBTOOL = @LIBTOOL@
# libtool 1.5+ requires "--tag=CC", but leave it off until we migrate
LIBTOOL = @LIBTOOL@ # --tag=CC
LIBRELEASE = @OPENLDAP_LIBRELEASE@
LIBVERSION = @OPENLDAP_LIBVERSION@
LTVERSION = -release $(LIBRELEASE) -version-info $(LIBVERSION)
......@@ -81,9 +82,9 @@ LTONLY_LIB = $(@PLAT@_LTONLY_LIB)
# libtool --only flag for modules: depends on linkage of module
# The BUILD_MOD macro is defined in each backend Makefile.in file
LTONLY_yes = static
LTONLY_mod = shared
LTONLY_MOD = # --only-$(BUILD_MOD)
LTONLY_yes = --tag=disable-shared
LTONLY_mod = --tag=disable-static
LTONLY_MOD = $(LTONLY_$(BUILD_MOD))
# platform-specific libtool flags
NT_LTFLAGS_LIB = -no-undefined -avoid-version -rpath $(libdir)
......
......@@ -8976,7 +8976,7 @@ fi
 
fi
 
if test "$ac_cv_header_winsock_h" = yes; then
if test "$ac_cv_cygwin" != yes && test "$ac_cv_header_winsock_h" = yes; then
echo $ac_n "checking for winsock""... $ac_c" 1>&6
echo "configure:8982: checking for winsock" >&5
if eval "test \"\${ol_cv_winsock+set}\" = set"; then
......
......@@ -834,7 +834,9 @@ 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
......
......@@ -31,7 +31,7 @@ INCS=$(LDAP_INC) $(SNACC_INC) $(OPENSSL_INC)
SNACC_LIB=$(snaccdir)/c-lib/libcasn1.a
SSL_LIB=/usr/local/lib/lcrypto
#LDAP_LIB=-lldap_r -llber
LIBS=$(LDAP_LIB) $(SNACC_LIB) $(SSL_LIB)
all: compmatch.la
......
......@@ -81,6 +81,12 @@ nullOid2 OBJECT-TYPE
STATUS mandatory
::= { 1 2 840 113549 1 1 1 }
nullOid3 OBJECT-TYPE
SYNTAX NULL
ACCESS read-write
STATUS mandatory
::= { 1 2 840 113549 1 1 5 }
printableStringOid OBJECT-TYPE
SYNTAX PrintableString
ACCESS read-write
......@@ -117,6 +123,13 @@ printableStringOid6 OBJECT-TYPE
STATUS mandatory
::= { 2 5 4 11 }
printableStringOid7 OBJECT-TYPE
SYNTAX PrintableString
ACCESS read-write
STATUS mandatory
::= { 0 9 2342 19200300 100 1 3 }
iA5StringOid OBJECT-TYPE
SYNTAX IA5String
ACCESS read-write
......@@ -141,4 +154,22 @@ octetStringOid3 OBJECT-TYPE
STATUS mandatory
::= { 2 5 29 14 }
octetStringOid4 OBJECT-TYPE
SYNTAX OCTET STRING
ACCESS read-write
STATUS mandatory
::= { 2 5 29 21 }
octetStringOid5 OBJECT-TYPE
SYNTAX OCTET STRING
ACCESS read-write
STATUS mandatory
::= { 2 5 29 20 }
octetStringOid7 OBJECT-TYPE
SYNTAX OCTET STRING
ACCESS read-write
STATUS mandatory
::= { 2 5 29 28 }
END
......@@ -31,49 +31,62 @@ void init_module_AuthenticationFramework() {
InitAnyAuthenticationFramework();
}
void InitAnyAuthenticationFramework()
{
AsnOid oid0 ={ 9, "\52\206\110\206\367\15\1\1\4" };
AsnOid oid1 ={ 9, "\52\206\110\206\367\15\1\1\1" };
AsnOid oid2 ={ 3, "\125\4\3" };
AsnOid oid3 ={ 3, "\125\4\6" };
AsnOid oid4 ={ 3, "\125\4\7" };
AsnOid oid5 ={ 3, "\125\4\10" };
AsnOid oid6 ={ 3, "\125\4\12" };
AsnOid oid7 ={ 3, "\125\4\13" };
AsnOid oid8 ={ 9, "\52\206\110\206\367\15\1\11\1" };
AsnOid oid9 ={ 3, "\125\35\23" };
AsnOid oid10 ={ 9, "\140\206\110\1\206\370\102\1\15" };
AsnOid oid11 ={ 3, "\125\35\16" };
AsnOid oid2 ={ 9, "\52\206\110\206\367\15\1\1\5" };
AsnOid oid3 ={ 3, "\125\4\3" };
AsnOid oid4 ={ 3, "\125\4\6" };
AsnOid oid5 ={ 3, "\125\4\7" };
AsnOid oid6 ={ 3, "\125\4\10" };
AsnOid oid7 ={ 3, "\125\4\12" };
AsnOid oid8 ={ 3, "\125\4\13" };
AsnOid oid9 ={ 10, "\11\222\46\211\223\362\54\144\1\3" };
AsnOid oid10 ={ 9, "\52\206\110\206\367\15\1\11\1" };
AsnOid oid11 ={ 3, "\125\35\23" };
AsnOid oid12 ={ 9, "\140\206\110\1\206\370\102\1\15" };
AsnOid oid13 ={ 3, "\125\35\16" };
AsnOid oid14 ={ 3, "\125\35\25" };
AsnOid oid15 ={ 3, "\125\35\24" };
AsnOid oid17 ={ 3, "\125\35\34" };
InstallAnyByComponentOid (nullOid_ANY_ID, &oid0, sizeof (ComponentNull), (EncodeFcn)BEncAsnNull, (gser_decoder_func*)GDecComponentNull, (ber_tag_decoder_func*)BDecComponentNullTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentNull,(FreeFcn)FreeComponentNull, (PrintFcn)NULL);
InstallAnyByComponentOid (nullOid2_ANY_ID, &oid1, sizeof (ComponentNull), (EncodeFcn)BEncAsnNull, (gser_decoder_func*)GDecComponentNull, (ber_tag_decoder_func*)BDecComponentNullTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentNull,(FreeFcn)FreeComponentNull, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid_ANY_ID, &oid2, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (nullOid3_ANY_ID, &oid2, sizeof (ComponentNull), (EncodeFcn)BEncAsnNull, (gser_decoder_func*)GDecComponentNull, (ber_tag_decoder_func*)BDecComponentNullTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentNull,(FreeFcn)FreeComponentNull, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid2_ANY_ID, &oid3, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid_ANY_ID, &oid3, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid3_ANY_ID, &oid4, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid2_ANY_ID, &oid4, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid4_ANY_ID, &oid5, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid3_ANY_ID, &oid5, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid5_ANY_ID, &oid6, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid4_ANY_ID, &oid6, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid6_ANY_ID, &oid7, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid5_ANY_ID, &oid7, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (iA5StringOid_ANY_ID, &oid8, sizeof (ComponentIA5String), (EncodeFcn)BEncIA5String, (gser_decoder_func*)GDecComponentIA5String, (ber_tag_decoder_func*)BDecComponentIA5StringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentIA5String,(FreeFcn)FreeComponentIA5String, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid6_ANY_ID, &oid8, sizeof (ComponentPrintableString), (EncodeFcn)BEncPrintableString, (gser_decoder_func*)GDecComponentPrintableString, (ber_tag_decoder_func*)BDecComponentPrintableStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentPrintableString,(FreeFcn)FreeComponentPrintableString, (PrintFcn)NULL);
InstallAnyByComponentOid (octetStringOid_ANY_ID, &oid9, sizeof (ComponentOcts), (EncodeFcn)BEncAsnOcts, (gser_decoder_func*)GDecComponentOcts, (ber_tag_decoder_func*)BDecComponentOctsTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentOcts,(FreeFcn)FreeComponentOcts, (PrintFcn)NULL);
InstallAnyByComponentOid (printableStringOid7_ANY_ID, &oid9, sizeof (ComponentTeletexString), (EncodeFcn)BEncTeletexString, (gser_decoder_func*)GDecComponentTeletexString, (ber_tag_decoder_func*)BDecComponentTeletexStringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentTeletexString,(FreeFcn)FreeComponentTeletexString, (PrintFcn)NULL);
InstallAnyByComponentOid (octetStringOid2_ANY_ID, &oid10, sizeof (ComponentOcts), (EncodeFcn)BEncAsnOcts, (gser_decoder_func*)GDecComponentOcts, (ber_tag_decoder_func*)BDecComponentOctsTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentOcts,(FreeFcn)FreeComponentOcts, (PrintFcn)NULL);
InstallAnyByComponentOid (iA5StringOid_ANY_ID, &oid10, sizeof (ComponentIA5String), (EncodeFcn)BEncIA5String, (gser_decoder_func*)GDecComponentIA5String, (ber_tag_decoder_func*)BDecComponentIA5StringTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentIA5String,(FreeFcn)FreeComponentIA5String, (PrintFcn)NULL);
InstallAnyByComponentOid (octetStringOid3_ANY_ID, &oid11, sizeof (ComponentOcts), (EncodeFcn)BEncAsnOcts, (gser_decoder_func*)GDecComponentOcts, (ber_tag_decoder_func*)BDecComponentOctsTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentOcts,(FreeFcn)FreeComponentOcts, (PrintFcn)NULL);
InstallAnyByComponentOid (octetStringOid_ANY_ID, &oid11, sizeof (ComponentOcts), (EncodeFcn)BEncAsnOcts, (gser_decoder_func*)GDecComponentOcts, (ber_tag_decoder_func*)BDecComponentOctsTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentOcts,(FreeFcn)FreeComponentOcts, (PrintFcn)NULL);
} /* InitAnyAuthenticationFramework */
InstallAnyByComponentOid (octetStringOid2_ANY_ID, &oid12, sizeof (ComponentOcts), (EncodeFcn)BEncAsnOcts, (gser_decoder_func*)GDecComponentOcts, (ber_tag_decoder_func*)BDecComponentOctsTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentOcts,(FreeFcn)FreeComponentOcts, (PrintFcn)NULL);
InstallAnyByComponentOid (octetStringOid3_ANY_ID, &oid13, sizeof (ComponentOcts), (EncodeFcn)BEncAsnOcts, (gser_decoder_func*)GDecComponentOcts, (ber_tag_decoder_func*)BDecComponentOctsTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentOcts,(FreeFcn)FreeComponentOcts, (PrintFcn)NULL);
InstallAnyByComponentOid (octetStringOid4_ANY_ID, &oid14, sizeof (ComponentOcts), (EncodeFcn)BEncAsnOcts, (gser_decoder_func*)GDecComponentOcts, (ber_tag_decoder_func*)BDecComponentOctsTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentOcts,(FreeFcn)FreeComponentOcts, (PrintFcn)NULL);
InstallAnyByComponentOid (octetStringOid5_ANY_ID, &oid15, sizeof (ComponentOcts), (EncodeFcn)BEncAsnOcts, (gser_decoder_func*)GDecComponentOcts, (ber_tag_decoder_func*)BDecComponentOctsTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentOcts,(FreeFcn)FreeComponentOcts, (PrintFcn)NULL);
InstallAnyByComponentOid (octetStringOid7_ANY_ID, &oid17, sizeof (ComponentOcts), (EncodeFcn)BEncAsnOcts, (gser_decoder_func*)GDecComponentOcts, (ber_tag_decoder_func*)BDecComponentOctsTag, (ExtractFcn)NULL,(MatchFcn)MatchingComponentOcts,(FreeFcn)FreeComponentOcts, (PrintFcn)NULL);
} /* InitAnyAuthenticationFramework */
int
MatchingComponentAlgorithmIdentifier ( char* oid, ComponentSyntaxInfo* csi_attr, ComponentSyntaxInfo* csi_assert ) {
......
......@@ -25,17 +25,21 @@ typedef enum AuthenticationFrameworkAnyId
{
nullOid_ANY_ID = 0,
nullOid2_ANY_ID = 1,
printableStringOid_ANY_ID = 2,
printableStringOid2_ANY_ID = 3,
printableStringOid3_ANY_ID = 4,
printableStringOid4_ANY_ID = 5,
printableStringOid5_ANY_ID = 6,
printableStringOid6_ANY_ID = 7,
iA5StringOid_ANY_ID = 8,
octetStringOid_ANY_ID = 9,
octetStringOid2_ANY_ID = 10,
octetStringOid3_ANY_ID = 11} AuthenticationFrameworkAnyId;
nullOid3_ANY_ID = 2,
printableStringOid_ANY_ID = 3,
printableStringOid2_ANY_ID = 4,
printableStringOid3_ANY_ID = 5,
printableStringOid4_ANY_ID = 6,
printableStringOid5_ANY_ID = 7,
printableStringOid6_ANY_ID = 8,
printableStringOid7_ANY_ID = 9,
iA5StringOid_ANY_ID = 10,
octetStringOid_ANY_ID = 11,
octetStringOid2_ANY_ID = 12,
octetStringOid3_ANY_ID = 13,
octetStringOid4_ANY_ID = 14,
octetStringOid5_ANY_ID = 15,
octetStringOid7_ANY_ID = 17} AuthenticationFrameworkAnyId;
void InitAnyAuthenticationFramework();
......
......@@ -1363,6 +1363,52 @@ BDecComponentPrintableString( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len,
return LDAP_SUCCESS;
}
/*
* Component BER Decoder : TeletexString
*/
int
BDecComponentTeletexStringTag ( void* mem_op, GenBuf *b, void *v, AsnLen *bytesDecoded, int mode )
{
return BDecComponentTeletexString ( mem_op, b, 0, 0, v, bytesDecoded, mode|CALL_TAG_DECODER );
}
int
BDecComponentTeletexString( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *v, AsnLen *bytesDecoded, int mode )
{
char* peek_head;
int i, strLen, rc;
void* component_values;
ComponentTeletexString* k, **k2;
AsnOid result;
k = (ComponentTeletexString*) v;
if ( mode & DEC_ALLOC_MODE_0 ) {
k2 = (ComponentTeletexString**) v;
*k2 = (ComponentTeletexString*) CompAlloc( mem_op, sizeof( ComponentTeletexString ) );
if ( !*k2 ) return LDAP_DECODING_ERROR;
k = *k2;
}
if ( mode & CALL_TAG_DECODER ) {
mode = mode & CALL_CONTENT_DECODER;
rc = BDecTeletexString ( mem_op, b, &result, bytesDecoded );
} else {
rc = BDecTeletexStringContent ( mem_op, b, tagId, len, &result, bytesDecoded );
}
if ( rc < 0 ) {
if ( k ) CompFree ( mem_op, k );
return LDAP_DECODING_ERROR;
}
k->value = result;
k->comp_desc = get_component_description (BASICTYPE_T61_STR);
return LDAP_SUCCESS;
}
/*
* Matching function : Real
*/
......
......@@ -316,7 +316,8 @@ typedef struct ComponentTeletexString {
int GEncComponentTeletexString (GenBuf *b, ComponentTeletexString * tel_str);
int GDecComponentTeletexString ( void* mem_op, GenBuf *b, void *result, AsnLen *bytesDecoded, int mode );
#define BDecComponentTeletexString BDecComponentOcts
int BDecComponentTeletexStringTag (void* mem_op, GenBuf *b, void *v, AsnLen *bytesDecoded, int mode );
int BDecComponentTeletexString( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, void *v, AsnLen *bytesDecoded, int mode );
#define MatchingComponentTeletexString MatchingComponentOcts
#define ExtractingComponentTeletexString(mem_op,cr,data)
#define FreeComponentTeletexString FreeComponentOcts
......
......@@ -25,7 +25,7 @@ BDecComponentCertificateListTop( void* mem_op, GenBuf* b, void *v, AsnLen* bytes
void init_module_CertificateRevokationList() {
InstallOidDecoderMapping( "2.5.4.39", NULL,
GDecComponentCertificateList,
BDecComponentCertificateList,
BDecComponentCertificateListTop,
ExtractingComponentCertificateList,
MatchingComponentCertificateList);
}
......
......@@ -236,9 +236,11 @@ comp_convert_attr_to_comp LDAP_P (( Attribute* a, Syntax *syn, struct berval* bv
ExpBufFreeBuf( buf );
GenBufFreeBuf( b );
if ( rc == -1 ) {
#if 0
ShutdownNibbleMemLocal ( a->a_comp_data->cd_mem_op );
free ( a->a_comp_data );
a->a_comp_data = NULL;
#endif
return (void*)NULL;
}
else {
......@@ -470,10 +472,14 @@ comp_test_all_components (
{
cr->cr_curr = start_compid;
rc = comp_test_components ( attr_mem_op, assert_mem_op, comp_elmt, ca );
if ( rc != LDAP_COMPARE_FALSE ) {
break;
}
#if 0
if ( rc == LDAP_COMPARE_TRUE ) {
break;
}
#endif
}
}
break;
......@@ -824,6 +830,7 @@ int init_module(int argc, char *argv[]) {
/* the initialization for example X.509 certificate */
init_module_AuthenticationFramework();
init_module_AuthorityKeyIdentifierDefinition();
init_module_CertificateRevokationList();
init_attribute_aliasing_table ();
init_component_description_table ();
return 0;
......
......@@ -10,6 +10,7 @@ slapd \- Stand-alone LDAP Daemon
.B [\-T {acl|add|auth|cat|dn|index|passwd|test}]
.B [\-d debug\-level]
.B [\-f slapd\-config\-file]
.B [\-F slapd\-config\-directory]
.B [\-h URLs]
.B [\-n service\-name] [\-s syslog\-level] [\-l syslog\-local\-user]
.B [\-r directory]
......@@ -27,8 +28,7 @@ is typically invoked at boot time, usually out of
Upon startup,
.B slapd
normally forks and disassociates itself from the invoking tty.
If configured in
.BR ETCDIR/slapd.conf ,
If configured in the config file (or config directory),
the
.B slapd
process will print its process ID (see
......@@ -123,6 +123,20 @@ facility.
Specifies the slapd configuration file. The default is
.BR ETCDIR/slapd.conf .
.TP
.BI \-F " slapd\-config\-directory"
Specifies the slapd configuration file. The default is
.BR ETCDIR/slapd.d .
If both
.B -f
and
.B -F
are specified, the config file will be read and converted to
config directory format and written to the specified directory.
If neither option is specified, slapd will attempt to read the
default config directory before trying to use the default
config file. If a valid config directory exists then the
default config file is ignored.
.TP
.BI \-h " URLlist"
.B slapd
will by default serve
......
......@@ -920,11 +920,11 @@ acl_get(
if ( vdnlen < patlen )
continue;
if ( a->acl_dn_style == ACL_STYLE_BASE ) {
if ( a->acl_attrval_style == ACL_STYLE_BASE ) {
if ( vdnlen > patlen )
continue;
} else if ( a->acl_dn_style == ACL_STYLE_ONE ) {
} else if ( a->acl_attrval_style == ACL_STYLE_ONE ) {
int rdnlen = -1;
if ( !DN_SEPARATOR( val->bv_val[vdnlen - patlen - 1] ) )
......@@ -934,11 +934,11 @@ acl_get(
if ( rdnlen != vdnlen - patlen - 1 )
continue;
} else if ( a->acl_dn_style == ACL_STYLE_SUBTREE ) {
} else if ( a->acl_attrval_style == ACL_STYLE_SUBTREE ) {
if ( vdnlen > patlen && !DN_SEPARATOR( val->bv_val[vdnlen - patlen - 1] ) )
continue;
} else if ( a->acl_dn_style == ACL_STYLE_CHILDREN ) {
} else if ( a->acl_attrval_style == ACL_STYLE_CHILDREN ) {
if ( vdnlen <= patlen )
continue;
......
......@@ -38,10 +38,11 @@
#include "lber_pvt.h"
#include "lutil.h"
static const char style_base[] = "base";
static char *style_strings[] = {
"regex",
"expand",
"base",
"exact",
"one",
"subtree",
"children",
......@@ -2349,7 +2350,10 @@ dnaccess2text( slap_dn_access *bdn, char *ptr, int is_realdn )
} else {
ptr = lutil_strcopy( ptr, "dn." );
ptr = lutil_strcopy( ptr, style_strings[bdn->a_style] );
if ( bdn->a_style == ACL_STYLE_BASE )
ptr = lutil_strcopy( ptr, style_base );
else
ptr = lutil_strcopy( ptr, style_strings[bdn->a_style] );
if ( bdn->a_style == ACL_STYLE_LEVEL ) {
int n = sprintf( ptr, "{%d}", bdn->a_level );
if ( n > 0 ) {
......@@ -2406,30 +2410,52 @@ access2text( Access *b, char *ptr )
}
if ( !BER_BVISEMPTY( &b->a_peername_pat ) ) {
ptr = lutil_strcopy( ptr, " peername=\"" );
ptr = lutil_strcopy( ptr, " peername" );
*ptr++ = '.';
ptr = lutil_strcopy( ptr, style_strings[b->a_peername_style] );
*ptr++ = '=';
*ptr++ = '"';
ptr = lutil_strcopy( ptr, b->a_peername_pat.bv_val );
*ptr++ = '"';
}
if ( !BER_BVISEMPTY( &b->a_sockname_pat ) ) {
ptr = lutil_strcopy( ptr, " sockname=\"" );
ptr = lutil_strcopy( ptr, " sockname" );
*ptr++ = '.';
ptr = lutil_strcopy( ptr, style_strings[b->a_sockname_style] );
*ptr++ = '=';
*ptr++ = '"';
ptr = lutil_strcopy( ptr, b->a_sockname_pat.bv_val );
*ptr++ = '"';
}
if ( !BER_BVISEMPTY( &b->a_domain_pat ) ) {
ptr = lutil_strcopy( ptr, " domain=" );
ptr = lutil_strcopy( ptr, " domain" );
*ptr++ = '.';
ptr = lutil_strcopy( ptr, style_strings[b->a_domain_style] );
if ( b->a_domain_expand ) {
ptr = lutil_strcopy( ptr, ",expand" );
}
*ptr++ = '=';
ptr = lutil_strcopy( ptr, b->a_domain_pat.bv_val );
}
if ( !BER_BVISEMPTY( &b->a_sockurl_pat ) ) {
ptr = lutil_strcopy( ptr, " sockurl=\"" );
ptr = lutil_strcopy( ptr, " sockurl" );
*ptr++ = '.';
ptr = lutil_strcopy( ptr, style_strings[b->a_sockurl_style] );
*ptr++ = '=';
*ptr++ = '"';
ptr = lutil_strcopy( ptr, b->a_sockurl_pat.bv_val );
*ptr++ = '"';
}
if ( !BER_BVISEMPTY( &b->a_set_pat ) ) {
ptr = lutil_strcopy( ptr, " set=\"" );
ptr = lutil_strcopy( ptr, " set" );
*ptr++ = '.';
ptr = lutil_strcopy( ptr, style_strings[b->a_set_style] );
*ptr++ = '=';
*ptr++ = '"';
ptr = lutil_strcopy( ptr, b->a_set_pat.bv_val );
*ptr++ = '"';
}
......@@ -2515,7 +2541,10 @@ acl_unparse( AccessControl *a, struct berval *bv )
if ( !BER_BVISNULL( &a->acl_dn_pat ) ) {
to++;
ptr = lutil_strcopy( ptr, " dn." );
ptr = lutil_strcopy( ptr, style_strings[a->acl_dn_style] );
if ( a->acl_dn_style == ACL_STYLE_BASE )
ptr = lutil_strcopy( ptr, style_base );
else
ptr = lutil_strcopy( ptr, style_strings[a->acl_dn_style] );
*ptr++ = '=';
*ptr++ = '"';
ptr = lutil_strcopy( ptr, a->acl_dn_pat.bv_val );
......@@ -2557,7 +2586,12 @@ acl_unparse( AccessControl *a, struct berval *bv )
if ( !BER_BVISEMPTY( &a->acl_attrval ) ) {
to++;
ptr = lutil_strcopy( ptr, " val." );
ptr = lutil_strcopy( ptr, style_strings[a->acl_attrval_style] );
if ( a->acl_attrval_style == ACL_STYLE_BASE &&
a->acl_attrs[0].an_desc->ad_type->sat_syntax ==
slap_schema.si_syn_distinguishedName )
ptr = lutil_strcopy( ptr, style_base );
else
ptr = lutil_strcopy( ptr, style_strings[a->acl_attrval_style] );
*ptr++ = '=';
*ptr++ = '"';
ptr = lutil_strcopy( ptr, a->acl_attrval.bv_val );
......
......@@ -30,15 +30,12 @@
# define SLAP_BDB_ALLOW_DIRTY_READ
#endif
#define bdb_cf_oc BDB_SYMBOL(cf_oc)
#define bdb_cf_gen BDB_SYMBOL(cf_gen)
#define bdb_cf_cleanup BDB_SYMBOL(cf_cleanup)
#define bdb_checkpoint BDB_SYMBOL(checkpoint)
#define bdb_online_index BDB_SYMBOL(online_index)
static ObjectClass *bdb_oc;
static ConfigDriver bdb_cf_oc, bdb_cf_gen;
static ConfigDriver bdb_cf_gen;
enum {
BDB_CHKPT = 1,
......@@ -52,8 +49,6 @@ enum {
};
static ConfigTable bdbcfg[] = {
{ "", "", 0, 0, 0, ARG_MAGIC,
bdb_cf_oc, NULL, NULL, NULL },
{ "directory", "dir", 2, 2, 0, ARG_STRING|ARG_MAGIC|BDB_DIRECTORY,
bdb_cf_gen, "( OLcfgDbAt:0.1 NAME 'olcDbDirectory' "
"DESC 'Directory for database content' "
......@@ -132,20 +127,10 @@ static ConfigOCs bdbocs[] = {
"olcDbNoSync $ olcDbDirtyRead $ olcDbIDLcacheSize $ "
"olcDbIndex $ olcDbLinearIndex $ olcDbLockDetect $ "
"olcDbMode $ olcDbSearchStack $ olcDbShmKey ) )",
Cft_Database, &bdb_oc },
Cft_Database, bdbcfg },
{ NULL, 0, NULL }
};
static int
bdb_cf_oc(ConfigArgs *c)
{
if ( c->op == SLAP_CONFIG_EMIT ) {
value_add_one( &c->rvalue_vals, &bdb_oc->soc_cname );
return 0;
}
return 1;
}
static slap_verbmasks bdb_lockd[] = {
{ BER_BVC("default"), DB_LOCK_DEFAULT },
{ BER_BVC("oldest"), DB_LOCK_OLDEST },
......@@ -617,10 +602,9 @@ bdb_cf_gen(ConfigArgs *c)
int bdb_back_init_cf( BackendInfo *bi )
{
int rc;
bi->bi_cf_table = bdbcfg;
bi->bi_cf_ocs = bdbocs;
rc = config_register_schema( bdbcfg,