(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; | ||||
|  | ||||
|     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; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Assar Westerlund
					Assar Westerlund