Changeset 223 for branches/samba-3.3.x/source/utils
- Timestamp:
- May 24, 2009, 7:51:24 AM (16 years ago)
- 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 339 339 &service); 340 340 if (!W_ERROR_IS_OK(werr)) { 341 goto done;341 goto cancel; 342 342 } 343 343 werr = import_process_service(c, conf_ctx, service); 344 344 if (!W_ERROR_IS_OK(werr)) { 345 goto done;345 goto cancel; 346 346 } 347 347 } else { … … 353 353 &services); 354 354 if (!W_ERROR_IS_OK(werr)) { 355 goto done;355 goto cancel; 356 356 } 357 357 if (!c->opt_testmode) { 358 358 werr = smbconf_drop(conf_ctx); 359 359 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 363 379 for (sidx = 0; sidx < num_shares; sidx++) { 364 380 werr = import_process_service(c, conf_ctx, 365 381 services[sidx]); 366 382 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)); 367 394 goto done; 368 395 } 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 415 cancel: 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 } 373 421 374 422 done: -
branches/samba-3.3.x/source/utils/net_rpc_registry.c
r206 r223 972 972 REGF_NK_REC *key, *subkey; 973 973 REGVAL_CTR *values = NULL; 974 REGSUBKEY_CTR*subkeys = NULL;974 struct regsubkey_ctr *subkeys = NULL; 975 975 int i; 976 976 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))); 980 983 return false; 981 984 } … … 994 997 } 995 998 996 /* copy subkeys into the REGSUBKEY_CTR*/999 /* copy subkeys into the struct regsubkey_ctr */ 997 1000 998 1001 while ( (subkey = regfio_fetch_subkey( infile, nk )) ) { -
branches/samba-3.3.x/source/utils/profiles.c
r221 r223 119 119 SEC_DESC *new_sd; 120 120 REGVAL_CTR *values; 121 REGSUBKEY_CTR*subkeys;121 struct regsubkey_ctr *subkeys; 122 122 int i; 123 123 char *path; 124 WERROR werr; 124 125 125 126 /* swap out the SIDs in the security descriptor */ … … 133 134 swap_sid_in_acl( new_sd, &old_sid, &new_sid ); 134 135 135 if ( !(subkeys = TALLOC_ZERO_P( NULL, REGSUBKEY_CTR )) ) { 136 werr = regsubkey_ctr_init(NULL, &subkeys); 137 if (!W_ERROR_IS_OK(werr)) { 136 138 DEBUG(0,("copy_registry_tree: talloc() failure!\n")); 137 139 return False; … … 151 153 } 152 154 153 /* copy subkeys into the REGSUBKEY_CTR*/155 /* copy subkeys into the struct regsubkey_ctr */ 154 156 155 157 while ( (subkey = regfio_fetch_subkey( infile, nk )) ) {
Note:
See TracChangeset
for help on using the changeset viewer.