diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2006-11-10 01:46:59 +0000 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2006-11-10 01:46:59 +0000 |
commit | 8146fa551eb295aa873ba2bb721f6c2908092184 (patch) | |
tree | ba2d293d530f30ec6a723148b9395f0a3bbd49dd | |
parent | 940762a8e91157028b4dd9e550499d0af6a3291c (diff) | |
download | ds-8146fa551eb295aa873ba2bb721f6c2908092184.tar.gz ds-8146fa551eb295aa873ba2bb721f6c2908092184.tar.xz ds-8146fa551eb295aa873ba2bb721f6c2908092184.zip |
Resolves: #214728
Summary: Cleaning up obsolete macros in the build
Changes: eliminated macro CYRUS_SASL and BUILD_GSSAPI (Comment #23)
-rw-r--r-- | ldap/servers/slapd/sasl_io.c | 14 | ||||
-rw-r--r-- | ldap/servers/slapd/saslbind.c | 73 |
2 files changed, 0 insertions, 87 deletions
diff --git a/ldap/servers/slapd/sasl_io.c b/ldap/servers/slapd/sasl_io.c index cd296bfb..717a328f 100644 --- a/ldap/servers/slapd/sasl_io.c +++ b/ldap/servers/slapd/sasl_io.c @@ -35,8 +35,6 @@ * All rights reserved. * END COPYRIGHT BLOCK **/ -#define CYRUS_SASL 1 - #include "slap.h" #include "slapi-plugin.h" #include "fe.h" @@ -201,7 +199,6 @@ sasl_io_start_packet(Connection *c, PRInt32 *err) return -1; } -#ifdef CYRUS_SASL if (ret == sizeof(buffer)) { /* Decode the length (could use ntohl here ??) */ packet_length = buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3]; @@ -217,17 +214,6 @@ sasl_io_start_packet(Connection *c, PRInt32 *err) c->c_sasl_io_private->encrypted_buffer_count = packet_length; c->c_sasl_io_private->encrypted_buffer_offset = 4; } -#else - if (ret == sizeof(buffer)) { - /* Decode the length (could use ntohl here ??) */ - packet_length = buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3]; - LDAPDebug( LDAP_DEBUG_CONNS, - "read sasl packet length %ld on connection %d\n", packet_length, c->c_connid, 0 ); - sasl_io_resize_encrypted_buffer(c->c_sasl_io_private, packet_length); - c->c_sasl_io_private->encrypted_buffer_count = packet_length; - c->c_sasl_io_private->encrypted_buffer_offset = 0; - } -#endif return 0; } static int diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c index 8bd1a19c..6ddac340 100644 --- a/ldap/servers/slapd/saslbind.c +++ b/ldap/servers/slapd/saslbind.c @@ -36,24 +36,14 @@ * All rights reserved. * END COPYRIGHT BLOCK **/ -#define CYRUS_SASL 1 - #include <slap.h> #include <fe.h> #include <sasl.h> #include <saslplug.h> -#ifndef CYRUS_SASL -#include <saslmod.h> -#endif #ifndef _WIN32 #include <unistd.h> #endif -/* No GSSAPI on Windows */ -#if !defined(_WIN32) -#define BUILD_GSSAPI 1 -#endif - static char *serverfqdn; /* @@ -427,14 +417,8 @@ static int ids_sasl_canon_user( sasl_conn_t *conn, void *context, const char *userbuf, unsigned ulen, -#ifndef CYRUS_SASL - const char *authidbuf, unsigned alen, -#endif unsigned flags, const char *user_realm, char *out_user, unsigned out_umax, unsigned *out_ulen -#ifndef CYRUS_SASL - ,char *out_authid, unsigned out_amax, unsigned *out_alen -#endif ) { struct propctx *propctx = sasl_auxprop_getctx(conn); @@ -442,9 +426,6 @@ static int ids_sasl_canon_user( Slapi_DN *sdn = NULL; char *pw = NULL; char *user = NULL; -#ifndef CYRUS_SASL - char *authid = NULL; -#endif const char *dn; int isroot = 0; char *clear = NULL; @@ -454,17 +435,9 @@ static int ids_sasl_canon_user( if (user == NULL) { goto fail; } -#ifdef CYRUS_SASL LDAPDebug(LDAP_DEBUG_TRACE, "ids_sasl_canon_user(user=%s, realm=%s)\n", user, user_realm ? user_realm : "", 0); -#else - authid = buf2str(authidbuf, alen); - - LDAPDebug(LDAP_DEBUG_TRACE, - "ids_sasl_canon_user(user=%s, authzid=%s, realm=%s)\n", - user, authid, user_realm ? user_realm : ""); -#endif if (strncasecmp(user, "dn:", 3) == 0) { sdn = slapi_sdn_new(); @@ -480,11 +453,9 @@ static int ids_sasl_canon_user( /* map the sasl username into an entry */ entry = ids_sasl_user_to_entry(conn, context, user, user_realm); if (entry == NULL) { -#ifdef CYRUS_SASL /* Specific return value is supposed to be set instead of an generic error (SASL_FAIL) for Cyrus SASL */ returnvalue = SASL_NOAUTHZ; -#endif goto fail; } dn = slapi_entry_get_ndn(entry); @@ -515,22 +486,8 @@ static int ids_sasl_canon_user( /* TODO: canonicalize */ PL_strncpyz(out_user, dn, out_umax); -#ifdef CYRUS_SASL /* the length of out_user needs to be set for Cyrus SASL */ *out_ulen = strlen(out_user); -#else - if (authid ) - { - int offset = 0; - /* The authid can start with dn:. In such case remove it */ - if (strncasecmp(authid,"dn:",3) == 0 ) - offset = 3; - PL_strncpyz(out_authid, authid+offset, out_amax); - } - *out_ulen = -1; - *out_alen = -1; - slapi_ch_free((void**)&authid); -#endif slapi_entry_free(entry); slapi_ch_free((void**)&user); @@ -542,16 +499,12 @@ static int ids_sasl_canon_user( fail: slapi_entry_free(entry); slapi_ch_free((void**)&user); -#ifndef CYRUS_SASL - slapi_ch_free((void**)&authid); -#endif slapi_ch_free((void**)&pw); slapi_sdn_free(&sdn); return returnvalue; } -#ifdef CYRUS_SASL static int ids_sasl_getpluginpath(sasl_conn_t *conn, const char **path) { /* Try to get path from config, otherwise check for SASL_PATH environment @@ -566,7 +519,6 @@ static int ids_sasl_getpluginpath(sasl_conn_t *conn, const char **path) *path = pluginpath; return SASL_OK; } -#endif static sasl_callback_t ids_sasl_callbacks[] = { @@ -586,21 +538,15 @@ static sasl_callback_t ids_sasl_callbacks[] = NULL }, { -#ifdef CYRUS_SASL SASL_CB_CANON_USER, -#else - SASL_CB_SERVER_CANON_USER, -#endif (IFP) ids_sasl_canon_user, NULL }, -#ifdef CYRUS_SASL { SASL_CB_GETPATH, (IFP) ids_sasl_getpluginpath, NULL }, -#endif { SASL_CB_LIST_END, (IFP) NULL, @@ -636,25 +582,6 @@ int ids_sasl_init(void) return result; } -#ifndef CYRUS_SASL - result = sasl_server_add_plugin("USERDB", sasl_userdb_init); - - if (result != SASL_OK) { - LDAPDebug(LDAP_DEBUG_TRACE, "failed to add LDAP sasl plugin\n", - 0, 0, 0); - return result; - } - -#if defined(BUILD_GSSAPI) - result = sasl_server_add_plugin("GSSAPI", sasl_gssapi_init); - - if (result != SASL_OK) { - LDAPDebug(LDAP_DEBUG_TRACE, "failed to add LDAP gssapi plugin\n", - 0, 0, 0); - } -#endif -#endif - result = sasl_auxprop_add_plugin("iDS", ids_auxprop_plug_init); LDAPDebug( LDAP_DEBUG_TRACE, "<= ids_sasl_init\n", 0, 0, 0 ); |