chown the ccache correctly.
authorfredrik@DOLDA2000.COM <fredrik@DOLDA2000.COM@959494ce-11ee-0310-bf91-de5d638817bd>
Fri, 4 Mar 2005 20:05:09 +0000 (20:05 +0000)
committerfredrik@DOLDA2000.COM <fredrik@DOLDA2000.COM@959494ce-11ee-0310-bf91-de5d638817bd>
Fri, 4 Mar 2005 20:05:09 +0000 (20:05 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/utils@177 959494ce-11ee-0310-bf91-de5d638817bd

pam_krb5auto.c

index 6f9bc73..eb990d2 100644 (file)
@@ -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");