]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix minor build issues
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 26 Apr 2017 02:00:32 +0000 (22:00 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 26 Apr 2017 02:00:32 +0000 (22:00 -0400)
raddb/sites-available/ldap_sync
src/modules/proto_ldap_sync/proto_ldap_sync.c
src/modules/proto_ldap_sync/sync.c
src/modules/proto_ldap_sync/sync.h

index e1ec3ab6638ccab73d1bc35be8778adea829bc4c..659afcc1a62f2dd9f4e36149309530333ae917ff 100644 (file)
@@ -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 {
 
index deb13d83dc4b698cb7f9b8c6c6a3bfa575614bd8..e4ac0c8b5ed40770d99cc7c500170bdfb7334a24 100644 (file)
@@ -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)
 {
index ad0d8a0cfcd1dff0f9009c93f75b72b6465fe820..22186aaa1c121f7b7f32c8e075a7a4be0abd0cb9 100644 (file)
@@ -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);
index 11b81e9248ebe97ea3a886039ef8d55bac2949f4..966506968c2a6b86a221f00ccda6f7b1d2e5af97 100644 (file)
@@ -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.