summaryrefslogtreecommitdiffstats
path: root/source/rpcclient
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-03-07 09:25:48 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-03-07 09:25:48 +0000
commit1f605fe77c56ee2a7838c9f87eedf4bb91ebf688 (patch)
treec09e9c32709ca78ebf77f0197bf1cb9e1238a542 /source/rpcclient
parent1cbd53dc3cd2d56f5e62d42fed5d589efcecb8f8 (diff)
downloadsamba-1f605fe77c56ee2a7838c9f87eedf4bb91ebf688.tar.gz
samba-1f605fe77c56ee2a7838c9f87eedf4bb91ebf688.tar.xz
samba-1f605fe77c56ee2a7838c9f87eedf4bb91ebf688.zip
safe_strcpy() -> fstrcpy() fix, and a cleanup to how rpcclient calls the
IP address resolving code.
Diffstat (limited to 'source/rpcclient')
-rw-r--r--source/rpcclient/cmd_reg.c2
-rw-r--r--source/rpcclient/rpcclient.c11
2 files changed, 4 insertions, 9 deletions
diff --git a/source/rpcclient/cmd_reg.c b/source/rpcclient/cmd_reg.c
index 19c0e7f71f0..8943331dabe 100644
--- a/source/rpcclient/cmd_reg.c
+++ b/source/rpcclient/cmd_reg.c
@@ -914,7 +914,7 @@ static NTSTATUS cmd_reg_shutdown(struct cli_state *cli, TALLOC_CTX *mem_ctx,
switch (opt)
{
case 'm':
- safe_strcpy(msg, optarg, sizeof(msg)-1);
+ fstrcpy(msg, optarg);
/*fprintf (stderr, "[%s|%s]\n", optarg, msg);*/
break;
diff --git a/source/rpcclient/rpcclient.c b/source/rpcclient/rpcclient.c
index 127506fb39b..c3b2cd4ea1b 100644
--- a/source/rpcclient/rpcclient.c
+++ b/source/rpcclient/rpcclient.c
@@ -592,6 +592,8 @@ out_free:
{ NULL }
};
+ ZERO_STRUCT(server_ip);
+
setlinebuf(stdout);
/* Parse options */
@@ -674,13 +676,6 @@ out_free:
if (!init_names())
return 1;
- /* Resolve the IP address */
-
- if (!opt_ipaddr && !resolve_name(server, &server_ip, 0x20)) {
- fprintf(stderr, "Unable to resolve %s\n", server);
- return 1;
- }
-
/*
* Get password
* from stdin if necessary
@@ -697,7 +692,7 @@ out_free:
get_username(username);
nt_status = cli_full_connection(&cli, global_myname(), server,
- &server_ip, 0,
+ opt_ipaddr ? &server_ip : NULL, 0,
"IPC$", "IPC",
username, domain,
password, 0, NULL);