Changeset 989 for vendor/current/source3/utils
- Timestamp:
- Nov 25, 2016, 8:04:54 PM (9 years ago)
- Location:
- vendor/current/source3/utils
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/utils/net_ads.c
r988 r989 1597 1597 } 1598 1598 1599 /* print out informative error string in case there is one */ 1600 if (r->out.error_string != NULL) { 1601 d_printf("%s\n", r->out.error_string); 1602 } 1603 1599 1604 /* 1600 1605 * We try doing the dns update (if it was compiled in -
vendor/current/source3/utils/net_printing.c
r988 r989 265 265 266 266 if (strncmp((const char *)kbuf.dptr, FORMS_PREFIX, strlen(FORMS_PREFIX)) == 0) { 267 dump_form(ctx, (const char *)kbuf.dptr+strlen(FORMS_PREFIX), dbuf.dptr, dbuf.dsize); 267 char *key_name = NULL; 268 size_t converted_size = 0; 269 bool ok; 270 271 ok = pull_ascii_talloc(ctx, 272 &key_name, 273 (const char *) kbuf.dptr + strlen(FORMS_PREFIX), 274 &converted_size); 275 if (!ok) { 276 continue; 277 } 278 279 dump_form(ctx, key_name, dbuf.dptr, dbuf.dsize); 280 TALLOC_FREE(key_name); 268 281 SAFE_FREE(dbuf.dptr); 269 282 continue; … … 271 284 272 285 if (strncmp((const char *)kbuf.dptr, DRIVERS_PREFIX, strlen(DRIVERS_PREFIX)) == 0) { 286 char *key_name = NULL; 287 size_t converted_size = 0; 288 bool ok; 289 290 ok = pull_ascii_talloc(ctx, 291 &key_name, 292 (const char *) kbuf.dptr + strlen(DRIVERS_PREFIX), 293 &converted_size); 294 if (!ok) { 295 continue; 296 } 297 273 298 dump_driver(ctx, 274 (const char *)kbuf.dptr+strlen(DRIVERS_PREFIX),299 key_name, 275 300 dbuf.dptr, 276 301 dbuf.dsize, 277 302 do_string_conversion); 303 TALLOC_FREE(key_name); 278 304 SAFE_FREE(dbuf.dptr); 279 305 continue; … … 281 307 282 308 if (strncmp((const char *)kbuf.dptr, PRINTERS_PREFIX, strlen(PRINTERS_PREFIX)) == 0) { 309 char *key_name = NULL; 310 size_t converted_size = 0; 311 bool ok; 312 313 ok = pull_ascii_talloc(ctx, 314 &key_name, 315 (const char *) kbuf.dptr + strlen(PRINTERS_PREFIX), 316 &converted_size); 317 if (!ok) { 318 continue; 319 } 320 283 321 dump_printer(ctx, 284 (const char *)kbuf.dptr+strlen(PRINTERS_PREFIX),322 key_name, 285 323 dbuf.dptr, 286 324 dbuf.dsize, 287 325 do_string_conversion); 326 TALLOC_FREE(key_name); 288 327 SAFE_FREE(dbuf.dptr); 289 328 continue; … … 358 397 359 398 if (strncmp((const char *) kbuf.dptr, FORMS_PREFIX, strlen(FORMS_PREFIX)) == 0) { 399 char *key_name = NULL; 400 size_t converted_size = 0; 401 bool ok; 402 403 ok = pull_ascii_talloc(tmp_ctx, 404 &key_name, 405 (const char *) kbuf.dptr + strlen(FORMS_PREFIX), 406 &converted_size); 407 if (!ok) { 408 continue; 409 } 410 360 411 printing_tdb_migrate_form(tmp_ctx, 361 412 winreg_pipe, 362 (const char *) kbuf.dptr + strlen(FORMS_PREFIX),413 key_name, 363 414 dbuf.dptr, 364 415 dbuf.dsize); 416 TALLOC_FREE(key_name); 365 417 SAFE_FREE(dbuf.dptr); 366 418 continue; … … 368 420 369 421 if (strncmp((const char *) kbuf.dptr, DRIVERS_PREFIX, strlen(DRIVERS_PREFIX)) == 0) { 422 char *key_name = NULL; 423 size_t converted_size = 0; 424 bool ok; 425 426 ok = pull_ascii_talloc(tmp_ctx, 427 &key_name, 428 (const char *) kbuf.dptr + strlen(DRIVERS_PREFIX), 429 &converted_size); 430 if (!ok) { 431 continue; 432 } 433 370 434 printing_tdb_migrate_driver(tmp_ctx, 371 435 winreg_pipe, 372 (const char *) kbuf.dptr + strlen(DRIVERS_PREFIX),436 key_name, 373 437 dbuf.dptr, 374 438 dbuf.dsize, 375 439 do_string_conversion); 440 TALLOC_FREE(key_name); 376 441 SAFE_FREE(dbuf.dptr); 377 442 continue; … … 379 444 380 445 if (strncmp((const char *) kbuf.dptr, PRINTERS_PREFIX, strlen(PRINTERS_PREFIX)) == 0) { 446 char *key_name = NULL; 447 size_t converted_size = 0; 448 bool ok; 449 450 ok = pull_ascii_talloc(tmp_ctx, 451 &key_name, 452 (const char *) kbuf.dptr + strlen(PRINTERS_PREFIX), 453 &converted_size); 454 if (!ok) { 455 continue; 456 } 457 381 458 printing_tdb_migrate_printer(tmp_ctx, 382 459 winreg_pipe, 383 (const char *) kbuf.dptr + strlen(PRINTERS_PREFIX),460 key_name, 384 461 dbuf.dptr, 385 462 dbuf.dsize, 386 463 do_string_conversion); 464 TALLOC_FREE(key_name); 387 465 SAFE_FREE(dbuf.dptr); 388 466 continue; -
vendor/current/source3/utils/net_rpc.c
r988 r989 429 429 } 430 430 431 /* print out informative error string in case there is one */ 432 if (r->out.error_string != NULL) { 433 d_printf("%s\n", r->out.error_string); 434 } 435 431 436 TALLOC_FREE(mem_ctx); 432 437 … … 606 611 d_printf("Joined '%s' to domain '%s'\n", r->in.machine_name, 607 612 r->out.netbios_domain_name); 613 } 614 615 /* print out informative error string in case there is one */ 616 if (r->out.error_string != NULL) { 617 d_printf("%s\n", r->out.error_string); 608 618 } 609 619 -
vendor/current/source3/utils/ntlm_auth.c
r988 r989 28 28 #include "lib/param/param.h" 29 29 #include "popt_common.h" 30 #include "libcli/security/security.h" 30 31 #include "utils/ntlm_auth.h" 31 32 #include "../libcli/auth/libcli_auth.h" … … 711 712 struct auth_session_info **session_info_out) 712 713 { 713 char *unix_username = (char *)server_returned_info; 714 struct auth_session_info *session_info = talloc_zero(mem_ctx, struct auth_session_info); 715 if (!session_info) { 714 const char *unix_username = (const char *)server_returned_info; 715 bool ok; 716 struct dom_sid *sids = NULL; 717 struct auth_session_info *session_info = NULL; 718 719 session_info = talloc_zero(mem_ctx, struct auth_session_info); 720 if (session_info == NULL) { 716 721 return NT_STATUS_NO_MEMORY; 717 722 } 718 723 719 724 session_info->unix_info = talloc_zero(session_info, struct auth_user_info_unix); 720 if ( !session_info->unix_info) {725 if (session_info->unix_info == NULL) { 721 726 TALLOC_FREE(session_info); 722 727 return NT_STATUS_NO_MEMORY; 723 728 } 724 session_info->unix_info->unix_name = talloc_steal(session_info->unix_info, unix_username); 729 session_info->unix_info->unix_name = talloc_strdup(session_info->unix_info, 730 unix_username); 731 if (session_info->unix_info->unix_name == NULL) { 732 TALLOC_FREE(session_info); 733 return NT_STATUS_NO_MEMORY; 734 } 735 736 session_info->security_token = talloc_zero(session_info, struct security_token); 737 if (session_info->security_token == NULL) { 738 TALLOC_FREE(session_info); 739 return NT_STATUS_NO_MEMORY; 740 } 741 742 sids = talloc_zero_array(session_info->security_token, 743 struct dom_sid, 3); 744 if (sids == NULL) { 745 TALLOC_FREE(session_info); 746 return NT_STATUS_NO_MEMORY; 747 } 748 ok = dom_sid_parse(SID_WORLD, &sids[0]); 749 if (!ok) { 750 TALLOC_FREE(session_info); 751 return NT_STATUS_INTERNAL_ERROR; 752 } 753 ok = dom_sid_parse(SID_NT_NETWORK, &sids[1]); 754 if (!ok) { 755 TALLOC_FREE(session_info); 756 return NT_STATUS_INTERNAL_ERROR; 757 } 758 ok = dom_sid_parse(SID_NT_AUTHENTICATED_USERS, &sids[2]); 759 if (!ok) { 760 TALLOC_FREE(session_info); 761 return NT_STATUS_INTERNAL_ERROR; 762 } 763 764 session_info->security_token->num_sids = talloc_array_length(sids); 765 session_info->security_token->sids = sids; 725 766 726 767 *session_info_out = session_info; -
vendor/current/source3/utils/smbcquotas.c
r988 r989 569 569 struct cli_state *cli; 570 570 bool fix_user = False; 571 bool ok; 571 572 SMB_NTQUOTA_STRUCT qt; 572 573 TALLOC_CTX *frame = talloc_stackframe(); … … 602 603 fault_setup(); 603 604 604 lp_load_global(get_dyn_CONFIGFILE());605 load_interfaces();606 607 605 smbcquotas_auth_info = user_auth_info_init(frame); 608 606 if (smbcquotas_auth_info == NULL) { … … 695 693 popt_burn_cmdline_password(argc, argv); 696 694 695 ok = lp_load_global(get_dyn_CONFIGFILE()); 696 if (!ok) { 697 DBG_ERR("ERROR: Loading config file %s - " 698 "run testparm to debug it\n", 699 get_dyn_CONFIGFILE()); 700 exit(EXIT_PARSE_ERROR); 701 } 702 703 /* We must load interfaces after we load the smb.conf */ 704 load_interfaces(); 705 697 706 string_replace(path, '/', '\\'); 698 707 -
vendor/current/source3/utils/smbget.c
r988 r989 106 106 static char *savedun; 107 107 static char *savedpw; 108 char tmp[128];109 108 110 109 if (hasasked) { … … 116 115 hasasked = true; 117 116 118 if (!opt.nonprompt && !opt.username_specified) { 119 printf("Username for %s at %s [guest] ", shr, srv); 120 if (fgets(tmp, sizeof(tmp), stdin) == NULL) { 121 return; 122 } 123 if ((strlen(tmp) > 0) && (tmp[strlen(tmp) - 1] == '\n')) { 124 tmp[strlen(tmp) - 1] = '\0'; 125 } 126 strncpy(un, tmp, unlen - 1); 127 } else if (opt.username != NULL) { 117 /* 118 * If no user has been specified un is initialized with the current 119 * username of the user who started smbget. 120 */ 121 if (opt.username_specified) { 128 122 strncpy(un, opt.username, unlen - 1); 129 123 } 130 124 131 if (!opt.nonprompt && !opt.password_specified ) {125 if (!opt.nonprompt && !opt.password_specified && pw[0] == '\0') { 132 126 char *prompt; 133 if (asprintf(&prompt, "Password for %s at %s: ", shr, srv) == 134 -1) { 127 int rc; 128 129 rc = asprintf(&prompt, 130 "Password for [%s] connecting to //%s/%s: ", 131 un, shr, srv); 132 if (rc == -1) { 135 133 return; 136 134 }
Note:
See TracChangeset
for help on using the changeset viewer.