revert 1.54, get_default_username should DTRT now

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6973 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-09-16 19:13:11 +00:00
parent 343ae85af1
commit 231e8eac77

View File

@@ -2336,18 +2336,8 @@ tn(int argc, char **argv)
#endif
} while (connected == 0);
cmdrc(hostp, hostname);
if (autologin && user == NULL) {
struct passwd *pw;
user = (char *)get_default_username();
if (user == NULL ||
((pw = k_getpwnam((char *)user)) && pw->pw_uid != getuid())) {
if ((pw = k_getpwuid(getuid())))
user = pw->pw_name;
else
user = NULL;
}
}
if (autologin && user == NULL)
user = (char *)get_default_username ();
if (user) {
env_define((unsigned char *)"USER", (unsigned char *)user);
env_export((unsigned char *)"USER");