(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,12 +228,17 @@ get_cred_cache(krb5_context context,
client = default_client;
if(client == NULL) {
char *user;
struct passwd *pw;
user = getenv ("USERNAME");
if (user == NULL) {
user = getlogin();
if(user == NULL) {
pw = getpwuid(getuid());
struct passwd *pw = getpwuid(getuid());
if (pw == NULL)
return KADM5_FAILURE;
user = pw->pw_name;
}
}
if(user == NULL)
return KADM5_FAILURE;
ret = krb5_make_principal(context, &client,