YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
for (i = 0; i < n; i++)
{ /* if there's a message - append it to the buffer */ if (msg[i]->msg)
{ int len = strlen(msg[i]->msg); if (len > end - param->ptr)
len = end - param->ptr; if (len > 0)
{
memcpy(param->ptr, msg[i]->msg, len);
param->ptr+= len;
*(param->ptr)++ = '\n';
}
} /* if the message style is *_PROMPT_*, meaning PAM asks a question,
send the accumulated text to the client, read the reply */ if (msg[i]->msg_style == PAM_PROMPT_ECHO_OFF ||
msg[i]->msg_style == PAM_PROMPT_ECHO_ON)
{ int pkt_len; unsignedchar *pkt;
/* allocate the response array.
freeing it is the responsibility of the caller */ if (*resp == 0)
{
*resp = calloc(n, sizeof(struct pam_response)); if (*resp == 0) return PAM_BUF_ERR;
}
/* dialog plugin interprets the first byte of the packet asthemagicnumber. 2means"readtheinputwiththeechoenabled" 4means"password-likeinput,echodisabled"
C'est la vie. */
param->buf[0] = msg[i]->msg_style == PAM_PROMPT_ECHO_ON ? 2 : 4;
PAM_DEBUG((stderr, "PAM: conv: send(%.*s)\n",
(int)(param->ptr - param->buf - 1), param->buf));
pkt_len= roundtrip(param, param->buf, param->ptr - param->buf - 1, &pkt); if (pkt_len < 0) return PAM_CONV_ERR;
PAM_DEBUG((stderr, "PAM: conv: recv(%.*s)\n", pkt_len, pkt)); /* allocate and copy the reply to the response array */ if (!((*resp)[i].resp= strndup((char*) pkt, pkt_len))) return PAM_CONV_ERR;
param->ptr = param->buf + 1;
}
} return PAM_SUCCESS;
}
#defineDO(X) if ((status = (X)) != PAM_SUCCESS) goto end
staticint pam_auth_base(struct param *param, MYSQL_SERVER_AUTH_INFO *info)
{
pam_handle_t *pamh = NULL; int status; constchar *new_username= NULL; /* The following is written in such a way to make also solaris happy */ struct pam_conv pam_start_arg = { &conv, (char*) param };
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.