(main): try $USERNAME

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6264 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-05-21 09:25:28 +00:00
parent c9a66968e9
commit 1c0c301a88

View File

@@ -690,7 +690,6 @@ main(int argc, char **argv)
int ret = 1;
char *cmd;
size_t cmd_len;
struct passwd *pwd;
char *local_user;
char *host = NULL;
int host_index = -1;
@@ -763,10 +762,14 @@ main(int argc, char **argv)
}
}
pwd = getpwuid (getuid());
local_user = getenv ("USERNAME");
if (local_user == NULL) {
struct passwd *pwd = getpwuid (getuid());
if (pwd == NULL)
errx (1, "who are you?");
local_user = pwd->pw_name;
}
if (user == NULL)
user = local_user;