summaryrefslogtreecommitdiff
path: root/source3/rpcclient/rpcclient.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-12-02 01:16:05 +0000
committerLuke Leighton <lkcl@samba.org>1999-12-02 01:16:05 +0000
commitbd4bea62ada937c58d38f6bf7af88c4cfb4115cc (patch)
treeff1ca74a615ddf8c5915e3367cdf9a8d5bdf5dd4 /source3/rpcclient/rpcclient.c
parenta2e135d1954622bcdfa24304f97e224ae32c6412 (diff)
downloadsamba-bd4bea62ada937c58d38f6bf7af88c4cfb4115cc.tar.gz
samba-bd4bea62ada937c58d38f6bf7af88c4cfb4115cc.tar.bz2
samba-bd4bea62ada937c58d38f6bf7af88c4cfb4115cc.zip
clearing up connection-related stuff. password credentials were messing
up. added a complicated prompt which i don't like, but it tells you domain\user@hostname$ (This used to be commit 338d08f69b0eeefa0f3f2c0217ef17ea3e815e1f)
Diffstat (limited to 'source3/rpcclient/rpcclient.c')
-rw-r--r--source3/rpcclient/rpcclient.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index dfbd3fae7a..2339cc892b 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -755,14 +755,32 @@ static BOOL process( struct client_info *info, char *cmd_str)
}
else while (!feof(stdin))
{
-#ifdef HAVE_LIBREADLINE
- pstring promptline;
-#endif
+ pstring pline;
+ BOOL at_sym = False;
+ pline[0] = 0;
+ if (usr.domain[0] != 0)
+ {
+ safe_strcat(pline, usr.domain, sizeof(pline)-1);
+ safe_strcat(pline, "\\", sizeof(pline)-1);
+ at_sym = True;
+ }
+ if (usr.user_name[0] != 0)
+ {
+ safe_strcat(pline, usr.user_name, sizeof(pline)-1);
+ at_sym = True;
+ }
+ if (at_sym)
+ {
+ safe_strcat(pline, "@", sizeof(pline)-1);
+ }
+
+ safe_strcat(pline, cli_info.dest_host, sizeof(pline)-1);
+ safe_strcat(pline, "$ ", sizeof(pline)-1);
#ifndef HAVE_LIBREADLINE
/* display a prompt */
- fprintf(out_hnd, "%s$ ", CNV_LANG(cli_info.dest_host));
+ fprintf(out_hnd, "%s", CNV_LANG(promptline));
fflush(out_hnd);
cli_net_wait_keyboard();
@@ -775,10 +793,7 @@ static BOOL process( struct client_info *info, char *cmd_str)
#else /* HAVE_LIBREADLINE */
- slprintf(promptline, sizeof(promptline) - 1, "%s$ ",
- CNV_LANG(cli_info.dest_host));
-
- if (!readline(promptline))
+ if (!readline(pline))
break;
/* Copy read line to samba buffer */