Fixed erroneous string lengths.
authorfredrik@DOLDA2000.COM <fredrik@DOLDA2000.COM@959494ce-11ee-0310-bf91-de5d638817bd>
Fri, 4 Mar 2005 19:53:59 +0000 (19:53 +0000)
committerfredrik@DOLDA2000.COM <fredrik@DOLDA2000.COM@959494ce-11ee-0310-bf91-de5d638817bd>
Fri, 4 Mar 2005 19:53:59 +0000 (19:53 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/utils@176 959494ce-11ee-0310-bf91-de5d638817bd

pam_krb5auto.c

index 3f7bf00..6f9bc73 100644 (file)
@@ -183,8 +183,8 @@ static int savecreds(pam_handle_t *pamh, struct options *opts, struct data *data
     if(opts->debug)
        log(LOG_DEBUG, "got creds successfully");
     snprintf(buf, sizeof(buf), "KRB5CCNAME=FILE:/tmp/krb5cc_%i_XXXXXX", data->uid);
-    ccname = buf + sizeof("KRB5CCNAME=");
-    filename = ccname + sizeof("FILE:");
+    ccname = buf + sizeof("KRB5CCNAME=") - 1;
+    filename = ccname + sizeof("FILE:") - 1;
     if((fd = mkstemp(filename)) < 0) {
        log(LOG_ERR, "could not create tempfile for credentials cache: %s", strerror(errno));
        ret = PAM_SERVICE_ERR;