(pam_sm_open_session): use krb_afslog_home

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5145 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1998-09-04 17:29:53 +00:00
parent 1d94bc2be5
commit 9027af9d50

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska H<>gskolan
* Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -213,11 +213,22 @@ int
pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
char *tkt;
void *user;
const char *homedir = NULL;
if(pam_get_item (pamh, PAM_USER, &user) == PAM_SUCCESS) {
struct passwd *pwd;
pwd = getpwnam ((char *)user);
if (pwd != NULL)
homedir = pwd->pw_dir;
}
pam_get_data(pamh, "KRBTKFILE", (const void**)&tkt);
setenv("KRBTKFILE", tkt, 1);
if(k_hasafs()){
k_setpag();
krb_afslog(0, 0);
krb_afslog_home(0, 0, homedir);
}
return PAM_SUCCESS;
}