(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:
@@ -609,14 +609,17 @@ parse_pobox (char *a0, char **host, char **user)
|
|||||||
int po = 0;
|
int po = 0;
|
||||||
|
|
||||||
if (a0 == NULL) {
|
if (a0 == NULL) {
|
||||||
struct passwd *pwd;
|
|
||||||
|
|
||||||
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 = strdup (pwd->pw_name);
|
*user = strdup (pwd->pw_name);
|
||||||
if (*user == NULL)
|
if (*user == NULL)
|
||||||
errx (1, "strdup: out of memory");
|
errx (1, "strdup: out of memory");
|
||||||
|
}
|
||||||
*host = get_pobox (user);
|
*host = get_pobox (user);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user