]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backend.c
cleanup bind
[openldap] / servers / slapd / backend.c
index 2d7c040baacb2c4026c4be91fec7afc3dbbd8dfe..637a1dfc31559ca78458fdecac31221459512ff0 100644 (file)
@@ -967,7 +967,7 @@ backend_check_restrictions(
                        }
 
 #ifdef SLAP_X_LISTENER_MOD
-                       if ( ! ( conn->c_listener->sl_perms & S_IWUSR ) ) {
+                       if ( conn->c_listener && ! ( conn->c_listener->sl_perms & S_IWUSR ) ) {
                                /* no "w" mode means readonly */
                                *text = "modifications not allowed on this listener";
                                return LDAP_UNWILLING_TO_PERFORM;
@@ -1026,7 +1026,7 @@ backend_check_restrictions(
 
 #ifdef SLAP_X_LISTENER_MOD
                if ( !starttls && op->o_dn.bv_len == 0 ) {
-                       if ( ! ( conn->c_listener->sl_perms & S_IXUSR ) ) {
+                       if ( conn->c_listener && ! ( conn->c_listener->sl_perms & S_IXUSR ) ) {
                                /* no "x" mode means bind required */
                                *text = "bind required on this listener";
                                return LDAP_STRONG_AUTH_REQUIRED;
@@ -1034,7 +1034,7 @@ backend_check_restrictions(
                }
 
                if ( !starttls && !updateop ) {
-                       if ( ! ( conn->c_listener->sl_perms & S_IRUSR ) ) {
+                       if ( conn->c_listener && ! ( conn->c_listener->sl_perms & S_IRUSR ) ) {
                                /* no "r" mode means no read */
                                *text = "read not allowed on this listener";
                                return LDAP_UNWILLING_TO_PERFORM;