From 231e8eac77cad131bf46808a3171bd4e0fe4b51c Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Thu, 16 Sep 1999 19:13:11 +0000 Subject: [PATCH] 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 --- appl/telnet/telnet/commands.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/appl/telnet/telnet/commands.c b/appl/telnet/telnet/commands.c index dc187a052..4218b0137 100644 --- a/appl/telnet/telnet/commands.c +++ b/appl/telnet/telnet/commands.c @@ -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");