(main): try to use $USERNAME

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6261 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-05-21 09:22:29 +00:00
parent 1d57593edc
commit 919478243a

View File

@@ -719,11 +719,14 @@ main(int argc, char **argv)
} }
if (user == NULL) { if (user == NULL) {
struct passwd *pwd = getpwuid (getuid ()); user = getenv ("USERNAME");
if (user == NULL) {
struct passwd *pwd = getpwuid (getuid ());
if (pwd == NULL) if (pwd == NULL)
errx (1, "who are you?"); errx (1, "who are you?");
user = pwd->pw_name; user = pwd->pw_name;
}
} }
if (!passive_flag) if (!passive_flag)