]> git.pld-linux.org Git - packages/pure-ftpd.git/commitdiff
This commit was manufactured by cvs2git to create branch 'AC-branch'. auto/ac/pure-ftpd-1_0_21-7
authorcvs2git <feedback@pld-linux.org>
Fri, 18 Jan 2008 09:11:39 +0000 (09:11 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Cherrypick from master 2008-01-18 09:11:39 UTC Paweł Gołaszewski <blues@pld-linux.org> '- fix passwd files location':
    pure-ftpd-anonymous.patch -> 1.1
    pure-ftpd-del-log-path.patch -> 1.2
    pure-ftpd-passwd_location.patch -> 1.1
    pure-ftpd-sleep.patch -> 1.2

pure-ftpd-anonymous.patch [new file with mode: 0644]
pure-ftpd-del-log-path.patch [new file with mode: 0644]
pure-ftpd-passwd_location.patch [new file with mode: 0644]
pure-ftpd-sleep.patch [new file with mode: 0644]

diff --git a/pure-ftpd-anonymous.patch b/pure-ftpd-anonymous.patch
new file mode 100644 (file)
index 0000000..5a8a1a1
--- /dev/null
@@ -0,0 +1,13 @@
+; If -E is specified (no anonymous logins) then treat "ftp" and "anonymous" logins like normal user logins
+diff -urN pure-ftpd-1.0.21.org/src/ftpd.c pure-ftpd-1.0.21/src/ftpd.c
+--- pure-ftpd-1.0.21.org/src/ftpd.c    2006-02-21 14:14:49.000000000 +0100
++++ pure-ftpd-1.0.21/src/ftpd.c        2007-06-28 13:29:57.644688176 +0200
+@@ -1153,7 +1153,7 @@
+         return;
+     }
+     if (anon_only <= 0 && username != NULL && *username != 0 &&
+-        strcasecmp(username, "ftp") && strcasecmp(username, "anonymous")) {
++        (anon_only < 0 || (strcasecmp(username, "ftp") && strcasecmp(username, "anonymous")))) {
+         strncpy(account, username, sizeof(account) - 1);
+         account[sizeof(account) - (size_t) 1U] = 0;
+         addreply(331, MSG_USER_OK, account);
diff --git a/pure-ftpd-del-log-path.patch b/pure-ftpd-del-log-path.patch
new file mode 100644 (file)
index 0000000..5aef5bc
--- /dev/null
@@ -0,0 +1,12 @@
+diff -urN pure-ftpd-1.0.21.org/src/ftpd.c pure-ftpd-1.0.21/src/ftpd.c
+--- pure-ftpd-1.0.21.org/src/ftpd.c    2006-02-21 14:14:49.000000000 +0100
++++ pure-ftpd-1.0.21/src/ftpd.c        2007-06-21 17:58:13.317607572 +0200
+@@ -2662,7 +2662,7 @@
+     }
+ #endif
+     addreply(250, MSG_DELE_SUCCESS, name);
+-    logfile(LOG_NOTICE, MSG_DELE_SUCCESS, name);    
++    logfile(LOG_NOTICE, "%s: " MSG_DELE_SUCCESS, wd, name);    
+     return;
+     
+     denied:
diff --git a/pure-ftpd-passwd_location.patch b/pure-ftpd-passwd_location.patch
new file mode 100644 (file)
index 0000000..522b87f
--- /dev/null
@@ -0,0 +1,173 @@
+--- ./man/pure-pw.8.org        2005-04-18 21:51:04.000000000 +0200
++++ ./man/pure-pw.8    2008-01-18 10:06:00.000000000 +0100
+@@ -49,18 +49,18 @@
+ all are chrooted, and they have their own home directory.
+ .SH "FILES"
+ .LP 
+-\fI/etc/pureftpd.passwd\fP
++\fI/etc/ftp/pureftpd.passwd\fP
+ .br
+-\fI/etc/pureftpd.pdb\fP 
++\fI/etc/ftp/pureftpd.pdb\fP 
+ .SH "ENVIRONMENT VARIABLES"
+ .LP 
+ \fIPURE_PASSWDFILE\fP
+ If this variable is defined, this is the default value for the text password
+-file. Without this variable, /etc/pureftpd.passwd is assumed.
++file. Without this variable, /etc/ftp/pureftpd.passwd is assumed.
+ .br
+ \fIPURE_DBFILE\fP 
+ If this variable is defined, this is the default value for the PureDB password
+-file. Without this variable, /etc/pureftpd.pdb is assumed.
++file. Without this variable, /etc/ftp/pureftpd.pdb is assumed.
+ .SH "EXAMPLES"
+ .LP 
+ Please read http://www.pureftpd.org/README.Virtual\-Users
+--- ./FAQ.org  2004-07-22 09:37:00.000000000 +0200
++++ ./FAQ      2008-01-18 10:03:04.000000000 +0100
+@@ -316,25 +316,25 @@
+-* Virtual users: /etc/pureftpd.pdb .
++* Virtual users: /etc/ftp/pureftpd.pdb .
+--> I made changes to /etc/pureftpd.passwd but the server doesn't understand
++-> I made changes to /etc/ftp/pureftpd.passwd but the server doesn't understand
+ them: I can't access any account I just created.
+-The server never reads /etc/pureftpd.passwd directly. Instead, it reads
+-/etc/pureftpd.pdb (or whatever file name you gave after -lpuredb:...) .
++The server never reads /etc/ftp/pureftpd.passwd directly. Instead, it reads
++/etc/ftp/pureftpd.pdb (or whatever file name you gave after -lpuredb:...) .
+-This file is a copy of /etc/pureftpd.passwd, but in a binary format,
++This file is a copy of /etc/ftp/pureftpd.passwd, but in a binary format,
+ optimized for fast lookups.
+-After having made a manual change to /etc/pureftpd.passwd, you must rebuild
+-/etc/pureftpd.pdb with the following commands:
++After having made a manual change to /etc/ftp/pureftpd.passwd, you must rebuild
++/etc/ftp/pureftpd.pdb with the following commands:
+ pure-pw mkdb
+ If you add/delete/modify user accounts with pure-pw useradd/usermod/userdel/
+ passwd, don't forget the '-m' option to automatically rebuild
+-/etc/pureftpd.pdb and not only update /etc/pureftpd.passwd .
++/etc/ftp/pureftpd.pdb and not only update /etc/ftp/pureftpd.passwd .
+@@ -630,7 +630,7 @@
+ Let's start the FTP server:
+-/usr/local/sbin/pure-ftpd -lpuredb:/etc/pureftpd.pdb -H -B
++/usr/local/sbin/pure-ftpd -lpuredb:/etc/ftp/pureftpd.pdb -H -B
+ Everything should be ok now.
+--- ./README.Virtual-Users.org 2004-02-29 22:49:37.000000000 +0100
++++ ./README.Virtual-Users     2008-01-18 10:05:10.000000000 +0100
+@@ -101,7 +101,7 @@
+ servers. Use per-ip limits instead.
+ Ok, "joe" has been created. By default, the list of virtual users is stored
+-in the /etc/pureftpd.passwd file (you can of course change this with -f
++in the /etc/ftp/pureftpd.passwd file (you can of course change this with -f
+ <file>) .
+ Let's have a look at its content:
+@@ -127,7 +127,7 @@
+                       pure-pw usermod joe -n 1000 -N 10
+-Let's have a look at /etc/pureftpd.passwd:
++Let's have a look at /etc/ftp/pureftpd.passwd:
+ joe:$1$LX/3.F60$bYdYwsQOYIaWq.Ko.hfI3.:500:101::/home/ftpusers/joe/./::::::1000:10485760::::::
+@@ -173,7 +173,7 @@
+       ------------------------ DISPLAYING INFO ------------------------
+       
+-To review info about one user, reading the /etc/pureftpd.passwd file is ok,
++To review info about one user, reading the /etc/ftp/pureftpd.passwd file is ok,
+ but it's not really human-friendly.
+ It's why you can use "pure-pw show", whoose syntax is:
+@@ -213,22 +213,22 @@
+ IMPORTANT:
+ You can add, modify and delete users with the previous commands, or by
+-editing /etc/pureftpd.passwd by hand. But the FTP server won't consider the
++editing /etc/ftp/pureftpd.passwd by hand. But the FTP server won't consider the
+ changes you make to that file, until you commit them.
+ Commiting changes really means that a new file is created from
+-/etc/pureftpd.passwd (or whatever file name you choose) . That new file is a
++/etc/ftp/pureftpd.passwd (or whatever file name you choose) . That new file is a
+ PureDB file. It contains exactly the same info than the other file. But in
+ that file, accounts are sorted and indexed for faster access, even with
+ thousands of accounts. PureDB files are binary files, don't try to view them
+ or your terminal will beep like hell.
+-Let's create a PureDB file from /etc/pureftpd.passwd. The indexed file will
+-be called /etc/pureftpd.pdb (as always, choose whatever name you like):
++Let's create a PureDB file from /etc/ftp/pureftpd.passwd. The indexed file will
++be called /etc/ftp/pureftpd.pdb (as always, choose whatever name you like):
+                                 pure-pw mkdb
+                         
+-this reads /etc/pureftpd.passwd and creates /etc/pureftpd.pdb by default, but
++this reads /etc/ftp/pureftpd.passwd and creates /etc/ftp/pureftpd.pdb by default, but
+ to read another file, add the pdb file, optionnaly followed by -f <passwd file>
+ For instance:
+@@ -244,13 +244,13 @@
+ You can also change something to the text passwords file (add users, change
+ password, delete users, etc) and automatically run 
+-"pure-pw mkdb /etc/pureftpd.pdb" afterwards. To do so, just use the -m
++"pure-pw mkdb /etc/ftp/pureftpd.pdb" afterwards. To do so, just use the -m
+ switch:
+ pure-pw passwd joe -m
+ This command will change Joe's password in pureftpd.passwd *and* commit the
+-change to /etc/pureftpd.pwd .
++change to /etc/ftp/pureftpd.pwd .
+   ------------------------ ENABLING VIRTUAL USERS ------------------------
+@@ -270,7 +270,7 @@
+ Let's run the server with automatic creation of home directories and puredb
+ authentication:
+-/usr/local/sbin/pure-ftpd -j -lpuredb:/etc/pureftpd.pdb &
++/usr/local/sbin/pure-ftpd -j -lpuredb:/etc/ftp/pureftpd.pdb &
+ Try to 'ftp localhost' and log in as joe.
+@@ -283,7 +283,7 @@
+ Just run it:
+-                    pure-pwconvert >> /etc/pureftpd.passwd
++                    pure-pwconvert >> /etc/ftp/pureftpd.passwd
+ If you do it as a non-privileged user, passwords won't be filled in. If you
+@@ -298,9 +298,9 @@
+   
+ If defined, a PURE_PASSWDFILE environment variable can set the default path
+ to the pureftpd.passwd file. Without this variable, it defaults to
+-/etc/pureftpd.passwd .  
++/etc/ftp/pureftpd.passwd .  
+   
+ If defined, a PURE_DBFILE environment variable can set the default path
+ to the pureftpd.pdb file. Without this variable, it defaults to
+-/etc/pureftpd.pdb .  
++/etc/ftp/pureftpd.pdb .  
+   
diff --git a/pure-ftpd-sleep.patch b/pure-ftpd-sleep.patch
new file mode 100644 (file)
index 0000000..6e4b984
--- /dev/null
@@ -0,0 +1,57 @@
+--- pure-ftpd/src/ftpd.c.orig  2007-12-20 09:59:10.629736723 +0100
++++ pure-ftpd/src/ftpd.c       2007-12-20 10:02:06.655676098 +0100
+@@ -1531,6 +1531,11 @@
+     return chdir(home);
+ }
++static void randomsleep(unsigned int t) {
++    usleep2((unsigned long) (zrand() % PASSWD_FAILURE_DELAY));        
++    usleep2(t * PASSWD_FAILURE_DELAY);
++}
++
+ void dopass(char *password)
+ {
+     static unsigned int tapping;    
+@@ -1571,27 +1576,28 @@
+         }
+     }
+     if (authresult.auth_ok != 1) {
+-        addreply_noformat(530, MSG_AUTH_FAILED);
+-        doreply();
+-        if (tapping >= MAX_PASSWD_TRIES) {
+-            toomanytries:
+-            logfile(LOG_ERR, MSG_AUTH_TOOMANY);
+-            _EXIT(EXIT_FAILURE);
+-        }
+-        logfile(LOG_WARNING, MSG_AUTH_FAILED_LOG, account);
+-        randomsleep:
+         tapping++;
+-        usleep2((unsigned long) (zrand() % PASSWD_FAILURE_DELAY));        
+-        usleep2(tapping * PASSWD_FAILURE_DELAY);
++      randomsleep(tapping);
++      addreply_noformat(530, MSG_AUTH_FAILED);
++      doreply();
++      if (tapping > MAX_PASSWD_TRIES) {
++          logfile(LOG_ERR, MSG_AUTH_TOOMANY);
++          _EXIT(EXIT_FAILURE);
++      }
++      logfile(LOG_WARNING, MSG_AUTH_FAILED_LOG, account);
+         return;
+     }
+     if (authresult.uid < useruid) {
+         logfile(LOG_WARNING, MSG_ACCOUNT_DISABLED, account);
++      randomsleep(tapping);
+         if (tapping >= MAX_PASSWD_TRIES) {
+-            goto toomanytries;
++          addreply_noformat(530, MSG_AUTH_FAILED);
++          doreply();
++          _EXIT(EXIT_FAILURE);
+         }
+-        addreply_noformat(530, MSG_NOTRUST);
+-        goto randomsleep;
++      addreply_noformat(530, MSG_NOTRUST);
++      doreply();
++      return;
+     }
+ #ifdef PER_USER_LIMITS
This page took 0.580286 seconds and 4 git commands to generate.