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;