(main): conditionalize `getlogin'

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6312 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-06-15 02:45:03 +00:00
parent 74d12332e3
commit 754f056849

View File

@@ -224,7 +224,7 @@ main(int argc, char **argv)
int optind = 0;
char *su_user;
struct passwd *su_info;
char *login_user;
char *login_user = NULL;
struct passwd *login_info;
struct passwd *pwd;
@@ -258,7 +258,9 @@ main(int argc, char **argv)
}
su_info = make_info(pwd);
#if defined(HAVE_GETLOGIN) && !defined(POSIX_GETLOGIN)
login_user = getlogin();
#endif
if(login_user == NULL || (pwd = getpwnam(login_user)) == NULL)
pwd = getpwuid(getuid());
if(pwd == NULL)