From e1427cb71004d1aebdceb48b615f2f407f450dd0 Mon Sep 17 00:00:00 2001 From: "fredrik@DOLDA2000.COM" Date: Fri, 4 Mar 2005 20:05:09 +0000 Subject: [PATCH] chown the ccache correctly. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/utils@177 959494ce-11ee-0310-bf91-de5d638817bd --- pam_krb5auto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pam_krb5auto.c b/pam_krb5auto.c index 6f9bc73..eb990d2 100644 --- a/pam_krb5auto.c +++ b/pam_krb5auto.c @@ -32,6 +32,7 @@ struct data krb5_creds initcreds; int hascreds; uid_t uid; + gid_t gid; }; static void log(int prio, char *format, ...) @@ -126,6 +127,7 @@ static struct data *getdata(pam_handle_t *pamh, struct options *opts) return(NULL); } data->uid = pwent->pw_uid; + data->gid = pwent->pw_gid; if((ret = krb5_init_context(&data->ctx)) != 0) { log(LOG_CRIT, "could not create krb5 context: %s", error_message(ret)); freedata(data); @@ -211,6 +213,7 @@ static int savecreds(pam_handle_t *pamh, struct options *opts, struct data *data ret = PAM_SERVICE_ERR; goto out; } + chown(filename, data->uid, data->gid); pam_putenv(pamh, strdup(buf)); if(opts->debug) log(LOG_DEBUG, "successfully initialized ccache"); -- 2.11.0