summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_samr.c12
-rw-r--r--source3/rpcclient/rpcclient.c5
2 files changed, 15 insertions, 2 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index c45c4c7c23..487c8e46c1 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -67,6 +67,14 @@ void cmd_sam_test(struct client_info *info)
/* open SAMR session. */
res = res ? cli_nt_session_open(smb_cli, PIPE_SAMR, True) : False;
+ /* establish a connection. */
+ res = res ? do_samr_connect(smb_cli,
+ srv_name, 0x00000020,
+ &info->dom.samr_pol_connect) : False;
+
+ res = res ? do_samr_close(smb_cli,
+ &info->dom.samr_pol_connect) : False;
+
/* close the session */
cli_nt_session_close(smb_cli);
@@ -232,10 +240,10 @@ void cmd_sam_enum_users(struct client_info *info)
}
res = res ? do_samr_close(smb_cli,
- &info->dom.samr_pol_connect) : False;
+ &info->dom.samr_pol_open_domain) : False;
res = res ? do_samr_close(smb_cli,
- &info->dom.samr_pol_open_domain) : False;
+ &info->dom.samr_pol_connect) : False;
/* close the session */
cli_nt_session_close(smb_cli);
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 174cea78ad..2183f504c2 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -30,6 +30,7 @@
#endif
extern pstring scope;
+extern pstring global_myname;
extern pstring user_socket_options;
@@ -456,6 +457,7 @@ enum client_action
TimeInit();
charset_initialise();
+ crc32_build_table();
myumask = umask(0);
umask(myumask);
@@ -683,6 +685,9 @@ enum client_action
fprintf(stderr, "Failed to get my hostname.\n");
}
+ fstrcpy(global_myname, cli_info.myhostname);
+ strupper(global_myname);
+
if (!lp_load(servicesf,True, False, False))
{
fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);