From e89416214757b3731847c248e4e614612bfc9d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 23 Sep 2003 10:55:41 +0000 Subject: [PATCH] Add support for AFS when using Kerberos 5, From: Sergio.Gelato@astro.su.se git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12916 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/auth/sia/sia.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/lib/auth/sia/sia.c b/lib/auth/sia/sia.c index 91fbef945..6355ecac7 100644 --- a/lib/auth/sia/sia.c +++ b/lib/auth/sia/sia.c @@ -328,7 +328,19 @@ siad_ses_launch(sia_collect_func_t *collect, #endif putenv(env); } -#ifdef KRB4 +#ifdef SIA_KRB5 + if (k_hasafs()) { + char cell[64]; + krb5_ccache ccache; + if(krb5_cc_resolve(s->context, s->ticket, &ccache) == 0) { + k_setpag(); + if(k_afs_cell_of_file(entity->pwd->pw_dir, cell, sizeof(cell)) == 0) + krb5_afslog(s->context, ccache, cell, 0); + krb5_afslog_home(s->context, ccache, 0, 0, entity->pwd->pw_dir); + } + } +#endif +#ifdef SIA_KRB4 if (k_hasafs()) { char cell[64]; k_setpag(); @@ -390,7 +402,20 @@ siad_ses_reauthent (sia_collect_func_t *collect, duplicate some code here... */ struct state *s = (struct state*)entity->mech[pkgind]; chown(s->ticket, entity->pwd->pw_uid, entity->pwd->pw_gid); -#ifdef KRB4 +#ifdef SIA_KRB5 + if (k_hasafs()) { + char cell[64]; + krb5_ccache ccache; + if(krb5_cc_resolve(s->context, s->ticket, &ccache) == 0) { + k_setpag(); + if(k_afs_cell_of_file(entity->pwd->pw_dir, + cell, sizeof(cell)) == 0) + krb5_afslog(s->context, ccache, cell, 0); + krb5_afslog_home(s->context, ccache, 0, 0, entity->pwd->pw_dir); + } + } +#endif +#ifdef SIA_KRB4 if(k_hasafs()) { char cell[64]; if(k_afs_cell_of_file(entity->pwd->pw_dir,