]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/cyrus.c
ITS#6684
[openldap] / libraries / libldap / cyrus.c
index 5843f0c08e2129779753af3acab5d2375dcb2acf..9bd5938dc400d23c4fc716dbb44eeda648b40bcf 100644 (file)
@@ -410,9 +410,7 @@ ldap_int_sasl_bind(
        }
 
        rc = 0;
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_lock( &ld->ld_req_mutex );
-#endif
+       LDAP_MUTEX_LOCK( &ld->ld_req_mutex );
        ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_GET_FD, &sd );
 
        if ( sd == AC_SOCKET_INVALID ) {
@@ -430,9 +428,7 @@ ldap_int_sasl_bind(
                        }
                }
        }   
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
-#endif
+       LDAP_MUTEX_UNLOCK( &ld->ld_req_mutex );
        if( rc != 0 ) return ld->ld_errno;
 
        oldctx = ld->ld_defconn->lconn_sasl_authctx;
@@ -1042,6 +1038,25 @@ ldap_int_sasl_get_option( LDAP *ld, int option, void *arg )
                        /* this option is write only */
                        return -1;
 
+#ifdef SASL_GSS_CREDS
+               case LDAP_OPT_X_SASL_GSS_CREDS: {
+                       sasl_conn_t *ctx;
+                       int sc;
+
+                       if ( ld->ld_defconn == NULL )
+                               return -1;
+
+                       ctx = ld->ld_defconn->lconn_sasl_authctx;
+                       if ( ctx == NULL )
+                               return -1;
+
+                       sc = sasl_getprop( ctx, SASL_GSS_CREDS, arg );
+                       if ( sc != SASL_OK )
+                               return -1;
+                       }
+                       break;
+#endif
+
                default:
                        return -1;
        }
@@ -1124,6 +1139,25 @@ ldap_int_sasl_set_option( LDAP *ld, int option, void *arg )
                return sc == LDAP_SUCCESS ? 0 : -1;
                }
 
+#ifdef SASL_GSS_CREDS
+       case LDAP_OPT_X_SASL_GSS_CREDS: {
+               sasl_conn_t *ctx;
+               int sc;
+
+               if ( ld->ld_defconn == NULL )
+                       return -1;
+
+               ctx = ld->ld_defconn->lconn_sasl_authctx;
+               if ( ctx == NULL )
+                       return -1;
+
+               sc = sasl_setprop( ctx, SASL_GSS_CREDS, arg );
+               if ( sc != SASL_OK )
+                       return -1;
+               }
+               break;
+#endif
+
        default:
                return -1;
        }