(get_cred_cache): use get_default_username

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6314 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-06-15 02:46:25 +00:00
parent f0391c5536
commit 5df21ee4a4

View File

@@ -227,18 +227,10 @@ get_cred_cache(krb5_context context,
if(client == NULL)
client = default_client;
if(client == NULL) {
char *user;
const char *user;
user = get_default_username ();
user = getenv ("USERNAME");
if (user == NULL) {
user = getlogin();
if(user == NULL) {
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,