summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
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;