Changeset 989 for vendor/current/source3/libads/sasl.c
- Timestamp:
- Nov 25, 2016, 8:04:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/libads/sasl.c
r988 r989 27 27 #include "system/gssapi.h" 28 28 #include "lib/param/loadparm.h" 29 #include "krb5_env.h" 29 30 30 31 #ifdef HAVE_LDAP … … 697 698 int rc, i; 698 699 ADS_STATUS status; 699 DATA_BLOB blob ;700 DATA_BLOB blob = data_blob_null; 700 701 char *given_principal = NULL; 701 702 char *OIDs[ASN1_MAX_OIDS]; … … 749 750 got_kerberos_mechanism) 750 751 { 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 } 762 768 763 769 status = ADS_ERROR_KRB5(ads_kinit_password(ads)); … … 793 799 ads_free_service_principal(&p); 794 800 TALLOC_FREE(frame); 801 if (blob.data != NULL) { 802 data_blob_free(&blob); 803 } 795 804 return status; 796 805 } … … 1019 1028 } 1020 1029 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 } 1029 1041 1030 1042 status = ADS_ERROR_KRB5(ads_kinit_password(ads));
Note:
See TracChangeset
for help on using the changeset viewer.