(parse_pobox): try $USERNAME

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6263 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-05-21 09:24:06 +00:00
parent 21811e6550
commit c9a66968e9

View File

@@ -609,14 +609,17 @@ parse_pobox (char *a0, char **host, char **user)
int po = 0;
if (a0 == NULL) {
struct passwd *pwd;
pwd = getpwuid (getuid ());
if (pwd == NULL)
errx (1, "Who are you?");
*user = strdup (pwd->pw_name);
if (*user == NULL)
errx (1, "strdup: out of memory");
*user = getenv ("USERNAME");
if (*user == NULL) {
struct passwd *pwd = getpwuid (getuid ());
if (pwd == NULL)
errx (1, "Who are you?");
*user = strdup (pwd->pw_name);
if (*user == NULL)
errx (1, "strdup: out of memory");
}
*host = get_pobox (user);
return;
}