summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-02-17 06:28:58 +0000
committerMartin Pool <mbp@samba.org>2003-02-17 06:28:58 +0000
commit645d68a45ab2ca132485e1cf2ae42b04074a8f01 (patch)
treefddd2b09aa4d5a7ae94d1b93b8fb9eef619df067 /source3/rpcclient
parent541ed81a630aeae97a178e9099b0a920f9b3f84f (diff)
downloadsamba-645d68a45ab2ca132485e1cf2ae42b04074a8f01.tar.gz
samba-645d68a45ab2ca132485e1cf2ae42b04074a8f01.tar.bz2
samba-645d68a45ab2ca132485e1cf2ae42b04074a8f01.zip
Don't pstrcpy into an fstring. (Harmless in this case since it comes
from an environment variable.) (This used to be commit 9f9077346bf9f7c96376169c60aa893f15fb9d2c)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/rpcclient.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index f38ef64eb2..81bb62486a 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -175,16 +175,23 @@ static char* next_command (char** cmdstr)
return command;
}
+
+/**
+ * Find default username from environment variables.
+ *
+ * @param username fstring to receive username; not touched if none is
+ * known.
+ **/
static void get_username (char *username)
{
if (getenv("USER"))
- pstrcpy(username,getenv("USER"));
+ fstrcpy(username,getenv("USER"));
if (*username == 0 && getenv("LOGNAME"))
- pstrcpy(username,getenv("LOGNAME"));
+ fstrcpy(username,getenv("LOGNAME"));
if (*username == 0) {
- pstrcpy(username,"GUEST");
+ fstrcpy(username,"GUEST");
}
return;