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

Update 3.2 branch to 3.2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/lib/util_pw.c

    r133 r228  
    4545struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name)
    4646{
    47         struct passwd *temp, *cached;
     47        struct passwd *pw, *for_cache;
    4848
    49         temp = (struct passwd *)memcache_lookup_talloc(
     49        pw = (struct passwd *)memcache_lookup_talloc(
    5050                NULL, GETPWNAM_CACHE, data_blob_string_const(name));
    51         if (temp != NULL) {
    52                 return tcopy_passwd(mem_ctx, temp);
     51        if (pw != NULL) {
     52                return tcopy_passwd(mem_ctx, pw);
    5353        }
    5454
    55         temp = sys_getpwnam(name);
    56         if (temp == NULL) {
     55        pw = sys_getpwnam(name);
     56        if (pw == NULL) {
    5757                return NULL;
    5858        }
    5959
    60         cached = tcopy_passwd(NULL, temp);
    61         if (cached == NULL) {
    62                 /*
    63                  * Just don't add this into the cache, ignore the failure
    64                  */
    65                 return temp;
     60        for_cache = tcopy_passwd(NULL, pw);
     61        if (for_cache == NULL) {
     62                return NULL;
    6663        }
    6764
    6865        memcache_add_talloc(NULL, GETPWNAM_CACHE, data_blob_string_const(name),
    69                             cached);
    70         return tcopy_passwd(mem_ctx, temp);
     66                            &for_cache);
     67
     68        return tcopy_passwd(mem_ctx, pw);
    7169}
    7270
Note: See TracChangeset for help on using the changeset viewer.