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

Location:
vendor/current/source3/libads
Files:
4 edited

Legend:

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

    r988 r989  
    118118                                           state->servers[i],
    119119                                           &state->cldap[i]);
    120                 if (tevent_req_nterror(req, status)) {
    121                         return tevent_req_post(req, ev);
     120                if (!NT_STATUS_IS_OK(status)) {
     121                        /*
     122                         * Don't error out all sends just
     123                         * because one cldap_socket_init() failed.
     124                         * Log it here, and the cldap_netlogon_send()
     125                         * will catch it (with in.dest_address == NULL)
     126                         * and correctly error out in
     127                         * cldap_multi_netlogon_done(). This still allows
     128                         * the other requests to be concurrently sent.
     129                         */
     130                        DBG_NOTICE("cldap_socket_init failed for %s "
     131                                " error %s\n",
     132                                tsocket_address_string(state->servers[i],
     133                                        req),
     134                                nt_errstr(status));
    122135                }
    123136
  • vendor/current/source3/libads/kerberos.c

    r988 r989  
    4848{
    4949        if (num_prompts == 0) return 0;
    50 #if HAVE_KRB5_PROMPT_TYPE
    51 
    52         /*
    53          * only heimdal has a prompt type and we need to deal with it here to
    54          * avoid loops.
    55          *
    56          * removing the prompter completely is not an option as at least these
    57          * versions would crash: heimdal-1.0.2 and heimdal-1.1. Later heimdal
    58          * version have looping detection and return with a proper error code.
    59          */
    60 
    61         if ((num_prompts == 2) &&
    62             (prompts[0].type == KRB5_PROMPT_TYPE_NEW_PASSWORD) &&
    63             (prompts[1].type == KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN)) {
     50        if (num_prompts == 2) {
    6451                /*
    65                  * We don't want to change passwords here. We're
    66                  * called from heimal when the KDC returns
    67                  * KRB5KDC_ERR_KEY_EXPIRED, but at this point we don't
    68                  * have the chance to ask the user for a new
    69                  * password. If we return 0 (i.e. success), we will be
    70                  * spinning in the endless for-loop in
    71                  * change_password() in
    72                  * source4/heimdal/lib/krb5/init_creds_pw.c:526ff
     52                 * only heimdal has a prompt type and we need to deal with it here to
     53                 * avoid loops.
     54                 *
     55                 * removing the prompter completely is not an option as at least these
     56                 * versions would crash: heimdal-1.0.2 and heimdal-1.1. Later heimdal
     57                 * version have looping detection and return with a proper error code.
    7358                 */
    74                 return KRB5KDC_ERR_KEY_EXPIRED;
    75         }
    76 #endif /* HAVE_KRB5_PROMPT_TYPE */
     59
     60#if HAVE_KRB5_PROMPT_TYPE /* Heimdal */
     61                 if (prompts[0].type == KRB5_PROMPT_TYPE_NEW_PASSWORD &&
     62                     prompts[1].type == KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN) {
     63                        /*
     64                         * We don't want to change passwords here. We're
     65                         * called from heimal when the KDC returns
     66                         * KRB5KDC_ERR_KEY_EXPIRED, but at this point we don't
     67                         * have the chance to ask the user for a new
     68                         * password. If we return 0 (i.e. success), we will be
     69                         * spinning in the endless for-loop in
     70                         * change_password() in
     71                         * source4/heimdal/lib/krb5/init_creds_pw.c:526ff
     72                         */
     73                        return KRB5KDC_ERR_KEY_EXPIRED;
     74                }
     75#elif defined(HAVE_KRB5_GET_PROMPT_TYPES) /* MIT */
     76                krb5_prompt_type *prompt_types = NULL;
     77
     78                prompt_types = krb5_get_prompt_types(ctx);
     79                if (prompt_types != NULL) {
     80                        if (prompt_types[0] == KRB5_PROMPT_TYPE_NEW_PASSWORD &&
     81                            prompt_types[1] == KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN) {
     82                                return KRB5KDC_ERR_KEY_EXP;
     83                        }
     84                }
     85#endif
     86        }
     87
    7788        memset(prompts[0].reply->data, '\0', prompts[0].reply->length);
    7889        if (prompts[0].reply->length > 0) {
  • vendor/current/source3/libads/kerberos_keytab.c

    r988 r989  
    745745        TALLOC_FREE(frame);
    746746
    747         {
     747        if (context) {
    748748                krb5_keytab_entry zero_kt_entry;
     749                krb5_kt_cursor zero_csr;
     750
    749751                ZERO_STRUCT(zero_kt_entry);
     752                ZERO_STRUCT(zero_csr);
     753
    750754                if (memcmp(&zero_kt_entry, &kt_entry,
    751755                                sizeof(krb5_keytab_entry))) {
    752756                        smb_krb5_kt_free_entry(context, &kt_entry);
    753757                }
    754         }
    755         {
    756                 krb5_kt_cursor zero_csr;
    757                 ZERO_STRUCT(zero_csr);
    758758                if ((memcmp(&cursor, &zero_csr,
    759759                                sizeof(krb5_kt_cursor)) != 0) && keytab) {
    760760                        krb5_kt_end_seq_get(context, keytab, &cursor);
    761761                }
    762         }
    763         if (keytab) {
    764                 krb5_kt_close(context, keytab);
    765         }
    766         if (context) {
     762                if (keytab) {
     763                        krb5_kt_close(context, keytab);
     764                }
    767765                krb5_free_context(context);
    768766        }
  • 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.