(get_cred_cache): use $USERNAME

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6267 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-05-21 09:27:43 +00:00
parent 2754e0f93c
commit 2029da488e

View File

@@ -228,11 +228,16 @@ get_cred_cache(krb5_context context,
client = default_client; client = default_client;
if(client == NULL) { if(client == NULL) {
char *user; char *user;
struct passwd *pw;
user = getlogin(); user = getenv ("USERNAME");
if(user == NULL) { if (user == NULL) {
pw = getpwuid(getuid()); user = getlogin();
user = pw->pw_name; if(user == NULL) {
struct passwd *pw = getpwuid(getuid());
if (pw == NULL)
return KADM5_FAILURE;
user = pw->pw_name;
}
} }
if(user == NULL) if(user == NULL)
return KADM5_FAILURE; return KADM5_FAILURE;