]> andersk Git - openssh.git/commitdiff
- (dtucker) [auth-pam.c] Relocate sshpam_store_conv(), no code change.
authordtucker <dtucker>
Sat, 11 Sep 2004 12:28:01 +0000 (12:28 +0000)
committerdtucker <dtucker>
Sat, 11 Sep 2004 12:28:01 +0000 (12:28 +0000)
ChangeLog
auth-pam.c

index 1e1266fd7f57fad8da0b3862b4b18c6ed34c9c2c..7395e72024d76f919e345e06c1bd6a3f2b4e2ba7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
  - (dtucker) [auth-pam.c auth-pam.h session.c] Bug #890: Send output from
    failing PAM session modules to user then exit, similar to the way
    /etc/nologin is handled.  ok djm@
+ - (dtucker) [auth-pam.c] Relocate sshpam_store_conv(), no code change.
 
 20040830
  - (dtucker) [session.c openbsd-compat/bsd-cygwin_util.{c,h}] Bug #915: only
index 514621ea5736ff604e51e218df7da09d001ce538..b9e66625b4d900de0d547484c4f7150659010c4d 100644 (file)
@@ -490,6 +490,51 @@ sshpam_null_conv(int n, struct pam_message **msg,
 
 static struct pam_conv null_conv = { sshpam_null_conv, NULL };
 
+static int
+sshpam_store_conv(int n, struct pam_message **msg,
+    struct pam_response **resp, void *data)
+{
+       struct pam_response *reply;
+       int i;
+       size_t len;
+
+       debug3("PAM: %s called with %d messages", __func__, n);
+       *resp = NULL;
+
+       if (n <= 0 || n > PAM_MAX_NUM_MSG)
+               return (PAM_CONV_ERR);
+
+       if ((reply = malloc(n * sizeof(*reply))) == NULL)
+               return (PAM_CONV_ERR);
+       memset(reply, 0, n * sizeof(*reply));
+
+       for (i = 0; i < n; ++i) {
+               switch (PAM_MSG_MEMBER(msg, i, msg_style)) {
+               case PAM_ERROR_MSG:
+               case PAM_TEXT_INFO:
+                       len = strlen(PAM_MSG_MEMBER(msg, i, msg));
+                       buffer_append(&loginmsg, PAM_MSG_MEMBER(msg, i, msg), len);
+                       buffer_append(&loginmsg, "\n", 1 );
+                       reply[i].resp_retcode = PAM_SUCCESS;
+                       break;
+               default:
+                       goto fail;
+               }
+       }
+       *resp = reply;
+       return (PAM_SUCCESS);
+
+ fail:
+       for(i = 0; i < n; i++) {
+               if (reply[i].resp != NULL)
+                       xfree(reply[i].resp);
+       }
+       xfree(reply);
+       return (PAM_CONV_ERR);
+}
+
+static struct pam_conv store_conv = { sshpam_store_conv, NULL };
+
 void
 sshpam_cleanup(void)
 {
@@ -894,51 +939,6 @@ do_pam_chauthtok(void)
                    pam_strerror(sshpam_handle, sshpam_err));
 }
 
-static int
-sshpam_store_conv(int n, struct pam_message **msg,
-    struct pam_response **resp, void *data)
-{
-       struct pam_response *reply;
-       int i;
-       size_t len;
-
-       debug3("PAM: %s called with %d messages", __func__, n);
-       *resp = NULL;
-
-       if (n <= 0 || n > PAM_MAX_NUM_MSG)
-               return (PAM_CONV_ERR);
-
-       if ((reply = malloc(n * sizeof(*reply))) == NULL)
-               return (PAM_CONV_ERR);
-       memset(reply, 0, n * sizeof(*reply));
-
-       for (i = 0; i < n; ++i) {
-               switch (PAM_MSG_MEMBER(msg, i, msg_style)) {
-               case PAM_ERROR_MSG:
-               case PAM_TEXT_INFO:
-                       len = strlen(PAM_MSG_MEMBER(msg, i, msg));
-                       buffer_append(&loginmsg, PAM_MSG_MEMBER(msg, i, msg), len);
-                       buffer_append(&loginmsg, "\n", 1 );
-                       reply[i].resp_retcode = PAM_SUCCESS;
-                       break;
-               default:
-                       goto fail;
-               }
-       }
-       *resp = reply;
-       return (PAM_SUCCESS);
-
- fail:
-       for(i = 0; i < n; i++) {
-               if (reply[i].resp != NULL)
-                       xfree(reply[i].resp);
-       }
-       xfree(reply);
-       return (PAM_CONV_ERR);
-}
-
-static struct pam_conv store_conv = { sshpam_store_conv, NULL };
-
 void
 do_pam_session(void)
 {
This page took 0.178618 seconds and 5 git commands to generate.