+2011-05-30 Thorsten Kukuk <kukuk@thkukuk.de>
+
+ * modules/pam_timestamp/pam_timestamp.c (main): Remove unsused
+ variable pretval.
+
+ * modules/pam_stress/pam_stress.c (converse): **message is const.
+ (stress_get_password): pmsg is const.
+ (pam_sm_chauthtok): Likewise.
+ * libpam/pam_item.c (pam_get_user): Make pmsg const and remove
+ casts.
+
2011-05-30 Thorsten Kukuk <kukuk@thkukuk.de>
* modules/pam_env/pam_env.c (_pam_parse): Implement debug option.
{
const char *use_prompt;
int retval;
- struct pam_message msg,*pmsg;
+ struct pam_message msg;
+ const struct pam_message *pmsg;
struct pam_response *resp;
D(("called."));
resp = NULL;
retval = pamh->pam_conversation->
- conv(1, (const struct pam_message **) &pmsg, &resp,
- pamh->pam_conversation->appdata_ptr);
+ conv(1, &pmsg, &resp, pamh->pam_conversation->appdata_ptr);
if (retval == PAM_CONV_AGAIN) {
/* conversation function is waiting for an event - save state */
}
static int converse(pam_handle_t *pamh, int nargs
- , struct pam_message **message
+ , const struct pam_message **message
, struct pam_response **response)
{
int retval;
retval = pam_get_item(pamh,PAM_CONV,&void_conv);
conv = void_conv;
if (retval == PAM_SUCCESS && conv) {
- retval = conv->conv(nargs, (const struct pam_message **) message
- , response, conv->appdata_ptr);
+ retval = conv->conv(nargs, message, response, conv->appdata_ptr);
if (retval != PAM_SUCCESS) {
pam_syslog(pamh, LOG_ERR, "converse returned %d: %s",
retval, pam_strerror(pamh, retval));
pam_syslog(pamh, LOG_WARNING, "no forwarded password");
return PAM_PERM_DENIED;
} else { /* we will have to get one */
- struct pam_message msg[1],*pmsg[1];
+ struct pam_message msg[1];
+ const struct pam_message *pmsg[1];
struct pam_response *resp;
int retval;
return PAM_SUCCESS;
} else if (flags & PAM_UPDATE_AUTHTOK) { /* second call */
- struct pam_message msg[3],*pmsg[3];
+ struct pam_message msg[3];
+ const struct pam_message *pmsg[3];
struct pam_response *resp;
const void *text;
char *txt=NULL;
int
main(int argc, char **argv)
{
- int i, pretval = -1, retval = 0, dflag = 0, kflag = 0;
+ int i, retval = 0, dflag = 0, kflag = 0;
const char *target_user = NULL, *user = NULL, *tty = NULL;
struct passwd *pwd;
struct timeval tv;
select(STDOUT_FILENO + 1,
NULL, NULL, &write_fds,
&tv);
- pretval = retval;
retval = 0;
}
} while (dflag > 0);