Changeset 740 for vendor/current/source3/lib/netapi/serverinfo.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- File:
-
- 1 edited
-
vendor/current/source3/lib/netapi/serverinfo.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/lib/netapi/serverinfo.c
r594 r740 24 24 #include "lib/netapi/netapi_private.h" 25 25 #include "lib/netapi/libnetapi.h" 26 #include "libnet/libnet.h" 27 #include "../librpc/gen_ndr/cli_srvsvc.h" 26 #include "../librpc/gen_ndr/ndr_srvsvc_c.h" 27 #include "lib/smbconf/smbconf.h" 28 #include "lib/smbconf/smbconf_reg.h" 28 29 29 30 /**************************************************************** … … 480 481 struct NetServerGetInfo *r) 481 482 { 482 struct rpc_pipe_client *pipe_cli = NULL;483 483 NTSTATUS status; 484 484 WERROR werr; 485 485 union srvsvc_NetSrvInfo info; 486 486 487 487 488 if (!r->out.buffer) { … … 502 503 } 503 504 504 werr = libnetapi_ open_pipe(ctx, r->in.server_name,505 &ndr_table_srvsvc.syntax_id,506 &pipe_cli);505 werr = libnetapi_e(ctx, r->in.server_name, 506 &ndr_table_srvsvc.syntax_id, 507 ); 507 508 if (!W_ERROR_IS_OK(werr)) { 508 509 goto done; 509 510 } 510 511 511 status = rpccli_srvsvc_NetSrvGetInfo(pipe_cli, talloc_tos(),512 status = , talloc_tos(), 512 513 r->in.server_name, 513 514 r->in.level, … … 519 520 } 520 521 522 523 524 525 521 526 status = map_server_info_to_SERVER_INFO_buffer(ctx, r->in.level, &info, 522 527 r->out.buffer); … … 536 541 struct NetServerSetInfo *r) 537 542 { 538 WERROR werr; 543 WERROR werr = WERR_OK; 544 sbcErr err; 539 545 struct smbconf_ctx *conf_ctx; 540 546 struct srvsvc_NetSrvInfo1005 *info1005; … … 559 565 } 560 566 561 werr = smbconf_init_reg(ctx, &conf_ctx, NULL); 562 if (!W_ERROR_IS_OK(werr)) { 563 goto done; 564 } 565 566 werr = smbconf_set_global_parameter(conf_ctx, "server string", 567 err = smbconf_init_reg(ctx, &conf_ctx, NULL); 568 if (!SBC_ERROR_IS_OK(err)) { 569 libnetapi_set_error_string(ctx, 570 "Could not initialize backend: %s", 571 sbcErrorString(err)); 572 werr = WERR_NO_SUCH_SERVICE; 573 goto done; 574 } 575 576 err = smbconf_set_global_parameter(conf_ctx, "server string", 567 577 info1005->comment); 578 579 580 581 582 583 584 568 585 569 586 done: … … 594 611 struct NetServerSetInfo *r) 595 612 { 596 struct rpc_pipe_client *pipe_cli = NULL;597 613 NTSTATUS status; 598 614 WERROR werr; 599 615 union srvsvc_NetSrvInfo info; 600 601 werr = libnetapi_open_pipe(ctx, r->in.server_name, 602 &ndr_table_srvsvc.syntax_id, 603 &pipe_cli); 616 struct dcerpc_binding_handle *b; 617 618 werr = libnetapi_get_binding_handle(ctx, r->in.server_name, 619 &ndr_table_srvsvc.syntax_id, 620 &b); 604 621 if (!W_ERROR_IS_OK(werr)) { 605 622 goto done; … … 615 632 } 616 633 617 status = rpccli_srvsvc_NetSrvSetInfo(pipe_cli, talloc_tos(),634 status = , talloc_tos(), 618 635 r->in.server_name, 619 636 r->in.level, … … 636 653 struct NetRemoteTOD *r) 637 654 { 638 struct rpc_pipe_client *pipe_cli = NULL;639 655 NTSTATUS status; 640 656 WERROR werr; 641 657 struct srvsvc_NetRemoteTODInfo *info = NULL; 642 643 werr = libnetapi_open_pipe(ctx, r->in.server_name, 644 &ndr_table_srvsvc.syntax_id, 645 &pipe_cli); 658 struct dcerpc_binding_handle *b; 659 660 werr = libnetapi_get_binding_handle(ctx, r->in.server_name, 661 &ndr_table_srvsvc.syntax_id, 662 &b); 646 663 if (!W_ERROR_IS_OK(werr)) { 647 664 goto done; 648 665 } 649 666 650 status = rpccli_srvsvc_NetRemoteTOD(pipe_cli, talloc_tos(),667 status = , talloc_tos(), 651 668 r->in.server_name, 652 669 &info, … … 657 674 } 658 675 676 677 678 679 659 680 *r->out.buffer = (uint8_t *)talloc_memdup(ctx, info, 660 681 sizeof(struct srvsvc_NetRemoteTODInfo));
Note:
See TracChangeset
for help on using the changeset viewer.
