lsat (0.9.7.1-2) 003_checkftpusers.dpatch

Summary

 checkftpusers.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

    
download this patch

Patch contents

#! /bin/sh /usr/share/dpatch/dpatch-run
## 003_checkftpusers.dpatch by TomaszN <nowak2000@poczta.onet.pl>
##
## DP: Hardcoded number of accounts too low

@DPATCH@
diff -urNad lsat-0.9.7.1~/checkftpusers.c lsat-0.9.7.1/checkftpusers.c
--- lsat-0.9.7.1~/checkftpusers.c	2008-05-04 08:47:28.000000000 -0430
+++ lsat-0.9.7.1/checkftpusers.c	2009-06-29 11:05:46.000000000 -0430
@@ -14,6 +14,8 @@
 #include <fcntl.h>
 #include <unistd.h>
 
+#define MAX_FTP_USERS 4000
+
 int checkftpusers(filename, verbose, html)
 const char *const filename;
 int verbose;
@@ -26,8 +28,8 @@
     /* the passwd list... we ass|u|me that a username */
     /* will be < 120 chars. :O   => line[120]	          */
     char line[120];	/* array for a line	*/
-    char temparray[100][120]; /*temparray. */
-    char tempstring[100][120];	/* string to hold ftpusername */
+    char temparray[MAX_FTP_USERS][120]; /*temparray. */
+    char tempstring[MAX_FTP_USERS][120];       /* string to hold ftpusername */
     int i=0;		/* counter variable	*/
     int j=0;		/* counter variable  */
     int k=0;		/* counter variable  */
@@ -46,7 +48,7 @@
     const char * header   =NULL;
 
     /* init temparray */
-    for (i=0; i<100; i++)
+    for (i=0; i<MAX_FTP_USERS; i++)
     {
         for (j=0; j<120; j++)
         {
@@ -179,7 +181,7 @@
         } /* end if (passptr != NULL) */
         /* inc the counter */
         i++;
-	if (i>100)
+	if (i>MAX_FTP_USERS)
 	{
 	    perror("Error in module checkftpusers: Too much data.\n");
 	    return(-1);
@@ -235,7 +237,7 @@
         } /* end if (ftpptr != NULL) */
         /* inc the linec ounter */
         linecount++;
-	if (linecount>100)
+	if (linecount>MAX_FTP_USERS)
 	{
 	    perror("Error in checkftpusers: Too much data.");
 	    return(-1);
@@ -245,7 +247,7 @@
 
     /* ok, now compare an entry in the userlist */
     /* we have against the entries in ftpusers  */
-    i = 100;
+    i = MAX_FTP_USERS;
     for (j = 0; j < i; j++)
     {
         for (k=0; k < linecount; k++)