diff options
author | Simo Sorce <idra@samba.org> | 2001-08-10 09:52:10 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2001-08-10 09:52:10 +0000 |
commit | acc149c427e780b35ebe3028722ed0c42c4c3854 (patch) | |
tree | 064b2307dac4fbaa23c1fdab0d900b63faf04737 /source3/rpcclient/cmd_samr.c | |
parent | 5c47841335059ace57dfbf03e35872504d86b447 (diff) | |
download | samba-acc149c427e780b35ebe3028722ed0c42c4c3854.tar.gz samba-acc149c427e780b35ebe3028722ed0c42c4c3854.tar.bz2 samba-acc149c427e780b35ebe3028722ed0c42c4c3854.zip |
- avoid possible mem leaks in rpcclient/cmd_*.c (talloc_destroy not performed)
- ported two rpc back from TNG (WINREG: shutdown and abort shutdown)
- some optimizations and changed some DEBUG statement in loadparm.c
- changed rpcclient a bit moved from non reentrant next_token_nr to next_token
- in cmd_reg.c not sure if getopt will work ok on all platforms only setting optind=0
(This used to be commit fd54412ce9c3504a547e232602d6129e08dd9d4d)
Diffstat (limited to 'source3/rpcclient/cmd_samr.c')
-rw-r--r-- | source3/rpcclient/cmd_samr.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index dee466ffea..6e8aa23a08 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -170,6 +170,7 @@ static uint32 cmd_samr_query_user(struct cli_state *cli, int argc, char **argv) /* Initialise RPC connection */ if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -297,6 +298,7 @@ static uint32 cmd_samr_query_group(struct cli_state *cli, int argc, char **argv) /* Initialise RPC connection */ if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -386,6 +388,7 @@ static uint32 cmd_samr_query_usergroups(struct cli_state *cli, int argc, char ** /* Initialise RPC connection */ if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -472,6 +475,7 @@ static uint32 cmd_samr_query_groupmem(struct cli_state *cli, int argc, char **ar /* Initialise RPC connection */ if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -556,6 +560,7 @@ static uint32 cmd_samr_enum_dom_groups(struct cli_state *cli, int argc, if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -634,6 +639,7 @@ static uint32 cmd_samr_query_aliasmem(struct cli_state *cli, int argc, if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -724,6 +730,7 @@ static uint32 cmd_samr_query_dispinfo(struct cli_state *cli, int argc, if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -790,7 +797,7 @@ static uint32 cmd_samr_query_dominfo(struct cli_state *cli, int argc, SAM_UNK_CTR ctr; if (argc > 2) { - printf("Usage: %s [infolevel\n", argv[0]); + printf("Usage: %s [infolevel]\n", argv[0]); return 0; } @@ -809,6 +816,7 @@ static uint32 cmd_samr_query_dominfo(struct cli_state *cli, int argc, if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -896,6 +904,7 @@ static uint32 cmd_samr_create_dom_user(struct cli_state *cli, int argc, if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -975,6 +984,7 @@ static uint32 cmd_samr_lookup_names(struct cli_state *cli, int argc, if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -1058,6 +1068,7 @@ static uint32 cmd_samr_lookup_rids(struct cli_state *cli, int argc, if (!cli_nt_session_open (cli, PIPE_SAMR)) { fprintf (stderr, "Could not initialize samr pipe!\n"); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } @@ -1135,6 +1146,7 @@ static uint32 cmd_samr_delete_dom_user(struct cli_state *cli, int argc, if (!cli_nt_session_open (cli, PIPE_SAMR)) { DEBUG(0, ("cmd_samr_delete_dom_user: could not open samr pipe!\n")); + talloc_destroy(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } |