Ignore:
Timestamp:
May 26, 2009, 9:44:50 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.6

Location:
branches/samba-3.2.x/source/nsswitch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/nsswitch/libwbclient/wbc_sid.c

    r141 r228  
    4141        int i;
    4242        char *tmp = NULL;
    43         TALLOC_CTX *ctx = NULL;
    4443
    4544        if (!sid) {
     
    4746                BAIL_ON_WBC_ERROR(wbc_status);
    4847        }
    49 
    50         ctx = talloc_init("wbcSidToString");
    51         BAIL_ON_PTR_ERROR(ctx, wbc_status);
    5248
    5349        id_auth = sid->id_auth[5] +
     
    5652                (sid->id_auth[2] << 24);
    5753
    58         tmp = talloc_asprintf(ctx, "S-%d-%d", sid->sid_rev_num, id_auth);
     54        tmp = talloc_asprintf(NULL, "S-%d-%d", sid->sid_rev_num, id_auth);
    5955        BAIL_ON_PTR_ERROR(tmp, wbc_status);
    6056
     
    6763        }
    6864
    69         *sid_string=talloc_strdup(NULL, tmp);
    70         BAIL_ON_PTR_ERROR((*sid_string), wbc_status);
     65        *sid_string = tmp;
     66        tmp = NULL;
    7167
    7268        wbc_status = WBC_ERR_SUCCESS;
    7369
    7470done:
    75         talloc_free(ctx);
     71        talloc_free(tmp);
    7672
    7773        return wbc_status;
  • branches/samba-3.2.x/source/nsswitch/pam_winbind.c

    r141 r228  
    23592359
    23602360out:
     2361        /*
     2362         * Delete the krb5 ccname variable from the PAM environment
     2363         * if it was set by winbind.
     2364         */
     2365        if (ctx->ctrl & WINBIND_KRB5_AUTH) {
     2366                pam_putenv(pamh, "KRB5CCNAME");
     2367        }
    23612368
    23622369        _PAM_LOG_FUNCTION_LEAVE("pam_sm_close_session", ctx, retval);
  • branches/samba-3.2.x/source/nsswitch/winbind_struct_protocol.h

    r133 r228  
    203203/* Flag to say this is a winbindd internal send - don't recurse. */
    204204#define WBFLAG_RECURSE                  0x00000800
    205 
     205/* Flag to tell winbind the NTLMv2 blob is too big for the struct and is in the
     206 * extra_data field */
     207#define WBFLAG_BIG_NTLMV2_BLOB          0x00010000
    206208
    207209#define WINBINDD_MAX_EXTRA_DATA (128*1024)
  • branches/samba-3.2.x/source/nsswitch/wins.c

    r136 r228  
    2424
    2525#include <ns_daemon.h>
     26#endif
     27
     28#if HAVE_PTHREAD_H
     29#include <pthread.h>
     30#endif
     31
     32#if HAVE_PTHREAD
     33static pthread_mutex_t wins_nss_mutex = PTHREAD_MUTEX_INITIALIZER;
    2634#endif
    2735
     
    322330                          char *buffer, size_t buflen, int *h_errnop)
    323331{
     332        NSS_STATUS nss_status = NSS_STATUS_SUCCESS;
    324333        struct in_addr *ip_list;
    325334        int i, count;
     
    327336        size_t namelen;
    328337               
     338#if HAVE_PTHREAD
     339        pthread_mutex_lock(&wins_nss_mutex);
     340#endif
     341
    329342        memset(he, '\0', sizeof(*he));
    330343        fstrcpy(name, hostname);
     
    334347        ip_list = lookup_byname_backend(name, &count);
    335348
    336         if (!ip_list)
    337                 return NSS_STATUS_NOTFOUND;
     349        if (!ip_list) {
     350                nss_status = NSS_STATUS_NOTFOUND;
     351                goto out;
     352        }
    338353
    339354        /* Copy h_name */
     
    343358        if ((he->h_name = get_static(&buffer, &buflen, namelen)) == NULL) {
    344359                free(ip_list);
    345                 return NSS_STATUS_TRYAGAIN;
     360                nss_status = NSS_STATUS_TRYAGAIN;
     361                goto out;
    346362        }
    347363
     
    355371        if (get_static(&buffer, &buflen, i) == NULL) {
    356372                free(ip_list);
    357                 return NSS_STATUS_TRYAGAIN;
     373                nss_status = NSS_STATUS_TRYAGAIN;
     374                goto out;
    358375        }
    359376
     
    361378                     &buffer, &buflen, (count + 1) * sizeof(char *))) == NULL) {
    362379                free(ip_list);
    363                 return NSS_STATUS_TRYAGAIN;
     380                nss_status = NSS_STATUS_TRYAGAIN;
     381                goto out;
    364382        }
    365383
     
    368386                                                     INADDRSZ)) == NULL) {
    369387                        free(ip_list);
    370                         return NSS_STATUS_TRYAGAIN;
     388                        nss_status = NSS_STATUS_TRYAGAIN;
     389                        goto out;
    371390                }
    372391                memcpy(he->h_addr_list[i], &ip_list[i], INADDRSZ);
     
    387406                i = sizeof(char*) - i;
    388407
    389         if (get_static(&buffer, &buflen, i) == NULL)
    390                 return NSS_STATUS_TRYAGAIN;
     408        if (get_static(&buffer, &buflen, i) == NULL) {
     409                nss_status = NSS_STATUS_TRYAGAIN;
     410                goto out;
     411        }
    391412
    392413        if ((he->h_aliases = (char **)get_static(
    393                      &buffer, &buflen, sizeof(char *))) == NULL)
    394                 return NSS_STATUS_TRYAGAIN;
     414                     &buffer, &buflen, sizeof(char *))) == NULL) {
     415                nss_status = NSS_STATUS_TRYAGAIN;
     416                goto out;
     417        }
    395418
    396419        he->h_aliases[0] = NULL;
    397420
    398         return NSS_STATUS_SUCCESS;
     421        nss_status = NSS_STATUS_SUCCESS;
     422
     423  out:
     424
     425#if HAVE_PTHREAD
     426        pthread_mutex_unlock(&wins_nss_mutex);
     427#endif
     428        return nss_status;
    399429}
    400430
     
    404434                           char *buffer, size_t buflen, int *h_errnop)
    405435{
     436        NSS_STATUS nss_status;
     437
    406438        if(af!=AF_INET) {
    407439                *h_errnop = NO_DATA;
    408                 return NSS_STATUS_UNAVAIL;
    409         }
    410 
    411         return _nss_wins_gethostbyname_r(
    412                 name, he, buffer, buflen, h_errnop);
    413 }
    414 #endif
     440                nss_status = NSS_STATUS_UNAVAIL;
     441        } else {
     442                nss_status = _nss_wins_gethostbyname_r(
     443                                name, he, buffer, buflen, h_errnop);
     444        }
     445        return nss_status;
     446}
     447#endif
Note: See TracChangeset for help on using the changeset viewer.