Changeset 221 for branches/samba-3.3.x/source/libnet
- Timestamp:
- May 24, 2009, 7:17:10 AM (16 years ago)
- Location:
- branches/samba-3.3.x/source/libnet
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/libnet/libnet_join.c
r206 r221 791 791 status = rpccli_samr_Connect2(pipe_hnd, mem_ctx, 792 792 pipe_hnd->desthost, 793 SEC_RIGHTS_MAXIMUM_ALLOWED, 793 SAMR_ACCESS_ENUM_DOMAINS 794 | SAMR_ACCESS_OPEN_DOMAIN, 794 795 &sam_pol); 795 796 if (!NT_STATUS_IS_OK(status)) { … … 799 800 status = rpccli_samr_OpenDomain(pipe_hnd, mem_ctx, 800 801 &sam_pol, 801 SEC_RIGHTS_MAXIMUM_ALLOWED, 802 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1 803 | SAMR_DOMAIN_ACCESS_CREATE_USER 804 | SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, 802 805 r->out.domain_sid, 803 806 &domain_pol); -
branches/samba-3.3.x/source/libnet/libnet_samsync_keytab.c
r206 r221 112 112 krb5_error_code ret = 0; 113 113 NTSTATUS status; 114 struct libnet_keytab_context *keytab_ctx ;114 struct libnet_keytab_context *keytab_ctx = NULL; 115 115 struct libnet_keytab_entry *entry; 116 116 uint64_t old_sequence_num = 0; -
branches/samba-3.3.x/source/libnet/libnet_samsync_ldif.c
r206 r221 346 346 groupmap[0].group_dn = talloc_asprintf(mem_ctx, 347 347 "cn=Domain Admins,ou=%s,%s", group_attr, suffix); 348 NT_STATUS_HAVE_NO_MEMORY(groupmap[0].sambaSID); 349 NT_STATUS_HAVE_NO_MEMORY(groupmap[0].group_dn); 348 if (groupmap[0].sambaSID == NULL || groupmap[0].group_dn == NULL) { 349 goto err; 350 } 350 351 351 352 accountmap[0].rid = 512; 352 353 accountmap[0].cn = talloc_strdup(mem_ctx, "Domain Admins"); 353 NT_STATUS_HAVE_NO_MEMORY(accountmap[0].cn); 354 if (accountmap[0].cn == NULL) { 355 goto err; 356 } 354 357 355 358 groupmap[1].rid = 513; … … 358 361 groupmap[1].group_dn = talloc_asprintf(mem_ctx, 359 362 "cn=Domain Users,ou=%s,%s", group_attr, suffix); 360 NT_STATUS_HAVE_NO_MEMORY(groupmap[1].sambaSID); 361 NT_STATUS_HAVE_NO_MEMORY(groupmap[1].group_dn); 363 if (groupmap[1].sambaSID == NULL || groupmap[1].group_dn == NULL) { 364 goto err; 365 } 362 366 363 367 accountmap[1].rid = 513; 364 368 accountmap[1].cn = talloc_strdup(mem_ctx, "Domain Users"); 365 NT_STATUS_HAVE_NO_MEMORY(accountmap[1].cn); 369 if (accountmap[1].cn == NULL) { 370 goto err; 371 } 366 372 367 373 groupmap[2].rid = 514; … … 370 376 groupmap[2].group_dn = talloc_asprintf(mem_ctx, 371 377 "cn=Domain Guests,ou=%s,%s", group_attr, suffix); 372 NT_STATUS_HAVE_NO_MEMORY(groupmap[2].sambaSID); 373 NT_STATUS_HAVE_NO_MEMORY(groupmap[2].group_dn); 378 if (groupmap[2].sambaSID == NULL || groupmap[2].group_dn == NULL) { 379 goto err; 380 } 374 381 375 382 accountmap[2].rid = 514; 376 383 accountmap[2].cn = talloc_strdup(mem_ctx, "Domain Guests"); 377 NT_STATUS_HAVE_NO_MEMORY(accountmap[2].cn); 384 if (accountmap[2].cn == NULL) { 385 goto err; 386 } 378 387 379 388 groupmap[3].rid = 515; … … 382 391 groupmap[3].group_dn = talloc_asprintf(mem_ctx, 383 392 "cn=Domain Computers,ou=%s,%s", group_attr, suffix); 384 NT_STATUS_HAVE_NO_MEMORY(groupmap[3].sambaSID); 385 NT_STATUS_HAVE_NO_MEMORY(groupmap[3].group_dn); 393 if (groupmap[3].sambaSID == NULL || groupmap[3].group_dn == NULL) { 394 goto err; 395 } 386 396 387 397 accountmap[3].rid = 515; 388 398 accountmap[3].cn = talloc_strdup(mem_ctx, "Domain Computers"); 389 NT_STATUS_HAVE_NO_MEMORY(accountmap[3].cn); 399 if (accountmap[3].cn == NULL) { 400 goto err; 401 } 390 402 391 403 groupmap[4].rid = 544; … … 394 406 groupmap[4].group_dn = talloc_asprintf(mem_ctx, 395 407 "cn=Administrators,ou=%s,%s", group_attr, suffix); 396 NT_STATUS_HAVE_NO_MEMORY(groupmap[4].sambaSID); 397 NT_STATUS_HAVE_NO_MEMORY(groupmap[4].group_dn); 408 if (groupmap[4].sambaSID == NULL || groupmap[4].group_dn == NULL) { 409 goto err; 410 } 398 411 399 412 accountmap[4].rid = 515; 400 413 accountmap[4].cn = talloc_strdup(mem_ctx, "Administrators"); 401 NT_STATUS_HAVE_NO_MEMORY(accountmap[4].cn); 414 if (accountmap[4].cn == NULL) { 415 goto err; 416 } 402 417 403 418 groupmap[5].rid = 550; … … 406 421 groupmap[5].group_dn = talloc_asprintf(mem_ctx, 407 422 "cn=Print Operators,ou=%s,%s", group_attr, suffix); 408 NT_STATUS_HAVE_NO_MEMORY(groupmap[5].sambaSID); 409 NT_STATUS_HAVE_NO_MEMORY(groupmap[5].group_dn); 423 if (groupmap[5].sambaSID == NULL || groupmap[5].group_dn == NULL) { 424 goto err; 425 } 410 426 411 427 accountmap[5].rid = 550; 412 428 accountmap[5].cn = talloc_strdup(mem_ctx, "Print Operators"); 413 NT_STATUS_HAVE_NO_MEMORY(accountmap[5].cn); 429 if (accountmap[5].cn == NULL) { 430 goto err; 431 } 414 432 415 433 groupmap[6].rid = 551; … … 418 436 groupmap[6].group_dn = talloc_asprintf(mem_ctx, 419 437 "cn=Backup Operators,ou=%s,%s", group_attr, suffix); 420 NT_STATUS_HAVE_NO_MEMORY(groupmap[6].sambaSID); 421 NT_STATUS_HAVE_NO_MEMORY(groupmap[6].group_dn); 438 if (groupmap[6].sambaSID == NULL || groupmap[6].group_dn == NULL) { 439 goto err; 440 } 422 441 423 442 accountmap[6].rid = 551; 424 443 accountmap[6].cn = talloc_strdup(mem_ctx, "Backup Operators"); 425 NT_STATUS_HAVE_NO_MEMORY(accountmap[6].cn); 444 if (accountmap[6].cn == NULL) { 445 goto err; 446 } 426 447 427 448 groupmap[7].rid = 552; … … 430 451 groupmap[7].group_dn = talloc_asprintf(mem_ctx, 431 452 "cn=Replicators,ou=%s,%s", group_attr, suffix); 432 NT_STATUS_HAVE_NO_MEMORY(groupmap[7].sambaSID); 433 NT_STATUS_HAVE_NO_MEMORY(groupmap[7].group_dn); 453 if (groupmap[7].sambaSID == NULL || groupmap[7].group_dn == NULL) { 454 goto err; 455 } 434 456 435 457 accountmap[7].rid = 551; 436 458 accountmap[7].cn = talloc_strdup(mem_ctx, "Replicators"); 437 NT_STATUS_HAVE_NO_MEMORY(accountmap[7].cn); 459 if (accountmap[7].cn == NULL) { 460 goto err; 461 } 438 462 439 463 SAFE_FREE(group_attr); 440 464 441 465 return NT_STATUS_OK; 466 467 err: 468 469 SAFE_FREE(group_attr); 470 return NT_STATUS_NO_MEMORY; 442 471 } 443 472 … … 543 572 groupmap->group_dn = talloc_asprintf(mem_ctx, 544 573 "cn=%s,ou=%s,%s", groupname, group_attr, suffix); 545 NT_STATUS_HAVE_NO_MEMORY(groupmap->sambaSID); 546 NT_STATUS_HAVE_NO_MEMORY(groupmap->group_dn); 574 if (groupmap->sambaSID == NULL || groupmap->group_dn == NULL) { 575 SAFE_FREE(group_attr); 576 return NT_STATUS_NO_MEMORY; 577 } 547 578 548 579 /* Write the data to the temporary add ldif file */ … … 777 808 groupmap->gidNumber = ldif_gid; 778 809 groupmap->sambaSID = talloc_asprintf(mem_ctx, "%s-%d", sid, g_rid); 779 NT_STATUS_HAVE_NO_MEMORY(groupmap->sambaSID); 810 if (groupmap->sambaSID == NULL) { 811 SAFE_FREE(group_attr); 812 return NT_STATUS_NO_MEMORY; 813 } 780 814 781 815 /* Write the data to the temporary add ldif file */
Note:
See TracChangeset
for help on using the changeset viewer.