(get_logname): also try $USERNAME

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6268 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-05-21 09:28:40 +00:00
parent 2029da488e
commit fdbb09f0e3

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 1999 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -48,6 +48,8 @@ get_logname(void)
return p;
if((p = getenv("LOGNAME")))
return p;
if((p = getenv("USERNAME")))
return p;
#if defined(HAVE_GETLOGIN) && !defined(POSIX_GETLOGIN)
if((p = getlogin()))
return p;
@@ -73,7 +75,7 @@ krb5_get_default_principal (krb5_context context,
}
pw = getpwuid(getuid());
if(pw == NULL){
if(pw == NULL) {
p = get_logname();
if(p == NULL)
return ENOTTY;