Ignore:
Timestamp:
Aug 2, 2010, 6:40:21 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.5: vendor update to 3.5.4

Location:
vendor/current/source3/passdb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/passdb/login_cache.c

    r414 r478  
    7070        LOGIN_CACHE *entry;
    7171        uint32_t entry_timestamp = 0, bad_password_time = 0;
     72        uint16_t acct_ctrl;
    7273
    7374        if (!login_cache_init())
     
    9899        if (tdb_unpack (databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT,
    99100                        &entry_timestamp,
    100                         &entry->acct_ctrl,
     101                        &acct_ctrl,
    101102                        &entry->bad_password_count,
    102103                        &bad_password_time) == -1) {
     
    106107                return NULL;
    107108        }
     109
     110        /*
     111         * Deal with 32-bit acct_ctrl. In the tdb we only store 16-bit
     112         * ("w" in SAM_CACHE_FORMAT). Fixes bug 7253.
     113         */
     114        entry->acct_ctrl = acct_ctrl;
    108115
    109116        /* Deal with possible 64-bit time_t. */
  • vendor/current/source3/passdb/pdb_ldap.c

    r414 r478  
    11081108                        store_gid_sid_cache(primary_gsid,
    11091109                                            sampass->unix_pw->pw_gid);
    1110                         idmap_cache_set_sid2uid(primary_gsid,
     1110                        idmap_cache_set_sid2gid(primary_gsid,
    11111111                                                sampass->unix_pw->pw_gid);
    11121112                }
     
    44434443        state->current_entry = ldap_first_entry(ld, state->entries);
    44444444
    4445         if (state->current_entry == NULL) {
    4446                 ldap_msgfree(state->entries);
    4447                 state->entries = NULL;
    4448                 return false;
    4449         }
    4450 
    44514445        return True;
    44524446}
     
    44914485
    44924486 retry:
     4487        if (state->current_entry == NULL) {
     4488                return false;
     4489        }
     4490
    44934491        if ((state->entries == NULL) && (state->pagedresults_cookie == NULL))
    44944492                return False;
  • vendor/current/source3/passdb/secrets.c

    r414 r478  
    325325
    326326/**
     327 * Form a key for fetching the machine previous trust account password
     328 *
     329 * @param domain domain name
     330 *
     331 * @return keystring
     332 **/
     333static const char *machine_prev_password_keystr(const char *domain)
     334{
     335        char *keystr;
     336
     337        keystr = talloc_asprintf_strupper_m(talloc_tos(), "%s/%s",
     338                                            SECRETS_MACHINE_PASSWORD_PREV, domain);
     339        SMB_ASSERT(keystr != NULL);
     340        return keystr;
     341}
     342
     343/**
    327344 * Form a key for fetching the machine trust account password
    328345 *
     
    572589
    573590/************************************************************************
    574  Routine to delete the plaintext machine account password
     591 Routine to delete the old plaintext machine account password if any
     592************************************************************************/
     593
     594static bool secrets_delete_prev_machine_password(const char *domain)
     595{
     596        char *oldpass = (char *)secrets_fetch(machine_prev_password_keystr(domain), NULL);
     597        if (oldpass == NULL) {
     598                return true;
     599        }
     600        SAFE_FREE(oldpass);
     601        return secrets_delete(machine_prev_password_keystr(domain));
     602}
     603
     604/************************************************************************
     605 Routine to delete the plaintext machine account password and old
     606 password if any
    575607************************************************************************/
    576608
    577609bool secrets_delete_machine_password(const char *domain)
    578610{
     611        if (!secrets_delete_prev_machine_password(domain)) {
     612                return false;
     613        }
    579614        return secrets_delete(machine_password_keystr(domain));
    580615}
    581616
    582617/************************************************************************
    583  Routine to delete the plaintext machine account password, sec channel type and
    584  last change time from secrets database
     618 Routine to delete the plaintext machine account password, old password,
     619 sec channel type and last change time from secrets database
    585620************************************************************************/
    586621
    587622bool secrets_delete_machine_password_ex(const char *domain)
    588623{
     624        if (!secrets_delete_prev_machine_password(domain)) {
     625                return false;
     626        }
    589627        if (!secrets_delete(machine_password_keystr(domain))) {
    590628                return false;
     
    606644
    607645/************************************************************************
     646 Routine to store the previous machine password (by storing the current password
     647 as the old)
     648************************************************************************/
     649
     650static bool secrets_store_prev_machine_password(const char *domain)
     651{
     652        char *oldpass;
     653        bool ret;
     654
     655        oldpass = (char *)secrets_fetch(machine_password_keystr(domain), NULL);
     656        if (oldpass == NULL) {
     657                return true;
     658        }
     659        ret = secrets_store(machine_prev_password_keystr(domain), oldpass, strlen(oldpass)+1);
     660        SAFE_FREE(oldpass);
     661        return ret;
     662}
     663
     664/************************************************************************
    608665 Routine to set the plaintext machine account password for a realm
    609 the password is assumed to be a null terminated ascii string
     666 the password is assumed to be a null terminated ascii string.
     667 Before storing
    610668************************************************************************/
    611669
     
    617675        uint32 sec_channel_type;
    618676
     677        if (!secrets_store_prev_machine_password(domain)) {
     678                return false;
     679        }
     680
    619681        ret = secrets_store(machine_password_keystr(domain), pass, strlen(pass)+1);
    620682        if (!ret)
     
    628690
    629691        return ret;
     692}
     693
     694
     695/************************************************************************
     696 Routine to fetch the previous plaintext machine account password for a realm
     697 the password is assumed to be a null terminated ascii string.
     698************************************************************************/
     699
     700char *secrets_fetch_prev_machine_password(const char *domain)
     701{
     702        return (char *)secrets_fetch(machine_prev_password_keystr(domain), NULL);
    630703}
    631704
Note: See TracChangeset for help on using the changeset viewer.