[dovecot-cvs] dovecot/src/auth passdb-pam.c,1.23,1.24

cras at dovecot.org cras at dovecot.org
Tue Jun 14 13:28:39 EEST 2005


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv31706

Modified Files:
	passdb-pam.c 
Log Message:
Allow PAM to modify username.



Index: passdb-pam.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-pam.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- passdb-pam.c	12 Mar 2005 23:10:35 -0000	1.23
+++ passdb-pam.c	14 Jun 2005 10:28:37 -0000	1.24
@@ -167,7 +167,8 @@
 	return PAM_SUCCESS;
 }
 
-static int pam_auth(pam_handle_t *pamh, const char **error)
+static int pam_auth(struct auth_request *request,
+		    pam_handle_t *pamh, const char **error)
 {
 	void *item;
 	int status;
@@ -200,12 +201,13 @@
 					 pam_strerror(pamh, status));
 		return status;
 	}
+        auth_request_set_field(request, "user", item, NULL);
 
 	return PAM_SUCCESS;
 }
 
 static void
-pam_verify_plain_child(const struct auth_request *request, const char *service,
+pam_verify_plain_child(struct auth_request *request, const char *service,
 		       const char *password, int fd)
 {
 	pam_handle_t *pamh;
@@ -235,7 +237,7 @@
 			pam_set_item(pamh, PAM_RHOST, host);
 #endif
 
-		status = pam_auth(pamh, &str);
+		status = pam_auth(request, pamh, &str);
 		if ((status2 = pam_end(pamh, status)) == PAM_SUCCESS) {
 			/* FIXME: check for PASSDB_RESULT_UNKNOWN_USER
 			   somehow? */



More information about the dovecot-cvs mailing list