Ignore:
Timestamp:
Nov 25, 2016, 8:04:54 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/libads/sasl.c

    r988 r989  
    2727#include "system/gssapi.h"
    2828#include "lib/param/loadparm.h"
     29#include "krb5_env.h"
    2930
    3031#ifdef HAVE_LDAP
     
    697698        int rc, i;
    698699        ADS_STATUS status;
    699         DATA_BLOB blob;
     700        DATA_BLOB blob = data_blob_null;
    700701        char *given_principal = NULL;
    701702        char *OIDs[ASN1_MAX_OIDS];
     
    749750            got_kerberos_mechanism)
    750751        {
    751                 status = ads_sasl_spnego_gensec_bind(ads, "GSS-SPNEGO",
    752                                                      CRED_MUST_USE_KERBEROS,
    753                                                      p.service, p.hostname,
    754                                                      blob);
    755                 if (ADS_ERR_OK(status)) {
    756                         ads_free_service_principal(&p);
    757                         goto done;
    758                 }
    759 
    760                 DEBUG(10,("ads_sasl_spnego_gensec_bind(KRB5) failed with: %s, "
    761                           "calling kinit\n", ads_errstr(status)));
     752                if (ads->auth.password == NULL ||
     753                    ads->auth.password[0] == '\0')
     754                {
     755
     756                        status = ads_sasl_spnego_gensec_bind(ads, "GSS-SPNEGO",
     757                                                             CRED_MUST_USE_KERBEROS,
     758                                                             p.service, p.hostname,
     759                                                             blob);
     760                        if (ADS_ERR_OK(status)) {
     761                                ads_free_service_principal(&p);
     762                                goto done;
     763                        }
     764
     765                        DEBUG(10,("ads_sasl_spnego_gensec_bind(KRB5) failed with: %s, "
     766                                  "calling kinit\n", ads_errstr(status)));
     767                }
    762768
    763769                status = ADS_ERROR_KRB5(ads_kinit_password(ads));
     
    793799        ads_free_service_principal(&p);
    794800        TALLOC_FREE(frame);
     801        if (blob.data != NULL) {
     802                data_blob_free(&blob);
     803        }
    795804        return status;
    796805}
     
    10191028        }
    10201029
    1021         status = ads_sasl_gssapi_do_bind(ads, p.name);
    1022         if (ADS_ERR_OK(status)) {
    1023                 ads_free_service_principal(&p);
    1024                 return status;
    1025         }
    1026 
    1027         DEBUG(10,("ads_sasl_gssapi_do_bind failed with: %s, "
    1028                   "calling kinit\n", ads_errstr(status)));
     1030        if (ads->auth.password == NULL ||
     1031            ads->auth.password[0] == '\0') {
     1032                status = ads_sasl_gssapi_do_bind(ads, p.name);
     1033                if (ADS_ERR_OK(status)) {
     1034                        ads_free_service_principal(&p);
     1035                        return status;
     1036                }
     1037
     1038                DEBUG(10,("ads_sasl_gssapi_do_bind failed with: %s, "
     1039                          "calling kinit\n", ads_errstr(status)));
     1040        }
    10291041
    10301042        status = ADS_ERROR_KRB5(ads_kinit_password(ads));
Note: See TracChangeset for help on using the changeset viewer.