Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 79849 Details for
Bug 122923
PAM_KRB5 credential deletion on logout
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
patch
pam_krb5-delete_credential.patch (text/plain), 1.92 KB, created by
nicolas.viot
on 2006-02-15 07:05:57 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
nicolas.viot
Created:
2006-02-15 07:05:57 UTC
Size:
1.92 KB
patch
obsolete
>--- pam_krb5-orig/pam_krb5/pam_krb5_sess.c 2000-01-05 02:08:51.000000000 +0100 >+++ pam_krb5/pam_krb5_sess.c 2006-02-15 16:37:17.000000000 +0100 >@@ -6,10 +6,21 @@ > * > */ > >+ >+#include <krb5.h> >+#include <pwd.h> >+ >+ > static const char rcsid[] = "$Id: pam_krb5_sess.c,v 1.3 1999/01/19 20:49:44 fcusack Exp $"; > > #include <security/pam_appl.h> > #include <security/pam_modules.h> >+#include <syslog.h> >+ >+#define DLOG( error_msg) \ >+ if (debug)\ >+ syslog(LOG_DEBUG, "pam_krb5: %s", \ >+ error_msg) > > /* Initiate session management */ > int >@@ -23,5 +34,62 @@ > int > pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv) > { >- return PAM_SUCCESS; >+ >+ krb5_context pam_context; >+ krb5_ccache ccache; >+ int pamret=PAM_SUCCESS; >+ int krbret; >+ char cache_name[200]; >+ char *name; >+ struct passwd *pw; >+ int i; >+ int debug=0,delete_credential=0; >+ >+ >+ for(i=0;i<argc;i++) >+ { >+ if(strcmp(argv[i],"debug")==0) >+ debug=1; >+ else if(strcmp(argv[i],"delete_credential")==0) >+ delete_credential=1; >+ } >+ >+ if(!delete_credential) >+ return PAM_SUCCESS; >+ >+if (pamret = pam_get_item(pamh, PAM_USER, (void **) &name)) { >+ DLOG("error getting user name in close_session"); >+ pamret = PAM_SERVICE_ERR; >+ goto cleanup; >+ } >+ >+ pw = getpwnam(name); >+ if(!pw) >+ { >+ DLOG("error getting info in close_session"); >+ pamret = PAM_SERVICE_ERR; >+ goto cleanup; >+ } >+ sprintf(cache_name,"/tmp/krb5cc_%d",pw->pw_uid); >+ >+ >+ if ((krbret=krb5_init_context(&pam_context))) { >+ DLOG( error_message(krbret)); >+ return PAM_SERVICE_ERR; >+ } >+ >+ >+ if (krbret = krb5_cc_resolve(pam_context, cache_name, &ccache)) { >+ DLOG( error_message(krbret)); >+ pamret = PAM_SERVICE_ERR; >+ goto cleanup; >+ } >+ >+ krb5_cc_destroy(pam_context, ccache); >+ >+ cleanup: >+ krb5_free_context(pam_context); >+ DLOG( pamret ? "failure" : "success"); >+ return pamret; >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 122923
: 79849