From: Arran Cudbard-Bell Date: Wed, 26 Apr 2017 02:00:32 +0000 (-0400) Subject: Fix minor build issues X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec29d0b72eb710f2a5bb10284bbbb919721b307a;p=thirdparty%2Ffreeradius-server.git Fix minor build issues --- diff --git a/raddb/sites-available/ldap_sync b/raddb/sites-available/ldap_sync index e1ec3ab6638..659afcc1a62 100644 --- a/raddb/sites-available/ldap_sync +++ b/raddb/sites-available/ldap_sync @@ -3,11 +3,20 @@ server ldap { listen { type = sync - sync { + server = "ldap://127.0.0.1" +# port = 389 - } +# identity = "cn=admin,dc=example,dc=org" +# password = "supersecret" + sync { + base_dn = "ou=people,dc=example,dc=org" + } + sync { + base_dn = "ou=groups,dc=example,dc=org" + filter = "(objectClass=unixGroup}" + } } load Cookie { diff --git a/src/modules/proto_ldap_sync/proto_ldap_sync.c b/src/modules/proto_ldap_sync/proto_ldap_sync.c index deb13d83dc4..e4ac0c8b5ed 100644 --- a/src/modules/proto_ldap_sync/proto_ldap_sync.c +++ b/src/modules/proto_ldap_sync/proto_ldap_sync.c @@ -86,7 +86,7 @@ typedef enum { LDAP_SYNC_CODE_COOKIE_STORE } ldap_sync_packet_code_t; -FR_NAME_NUMBER const ldap_sync_code_table[] = { +static FR_NAME_NUMBER const ldap_sync_code_table[] = { { "entry-present", LDAP_SYNC_CODE_PRESENT }, { "entry-add", LDAP_SYNC_CODE_ADD }, { "entry-modify", LDAP_SYNC_CODE_MODIFY }, @@ -97,31 +97,6 @@ FR_NAME_NUMBER const ldap_sync_code_table[] = { { NULL , -1 } }; -/* - * Scopes - */ -FR_NAME_NUMBER const fr_ldap_scope[] = { - { "sub", LDAP_SCOPE_SUB }, - { "one", LDAP_SCOPE_ONE }, - { "base", LDAP_SCOPE_BASE }, -#ifdef LDAP_SCOPE_CHILDREN - { "children", LDAP_SCOPE_CHILDREN }, -#endif - { NULL , -1 } -}; - -#ifdef LDAP_OPT_X_TLS_NEVER -FR_NAME_NUMBER const fr_ldap_tls_require_cert[] = { - { "never", LDAP_OPT_X_TLS_NEVER }, - { "demand", LDAP_OPT_X_TLS_DEMAND }, - { "allow", LDAP_OPT_X_TLS_ALLOW }, - { "try", LDAP_OPT_X_TLS_TRY }, - { "hard", LDAP_OPT_X_TLS_HARD }, /* oh yes, just like that */ - - { NULL , -1 } -}; -#endif - static CONF_PARSER sasl_mech_static[] = { { FR_CONF_OFFSET("mech", PW_TYPE_STRING | PW_TYPE_NOT_EMPTY, fr_ldap_sasl_t, mech) }, @@ -695,7 +670,7 @@ static int _proto_ldap_cookie_store(UNUSED ldap_handle_t *conn, sync_config_t co * - -1 on failure. */ static int _proto_ldap_entry(ldap_handle_t *conn, sync_config_t const *config, - UNUSED int sync_id, UNUSED sync_phases_t phase, + int sync_id, UNUSED sync_phases_t phase, UNUSED uint8_t const uuid[SYNC_UUID_LENGTH], LDAPMessage *msg, sync_states_t state, void *user_ctx) { diff --git a/src/modules/proto_ldap_sync/sync.c b/src/modules/proto_ldap_sync/sync.c index ad0d8a0cfcd..22186aaa1c1 100644 --- a/src/modules/proto_ldap_sync/sync.c +++ b/src/modules/proto_ldap_sync/sync.c @@ -171,7 +171,7 @@ static int sync_search_entry_or_refrence(sync_state_t *sync, LDAPMessage *msg, L ber_tag_t bv_ret; BerElement *ber = NULL; struct berval entry_uuid = { 0 }; - sync_states_t state = -1; + sync_states_t state = SYNC_STATE_INVALID; bool new_cookie; rad_assert(sync->conn); @@ -810,21 +810,21 @@ int sync_demux(int *sync_id, ldap_handle_t *conn) case LDAP_RES_SEARCH_ENTRY: ret = sync_search_entry_or_refrence(sync, msg, ctrls); if (ret < 0) goto sync_error; - continue; + break; case LDAP_RES_SEARCH_RESULT: ret = sync_search_result(sync, msg, ctrls); if (ret < 0) goto sync_error; - continue; + break; case LDAP_RES_INTERMEDIATE: ret = sync_intermediate(sync, msg, ctrls); if (ret < 0) goto sync_error; - continue; + break; default: WARN("Ignoring unexpected message type (%i)", type); - continue; + break; } ldap_controls_free(ctrls); diff --git a/src/modules/proto_ldap_sync/sync.h b/src/modules/proto_ldap_sync/sync.h index 11b81e9248e..966506968c2 100644 --- a/src/modules/proto_ldap_sync/sync.h +++ b/src/modules/proto_ldap_sync/sync.h @@ -32,6 +32,7 @@ /** Operations to perform on entries */ typedef enum { + SYNC_STATE_INVALID = -1, //!< Invalid sync state. SYNC_STATE_PRESENT = 0, //!< Entry is present on the server. SYNC_STATE_ADD = 1, //!< Entry should be added to our copy. SYNC_STATE_MODIFY = 2, //!< Entry should be updated in our copy.