Ignore:
Timestamp:
May 24, 2009, 7:51:24 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3 branch to 3.3.3

Location:
branches/samba-3.3.x/source/utils
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/utils/net_conf.c

    r221 r223  
    339339                                         &service);
    340340                if (!W_ERROR_IS_OK(werr)) {
    341                         goto done;
     341                        goto cancel;
    342342                }
    343343                werr = import_process_service(c, conf_ctx, service);
    344344                if (!W_ERROR_IS_OK(werr)) {
    345                         goto done;
     345                        goto cancel;
    346346                }
    347347        } else {
     
    353353                                          &services);
    354354                if (!W_ERROR_IS_OK(werr)) {
    355                         goto done;
     355                        goto cancel;
    356356                }
    357357                if (!c->opt_testmode) {
    358358                        werr = smbconf_drop(conf_ctx);
    359359                        if (!W_ERROR_IS_OK(werr)) {
    360                                 goto done;
    361                         }
    362                 }
     360                                goto cancel;
     361                        }
     362                }
     363
     364                /*
     365                 * Wrap the importing of shares into a transaction,
     366                 * but only 100 at a time, in order to serve memory.
     367                 * The allocated memory accumulates across the actions
     368                 * within the transaction, and for me, some 1500
     369                 * imported shares, the MAX_TALLOC_SIZE of 256 MB
     370                 * was exceeded.
     371                 */
     372                werr = smbconf_transaction_start(conf_ctx);
     373                if (!W_ERROR_IS_OK(werr)) {
     374                        d_printf("error starting transaction: %s\n",
     375                                 win_errstr(werr));
     376                        goto done;
     377                }
     378
    363379                for (sidx = 0; sidx < num_shares; sidx++) {
    364380                        werr = import_process_service(c, conf_ctx,
    365381                                                      services[sidx]);
    366382                        if (!W_ERROR_IS_OK(werr)) {
     383                                goto cancel;
     384                        }
     385
     386                        if (sidx % 100) {
     387                                continue;
     388                        }
     389
     390                        werr = smbconf_transaction_commit(conf_ctx);
     391                        if (!W_ERROR_IS_OK(werr)) {
     392                                d_printf("error committing transaction: %s\n",
     393                                         win_errstr(werr));
    367394                                goto done;
    368395                        }
    369                 }
    370         }
    371 
    372         ret = 0;
     396                        werr = smbconf_transaction_start(conf_ctx);
     397                        if (!W_ERROR_IS_OK(werr)) {
     398                                d_printf("error starting transaction: %s\n",
     399                                         win_errstr(werr));
     400                                goto done;
     401                        }
     402                }
     403        }
     404
     405        werr = smbconf_transaction_commit(conf_ctx);
     406        if (!W_ERROR_IS_OK(werr)) {
     407                d_printf("error committing transaction: %s\n",
     408                         win_errstr(werr));
     409        } else {
     410                ret = 0;
     411        }
     412
     413        goto done;
     414
     415cancel:
     416        werr = smbconf_transaction_cancel(conf_ctx);
     417        if (!W_ERROR_IS_OK(werr)) {
     418                d_printf("error cancelling transaction: %s\n",
     419                         win_errstr(werr));
     420        }
    373421
    374422done:
  • branches/samba-3.3.x/source/utils/net_rpc_registry.c

    r206 r223  
    972972        REGF_NK_REC *key, *subkey;
    973973        REGVAL_CTR *values = NULL;
    974         REGSUBKEY_CTR *subkeys = NULL;
     974        struct regsubkey_ctr *subkeys = NULL;
    975975        int i;
    976976        char *path = NULL;
    977 
    978         if ( !( subkeys = TALLOC_ZERO_P( infile->mem_ctx, REGSUBKEY_CTR )) ) {
    979                 DEBUG(0,("write_registry_tree: talloc() failed!\n"));
     977        WERROR werr;
     978
     979        werr = regsubkey_ctr_init(infile->mem_ctx, &subkeys);
     980        if (!W_ERROR_IS_OK(werr)) {
     981                DEBUG(0, ("write_registry_tree: regsubkey_ctr_init failed: "
     982                          "%s\n", dos_errstr(werr)));
    980983                return false;
    981984        }
     
    994997        }
    995998
    996         /* copy subkeys into the REGSUBKEY_CTR */
     999        /* copy subkeys into the struct regsubkey_ctr */
    9971000
    9981001        while ( (subkey = regfio_fetch_subkey( infile, nk )) ) {
  • branches/samba-3.3.x/source/utils/profiles.c

    r221 r223  
    119119        SEC_DESC *new_sd;
    120120        REGVAL_CTR *values;
    121         REGSUBKEY_CTR *subkeys;
     121        struct regsubkey_ctr *subkeys;
    122122        int i;
    123123        char *path;
     124        WERROR werr;
    124125
    125126        /* swap out the SIDs in the security descriptor */
     
    133134        swap_sid_in_acl( new_sd, &old_sid, &new_sid );
    134135
    135         if ( !(subkeys = TALLOC_ZERO_P( NULL, REGSUBKEY_CTR )) ) {
     136        werr = regsubkey_ctr_init(NULL, &subkeys);
     137        if (!W_ERROR_IS_OK(werr)) {
    136138                DEBUG(0,("copy_registry_tree: talloc() failure!\n"));
    137139                return False;
     
    151153        }
    152154
    153         /* copy subkeys into the REGSUBKEY_CTR */
     155        /* copy subkeys into the struct regsubkey_ctr */
    154156
    155157        while ( (subkey = regfio_fetch_subkey( infile, nk )) ) {
Note: See TracChangeset for help on using the changeset viewer.