From 2d3e998c3c5b228f92cc8463eb479dc091dfee01 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 26 Aug 2000 02:13:52 +0000 Subject: [PATCH] Remove extended op callback function... doesn't provide necessary locking --- servers/slapd/extended.c | 50 ++------------------------------------ servers/slapd/passwd.c | 1 - servers/slapd/proto-slap.h | 13 ---------- servers/slapd/starttls.c | 1 - 4 files changed, 2 insertions(+), 63 deletions(-) diff --git a/servers/slapd/extended.c b/servers/slapd/extended.c index 23923fc826..1660aaa914 100644 --- a/servers/slapd/extended.c +++ b/servers/slapd/extended.c @@ -61,10 +61,6 @@ struct { static extop_list_t *find_extop( extop_list_t *list, char *oid ); -static int extop_callback( - Connection *conn, Operation *op, - int msg, int arg, void *argp); - char * get_supported_extop (int index) { @@ -152,7 +148,7 @@ do_extended( text = NULL; refs = NULL; - rc = (ext->ext_main)( extop_callback, conn, op, + rc = (ext->ext_main)( conn, op, reqoid, reqdata, &rspoid, &rspdata, &rspctrls, &text, &refs ); @@ -247,46 +243,4 @@ find_extop( extop_list_t *list, char *oid ) return(ext); } return(NULL); -} - -int -extop_callback( - Connection *conn, Operation *op, - int msg, int arg, void *argp) -{ - if (argp == NULL) - return(-1); - - switch (msg) { - case SLAPD_EXTOP_GETVERSION: - *(int *)argp = 1; - return(0); - - case SLAPD_EXTOP_GETPROTO: - *(int *)argp = op->o_protocol; - return(0); - - case SLAPD_EXTOP_GETAUTH: - *(int *)argp = op->o_authtype; - return(0); - - case SLAPD_EXTOP_GETDN: - *(char **)argp = op->o_dn; - return(0); - - case SLAPD_EXTOP_GETCLIENT: - if (conn->c_peer_domain != NULL && *conn->c_peer_domain != 0) { - *(char **)argp = conn->c_peer_domain; - return(0); - } - if (conn->c_peer_name != NULL && *conn->c_peer_name != 0) { - *(char **)argp = conn->c_peer_name; - return(0); - } - break; - - default: - break; - } - return(-1); -} +} \ No newline at end of file diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index db240991da..7580f7c661 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -19,7 +19,6 @@ #include int passwd_extop( - SLAP_EXTOP_CALLBACK_FN ext_callback, Connection *conn, Operation *op, const char *reqoid, struct berval *reqdata, diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 8ae6be8c85..e54ed9aa56 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -321,18 +321,7 @@ LDAP_SLAPD_F (int) entry_id_cmp LDAP_P(( Entry *a, Entry *b )); * extended.c */ -#define SLAPD_EXTOP_GETVERSION 0 -#define SLAPD_EXTOP_GETPROTO 1 -#define SLAPD_EXTOP_GETAUTH 2 -#define SLAPD_EXTOP_GETDN 3 -#define SLAPD_EXTOP_GETCLIENT 4 - -typedef int (*SLAP_EXTOP_CALLBACK_FN) LDAP_P(( - Connection *conn, Operation *op, - int msg, int arg, void *argp )); - typedef int (*SLAP_EXTOP_MAIN_FN) LDAP_P(( - SLAP_EXTOP_CALLBACK_FN, Connection *conn, Operation *op, const char * reqoid, struct berval * reqdata, @@ -667,7 +656,6 @@ LDAP_SLAPD_F (int) dscompare LDAP_P(( const char *s1, const char *s2del, char de */ LDAP_SLAPD_F (int) starttls_extop LDAP_P(( - SLAP_EXTOP_CALLBACK_FN, Connection *conn, Operation *op, const char * reqoid, struct berval * reqdata, @@ -723,7 +711,6 @@ LDAP_SLAPD_F (void) slap_init_user LDAP_P(( char *username, char *groupname )); * passwd.c */ LDAP_SLAPD_F (int) passwd_extop LDAP_P(( - SLAP_EXTOP_CALLBACK_FN, Connection *conn, Operation *op, const char * reqoid, struct berval * reqdata, diff --git a/servers/slapd/starttls.c b/servers/slapd/starttls.c index b607c68ef7..f59f15adb4 100644 --- a/servers/slapd/starttls.c +++ b/servers/slapd/starttls.c @@ -20,7 +20,6 @@ int starttls_extop ( - SLAP_EXTOP_CALLBACK_FN cb, Connection *conn, Operation *op, const char * reqoid, -- 2.39.5