[prev in list] [next in list] [prev in thread] [next in thread] 

List:       proftpd-committers
Subject:    [ProFTPD-committers] CVS: proftpd/modules mod_auth.c,1.262,1.263
From:       "TJ Saunders" <castaglia () users ! sourceforge ! net>
Date:       2009-08-28 16:14:26
Message-ID: E1Mh45q-0001PI-7N () ddv4jf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/proftp/proftpd/modules
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5249/modules

Modified Files:
	mod_auth.c 
Log Message:

Make sure that mod_sftp registers event listeners for the various MaxClients
and MaxConnections directive.  That way, just before mod_auth breaks the
TCP connection, mod_sftp can send an SSH2 message to the client about the
reason for the disconnection.


Index: mod_auth.c
===================================================================
RCS file: /cvsroot/proftp/proftpd/modules/mod_auth.c,v
retrieving revision 1.262
retrieving revision 1.263
diff -u -r1.262 -r1.263
--- mod_auth.c	6 Jul 2009 03:13:14 -0000	1.262
+++ mod_auth.c	28 Aug 2009 16:14:23 -0000	1.263
@@ -52,8 +52,8 @@
 static pr_fh_t *displaylogin_fh = NULL;
 static unsigned int TimeoutSession = 0;
 
-static void auth_scan_scoreboard(void);
-static void auth_count_scoreboard(cmd_rec *, char *);
+static int auth_scan_scoreboard(void);
+static int auth_count_scoreboard(cmd_rec *, char *);
 
 /* auth_cmd_chk_cb() is hooked into the main server's auth_hook function,
  * so that we can deny all commands until authentication is complete.
@@ -103,9 +103,10 @@
   int res = 0;
 
   /* Check for a server-specific TimeoutLogin */
-  if ((c = find_config(main_server->conf, CONF_PARAM, "TimeoutLogin",
-      FALSE)) != NULL)
+  c = find_config(main_server->conf, CONF_PARAM, "TimeoutLogin", FALSE);
+  if (c != NULL) {
     TimeoutLogin = *((int *) c->argv[0]);
+  }
 
   /* Start the login timer */
   if (TimeoutLogin) {
@@ -1369,7 +1370,7 @@
  * greeting.  A secondary purpose is to enforce any configured
  * MaxConnectionsPerHost limit.
  */
-static void auth_scan_scoreboard(void) {
+static int auth_scan_scoreboard(void) {
   char *key;
   void *v;
   config_rec *c = NULL;
@@ -1389,6 +1390,7 @@
   }
 
   while ((score = pr_scoreboard_entry_read()) != NULL) {
+    pr_signals_handle();
 
     /* Make sure it matches our current server */
     if (strcmp(score->sce_server_addr, curr_server_addr) == 0) {
@@ -1464,9 +1466,11 @@
       end_login(1);
     }
   }
+
+  return 0;
 }
 
-static void auth_count_scoreboard(cmd_rec *cmd, char *user) {
+static int auth_count_scoreboard(cmd_rec *cmd, char *user) {
   char *key;
   void *v;
   pr_scoreboard_entry_t *score = NULL;
@@ -1494,6 +1498,8 @@
     while ((score = pr_scoreboard_entry_read()) != NULL) {
       unsigned char same_host = FALSE;
 
+      pr_signals_handle();
+
       /* Make sure it matches our current server. */
       if (strcmp(score->sce_server_addr, curr_server_addr) == 0) {
 
@@ -1702,6 +1708,8 @@
       end_login(0);
     }
   }
+
+  return 0;
 }
 
 MODRET auth_pre_user(cmd_rec *cmd) {


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
ProFTPD Committers Mailing List
proftpd-committers@proftpd.org
https://lists.sourceforge.net/lists/listinfo/proftp-committers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic