From c7f1759e802300e662d998222c78832471cd9f48 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 30 Dec 2003 01:26:38 +0000 Subject: [PATCH] Misc cleanup --- servers/slapd/config.c | 16 ++++++++-------- servers/slapd/extended.c | 8 ++++---- servers/slapd/proto-slap.h | 4 ++-- servers/slapd/sasl.c | 5 ++++- servers/slapd/schema_prep.c | 15 +++++++++++++-- servers/slapd/slap.h | 1 + servers/slapd/syncrepl.c | 6 ++---- servers/slapd/tools/Makefile.in | 6 +++--- servers/slapd/tools/mimic.c | 12 ++++++++++++ 9 files changed, 49 insertions(+), 24 deletions(-) diff --git a/servers/slapd/config.c b/servers/slapd/config.c index e8141d3b38..ece03c32e6 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -96,15 +96,15 @@ int use_reverse_lookup = 0; int slapi_plugins_used = 0; #endif -static char *fp_getline(FILE *fp, int *lineno); -static void fp_getline_init(int *lineno); -static int fp_parse_line(int lineno, char *line); +static char *fp_getline(FILE *fp, int *lineno); +static void fp_getline_init(int *lineno); +static int fp_parse_line(int lineno, char *line); static char *strtok_quote(char *line, char *sep); -static int load_ucdata(char *path); +static int load_ucdata(char *path); -static int add_syncrepl LDAP_P(( Backend *, char **, int )); -static int parse_syncrepl_line LDAP_P(( char **, int, syncinfo_t *)); +static int add_syncrepl LDAP_P(( Backend *, char **, int )); +static int parse_syncrepl_line LDAP_P(( char **, int, syncinfo_t *)); int read_config( const char *fname, int depth ) @@ -2834,10 +2834,10 @@ add_syncrepl( if ( si->si_rid == si_entry->si_rid ) { #ifdef NEW_LOGGING LDAP_LOG( CONFIG, ERR, - "add_syncrepl: duplicaetd replica id\n", 0, 0,0 ); + "add_syncrepl: duplicated replica id\n", 0, 0,0 ); #else Debug( LDAP_DEBUG_ANY, - "add_syncrepl: duplicated replica id\n",0, 0, 0 ); + "add_syncrepl: duplicated replica id\n",0, 0, 0 ); #endif duplicated_replica_id = 1; break; diff --git a/servers/slapd/extended.c b/servers/slapd/extended.c index 639b3b78ff..40a751775c 100644 --- a/servers/slapd/extended.c +++ b/servers/slapd/extended.c @@ -43,7 +43,7 @@ #include "slapi/slapi.h" #endif -#define UNSUPPORTED_EXTENDEDOP "unsupported extended operation" +#define UNSUPPORTED_EXOP "unsupported extended operation" #ifdef LDAP_DEVEL #define SLAP_EXOP_HIDE 0x0000 @@ -60,8 +60,8 @@ static struct extop_list { static SLAP_EXTOP_MAIN_FN whoami_extop; -/* this list of built-in extops is for extops that are not part - * of backends or in external modules. essentially, this is +/* This list of built-in extops is for extops that are not part + * of backends or in external modules. Essentially, this is * just a way to get built-in extops onto the extop list without * having a separate init routine for each built-in extop. */ @@ -269,7 +269,7 @@ do_extended( } else if ( extop_rc == SLAPI_PLUGIN_EXTENDED_NOT_HANDLED ) { rs->sr_err = LDAP_PROTOCOL_ERROR; - rs->sr_text = UNSUPPORTED_EXTENDEDOP; + rs->sr_text = UNSUPPORTED_EXOP; } else { rs->sr_err = slapi_pblock_get( pb, SLAPI_EXT_OP_RET_OID, diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index a81c5ebeab..e372440998 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -527,8 +527,8 @@ LDAP_SLAPD_F (int) extops_kill LDAP_P(( void )); LDAP_SLAPD_F (struct berval *) get_supported_extop LDAP_P((int index)); /* - * * cancel.c - * */ + * cancel.c + */ LDAP_SLAPD_F ( SLAP_EXTOP_MAIN_FN ) cancel_extop; /* diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index f186eb7c0c..960589f75b 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -637,7 +637,10 @@ sasl_cb_checkpass( Operation *op, SlapReply *rs ) a = attr_find( rs->sr_entry->e_attrs, slap_schema.si_ad_userPassword ); if ( !a ) return 0; if ( ! access_allowed( op, rs->sr_entry, slap_schema.si_ad_userPassword, - NULL, ACL_AUTH, NULL ) ) return 0; + NULL, ACL_AUTH, NULL ) ) + { + return 0; + } for ( bv = a->a_vals; bv->bv_val != NULL; bv++ ) { if ( !lutil_passwd( bv, &ci->cred, NULL, &rs->sr_text ) ) { diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index b57d299fb3..8da7b91b0f 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -422,19 +422,30 @@ static struct slap_schema_ad_map { "EQUALITY octetStringMatch " "ORDERING octetStringOrderingMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 " - "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )", NULL, SLAP_AT_HIDE, NULL, NULL, NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_syncreplCookie) }, + { "syncTimestamp", "( 1.3.6.1.4.1.4203.666.1.30 NAME 'syncTimestamp' " + "DESC 'Time which object was replicated' " + "EQUALITY generalizedTimeMatch " + "ORDERING generalizedTimeOrderingMatch " + "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 " + "SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )", + NULL, 0, + NULL, NULL, + NULL, NULL, NULL, NULL, NULL, + offsetof(struct slap_internal_schema, si_ad_syncTimestamp) }, + { "contextCSN", "( 1.3.6.1.4.1.4203.666.1.25 " "NAME 'contextCSN' " "DESC 'the largest committed CSN of a context' " "EQUALITY octetStringMatch " "ORDERING octetStringOrderingMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 " - "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )", NULL, SLAP_AT_HIDE, NULL, NULL, NULL, NULL, NULL, NULL, NULL, diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 357858ddfa..e6dba73a8a 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -769,6 +769,7 @@ struct slap_internal_schema { AttributeDescription *si_ad_dseType; AttributeDescription *si_ad_syncreplCookie; + AttributeDescription *si_ad_syncTimestamp; AttributeDescription *si_ad_contextCSN; /* root DSE attribute descriptions */ diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 0cd130e123..11b730983b 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1710,8 +1710,7 @@ nonpresent_callback( static int null_callback( Operation* op, - SlapReply* rs -) + SlapReply* rs ) { if ( rs->sr_err != LDAP_SUCCESS && rs->sr_err != LDAP_REFERRAL && @@ -1736,8 +1735,7 @@ slap_create_syncrepl_entry( Backend *be, struct berval *context_csn, struct berval *rdn, - struct berval *cn -) + struct berval *cn ) { Entry* e; diff --git a/servers/slapd/tools/Makefile.in b/servers/slapd/tools/Makefile.in index 14e887cb0b..3aa3738b87 100644 --- a/servers/slapd/tools/Makefile.in +++ b/servers/slapd/tools/Makefile.in @@ -39,10 +39,10 @@ SLAPD_OBJS = ../globals.o ../config.o ../ch_malloc.o ../cr.o ../backend.o \ ../schemaparse.o ../ad.o ../at.o ../mr.o ../oc.o \ ../syntax.o ../acl.o ../phonetic.o ../attr.o ../value.o \ ../entry.o ../dn.o ../filter.o ../str2filter.o ../ava.o \ - ../init.o ../controls.o ../kerberos.o ../passwd.o \ - ../index.o ../extended.o ../starttls.o ../sets.o ../mra.o \ + ../init.o ../controls.o ../passwd.o \ + ../index.o ../extended.o ../sets.o ../mra.o \ ../referral.o ../backglue.o ../oidm.o ../mods.o ../operation.o \ - ../cancel.o ../sl_malloc.o ../backover.o ../ctxcsn.o ../syncrepl.o \ + ../sl_malloc.o ../backover.o ../ctxcsn.o ../syncrepl.o \ ../ldapsync.o ../sessionlog.o SLAPOBJS = $(SLAPD_OBJS) slapcommon.o mimic.o diff --git a/servers/slapd/tools/mimic.c b/servers/slapd/tools/mimic.c index 044d8c164e..bb3b1d471b 100644 --- a/servers/slapd/tools/mimic.c +++ b/servers/slapd/tools/mimic.c @@ -320,3 +320,15 @@ int slap_parse_user( struct berval *id, struct berval *user, { return -1; } + +int cancel_extop( Operation *op, SlapReply *rs ) +{ + return -1; +} + +#ifdef HAVE_TLS +int starttls_extop ( Operation *op, SlapReply *rs ) +{ + return -1; +} +#endif -- 2.39.5