]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Limit the message types we call ldap_result for
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 13 Apr 2017 16:13:17 +0000 (12:13 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 13 Apr 2017 16:13:17 +0000 (12:13 -0400)
src/lib/ldap/.gitignore [new file with mode: 0644]
src/lib/ldap/all.mk [deleted file]
src/lib/ldap/libfreeradius-ldap.c

diff --git a/src/lib/ldap/.gitignore b/src/lib/ldap/.gitignore
new file mode 100644 (file)
index 0000000..01a5daa
--- /dev/null
@@ -0,0 +1 @@
+all.mk
diff --git a/src/lib/ldap/all.mk b/src/lib/ldap/all.mk
deleted file mode 100644 (file)
index 9a13798..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-TARGETNAME     := libfreeradius-ldap
-
-ifneq "$(TARGETNAME)" ""
-TARGET         := $(TARGETNAME).a
-endif
-
-SOURCES                := libfreeradius-ldap.c control.c directory.c edir.c util.c 
-
-SRC_CFLAGS     :=     
-TGT_LDLIBS     :=  -llber  -lldap 
index 3ff93cfe7c15af91b65fafe50d832a12dc7e394d..0b9ba7c65e26d708193c314074e4601f4bcdcf7f 100644 (file)
@@ -252,16 +252,28 @@ ldap_rcode_t fr_ldap_result(ldap_handle_t const *conn,
         *      ldap_result returns -1 on failure, and 0 on timeout
         */
        lib_errno = ldap_result(conn->handle, msgid, all, &tv, result);
-       if (lib_errno == 0) {
+       switch (lib_errno) {
+       case 0:
                lib_errno = LDAP_TIMEOUT;
-
                goto process_error;
-       }
 
-       if (lib_errno == -1) {
+       case -1:
                ldap_get_option(conn->handle, LDAP_OPT_ERROR_NUMBER, &lib_errno);
-
                goto process_error;
+
+       /*
+        *      ldap_parse_result only works on:
+        *      - LDAPResult
+        *      - BindResponse
+        *      - ExtendedResponse
+        */
+       case LDAP_RES_SEARCH_RESULT:
+       case LDAP_RES_BIND:
+       case LDAP_RES_EXTENDED:
+               break;
+
+       default:
+               return LDAP_PROC_SUCCESS;
        }
 
        /*