Byteorder.net: How's my driving?

Got something to say? I'd love to hear from you, but I'm afraid that if I publish my email address on a web page these days, people will write me lots of mail about how I can "increase my manhood" or purchase inexpensive V1@gra. So instead let's try this. Just put your message in, give your return address, and if you're not trying to sell me questionable goods, I'll do my best answer you. Trust me; it's so simple, even a former Nigerian general with lots of regretably inaccessible cash could do it.

My email address is
 and I'd like to say:

#include <stdio.h>
/* For getpass */
#include <unistd.h>
/* for malloc */
#include <stdlib.h>
/* For strdup */
#include <string.h>

#include <security/pam_appl.h>

int interact (int num_msg, const struct pam_message **msg,
                struct pam_response **resp, void *appdata_ptr) {

	struct pam_message *m = (struct pam_message*)*msg;
	struct pam_response *r = (struct pam_response *)calloc(num_msg,sizeof(struct pam_response));
	char *buf = (char *)calloc(1,PAM_MAX_RESP_SIZE);

	*resp = r;

	while (num_msg--) {
		switch(m->msg_style) {
			case PAM_PROMPT_ECHO_ON:
				printf("%s",m->msg);
				fgets(buf,PAM_MAX_RESP_SIZE-1,stdin);
				r->resp = (char *)strndup(buf,PAM_MAX_RESP_SIZE-1);
				m++;r++;
				break;
			case PAM_PROMPT_ECHO_OFF:
				r->resp = (char *)strndup(getpass(m->msg),PAM_MAX_RESP_SIZE-1);
				m++;r++;
				break;
			case PAM_ERROR_MSG:
				printf("Error: ");
			case PAM_TEXT_INFO:
				printf("%s\n",m->msg);
				m++;r++;
				break;
			default:
				break;
		}
	}
	free(buf);
	return PAM_SUCCESS;
}

int main (int argc, char **argv) {
	char *service = "system-auth";
	char *user = argv[1];
	int rval;

	struct pam_conv callback;
	pam_handle_t *hnd;

	callback.conv = interact;

	if (argc != 2) {
		printf("Please provide a username, and no other arguments.\n");
		return(1);
	}

	rval = pam_start(service,user,&callback,&hnd);
	if(rval == PAM_SUCCESS) {
		rval = pam_authenticate(hnd,0);
	} else {
		printf("%d: %s\n",rval,pam_strerror(hnd,rval));
	}
	if(rval == PAM_SUCCESS) {
		rval = pam_acct_mgmt(hnd,0);
	} else {
		 printf("%d: %s\n",rval,pam_strerror(hnd,rval));
	}

	/* It's a possible problem that PAM depends on the application to
		report auth failures. */
	if(rval == PAM_SUCCESS) {
		printf("Success.\n");
		pam_end(hnd,PAM_SUCCESS);
		return(0);
	} else {
		printf("Failure: %s\n",pam_strerror(hnd,rval));
		pam_end(hnd,PAM_AUTH_ERR);
		return(1);
	}
}