update to 1.2.0rc3

Submitted by:	Anders Nordby <anders@fix.no>
This commit is contained in:
Michael Haro 2001-02-11 21:26:53 +00:00
parent 997a4fc92e
commit 69f919197f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=38226
18 changed files with 2824 additions and 148 deletions

View File

@ -6,21 +6,20 @@
#
PORTNAME= proftpd
PORTVERSION= 1.2.0rc2
PORTREVISION= 1
PORTVERSION= 1.2.0rc3
CATEGORIES= ftp
MASTER_SITES= ftp://ftp.tos.net/pub/proftpd/ \
ftp://ftp.stikman.com/pub/proftpd/ \
ftp://ftp.linux.co.uk/pub/packages/proftpd/ \
ftp://ftp.drenik.net/linux/ftp/proftpd/
DISTNAME= ${PORTNAME}-1.2.0rc2
DISTNAME= ${PORTNAME}-1.2.0rc3
MAINTAINER= mharo@FreeBSD.org
.if defined(WITH_LDAP)
MASTER_SITES+= http://www.horde.net/~jwm/software/proftpd-ldap/
MOD_LDAP= mod_ldap-2.6.1.tar.gz
DISTFILES= ${DISTNAME}.${EXTRACT_SUFX} ${MOD_LDAP}
MOD_LDAP= mod_ldap-2.7.4.tar.gz
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${MOD_LDAP}
.endif
MAN1= ftpcount.1 ftpwho.1
@ -34,7 +33,7 @@ CONFIGURE_ARGS= --localstatedir=/var/run \
--disable-sendfile
#allow user to override
MODULES?= mod_ratio:mod_readme:mod_tar
MODULES?= mod_ratio:mod_readme
.if defined(WITH_LDAP)
MODULES:=$(MODULES):mod_ldap
@ -42,6 +41,11 @@ BUILD_DEPENDS+= ${LOCALBASE}/lib/libldap.a:${PORTSDIR}/net/openldap
CONFIGURE_ENV+= CFLAGS="-I/usr/local/include -g" LDFLAGS=-L/usr/local/lib
.endif
# Currently not supported by the ProFTPd project, but it's patched in with
# bugfixes as well. For myself (anders@fix.no):
# patch-bc: bugid 330 (cached passwords not cleared properly)
# patch-bd: bugid 405 (sqlauthorative broken)
# patch-be: bugid 457 (speed improvement)
.if defined(WITH_MYSQL)
MODULES:=$(MODULES):mod_sqlpw:mod_mysql
LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client

View File

@ -1,2 +1,2 @@
MD5 (proftpd-1.2.0rc2.tar.gz) = 13e48f0f4006738ffb9aa7c28ab0ae63
MD5 (mod_ldap-2.6.1.tar.gz) = 0e866a3137641e20e546543ed1c91760
MD5 (proftpd-1.2.0rc3.tar.gz) = 0b2b32cec7138cdc1ba4b2a99148bb93
MD5 (mod_ldap-2.7.4.tar.gz) = 7b3e948d89d2089b5c0b03fb9d22c050

View File

@ -1,6 +1,6 @@
--- modules/mod_auth.c.orig Fri Jul 28 10:51:59 2000
+++ modules/mod_auth.c Fri Jul 28 10:52:17 2000
@@ -72,7 +72,7 @@
--- modules/mod_auth.c.old Sun Feb 11 19:42:37 2001
+++ modules/mod_auth.c Sun Feb 11 19:43:18 2001
@@ -94,7 +94,7 @@
"closing control connection.",
TimeoutLogin);
@ -9,7 +9,7 @@
(void*) 0, NULL);
/* should never be reached */
@@ -608,7 +608,7 @@
@@ -630,7 +630,7 @@
c = _auth_resolve_user(p,&user,&ourname,&anonname);
if(!user) {
@ -18,7 +18,7 @@
origuser);
goto auth_failure;
}
@@ -617,7 +617,7 @@
@@ -639,7 +639,7 @@
aclp = login_check_limits(main_server->conf,FALSE,TRUE,&i);
if((pw = auth_getpwnam(p,user)) == NULL) {
@ -27,7 +27,7 @@
goto auth_failure;
}
@@ -678,14 +678,14 @@
@@ -700,14 +700,14 @@
}
if(!login_check_limits(c->subset,FALSE,TRUE,&i) || (!aclp && !i) ){
@ -44,7 +44,7 @@
origuser);
goto auth_failure;
}
@@ -702,7 +702,7 @@
@@ -724,7 +724,7 @@
if(c && origuser && strcasecmp(user,origuser) &&
get_param_int(c->subset,"AuthUsingAlias",FALSE) == 1) {
user_name = origuser;
@ -53,7 +53,7 @@
user, user_name);
}
@@ -730,22 +730,22 @@
@@ -752,22 +752,22 @@
switch(authcode) {
case AUTH_NOPWD:
@ -80,7 +80,7 @@
user);
goto auth_failure;
@@ -768,12 +768,12 @@
@@ -790,12 +790,12 @@
auth_setgrent(p);
if(!_auth_check_shell((c ? c->subset : main_server->conf),pw->pw_shell)) {
@ -95,7 +95,7 @@
user, FTPUSERS_PATH);
goto auth_failure;
}
@@ -845,7 +845,7 @@
@@ -870,7 +870,7 @@
if(!login_check_limits((c ? c->subset : main_server->conf),FALSE,TRUE,&i))
{
@ -104,7 +104,7 @@
origuser);
goto auth_failure;
}
@@ -860,7 +860,7 @@
@@ -885,7 +885,7 @@
if(c && c->subset)
resolve_anonymous_dirs(c->subset);
@ -113,61 +113,70 @@
(c != NULL) ? "ANON" : "USER",
origuser);
@@ -1172,7 +1172,7 @@
if(failnopwprompt) {
if(!user) {
- log_pri(LOG_NOTICE, "USER %s (Login failed): Not a UserAlias.",
+ log_pri(LOG_INFO, "USER %s (Login failed): Not a UserAlias.",
origuser);
send_response(R_530,"Login incorrect.");
@@ -1267,7 +1267,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_auth(LOG_NOTICE, "Connection refused (max clients for class %s).",
+ log_auth(LOG_INFO, "Connection refused (max clients for class %s).",
session.class->name);
end_login(0);
@@ -1189,7 +1189,7 @@
if(c) {
if(!login_check_limits(c->subset,FALSE,TRUE,&i) || (!aclp && !i) ) {
- log_auth(LOG_NOTICE, "ANON %s: Limit access denies login.",
+ log_auth(LOG_INFO, "ANON %s: Limit access denies login.",
origuser);
send_response(R_530,"Login incorrect.");
end_login(0);
@@ -1197,7 +1197,7 @@
}
if(!c && !aclp) {
- log_auth(LOG_NOTICE, "USER %s: Limit access denies login.", origuser);
+ log_auth(LOG_INFO, "USER %s: Limit access denies login.", origuser);
send_response(R_530,"Login incorrect.");
end_login(0);
}
@@ -1269,7 +1269,7 @@
"Too many users in your class, "
"please try again later.");
- log_auth(LOG_NOTICE, "Connection refused (max clients for class %s).",
+ log_auth(LOG_INFO, "Connection refused (max clients for class %s).",
session.class->name);
end_login(0);
@@ -1304,7 +1304,7 @@
send_response(R_530,"%s",
sreplace(cmd->tmp_pool,maxstr,"%m",maxn,NULL));
@@ -1299,7 +1299,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_auth(LOG_NOTICE, "Connection refused (max clients per host %d).",
+ log_auth(LOG_INFO, "Connection refused (max clients per host %d).",
max);
end_login(0);
@@ -1330,7 +1330,7 @@
if(cur >= max) {
@@ -1324,7 +1324,7 @@
send_response(R_530, "%s",
sreplace(cmd->tmp_pool, maxstr, "%m", maxn, NULL));
- log_auth(LOG_NOTICE, "Connection refused (max clients %d).", max);
+ log_auth(LOG_INFO, "Connection refused (max clients %d).", max);
end_login(0);
}
@@ -1411,7 +1411,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
@@ -1354,7 +1354,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_auth(LOG_NOTICE, "Connection refused (max clients per host %d).",
+ log_auth(LOG_INFO, "Connection refused (max clients per host %d).",
max);
end_login(0);
@@ -1401,7 +1401,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_pri(LOG_NOTICE, "USER %s (Login failed): Not a UserAlias.",
+ log_pri(LOG_INFO, "USER %s (Login failed): Not a UserAlias.",
origuser);
send_response(R_530,"Login incorrect.");
@@ -1422,7 +1422,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_auth(LOG_NOTICE, "ANON %s: Limit access denies login.",
+ log_auth(LOG_INFO, "ANON %s: Limit access denies login.",
origuser);
send_response(R_530, "Login incorrect.");
@@ -1434,7 +1434,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_auth(LOG_NOTICE, "USER %s: Limit access denies login.", origuser);
+ log_auth(LOG_INFO, "USER %s: Limit access denies login.", origuser);
send_response(R_530, "Login incorrect.");
end_login(0);
@@ -1528,7 +1528,7 @@
if(++auth_tries >= max) {
send_response(R_530,"Login incorrect");

View File

@ -1,12 +0,0 @@
--- modules/mod_xfer.c.orig Mon Jul 31 16:49:19 2000
+++ modules/mod_xfer.c Mon Jul 31 16:50:02 2000
@@ -268,7 +268,8 @@
/* No PORT command has been issued.
*/
- if(session.d != NULL || !(session.flags & SF_PORT)) {
+ if(!(session.flags & SF_PASSIVE) &&
+ (session.d != NULL || !(session.flags & SF_PORT))) {
add_response_err(R_503, "No PORT command issued first.");
return ERROR(cmd);
}

View File

@ -0,0 +1,253 @@
--- contrib/mod_mysql.c.old Sun Feb 11 19:47:54 2001
+++ contrib/mod_mysql.c Sun Feb 11 19:45:37 2001
@@ -0,0 +1,250 @@
+/*
+ * ProFTPD: mod_mysql -- Support for connecting to MySQL databases.
+ * Time-stamp: <1999-10-04 03:21:21 root>
+ * Copyright (c) 1998-1999 Johnie Ingram.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#define MOD_MYSQL_VERSION "mod_mysql/2.0"
+
+/* -- DO NOT MODIFY THE LINE BELOW UNLESS YOU FEEL LIKE IT --
+ * $Libraries: -lm -lmysqlclient $
+ */
+
+/* This is mod_mysql, contrib software for proftpd 1.2.0pre3 and above.
+ For more information contact Johnie Ingram <johnie@netgod.net>.
+
+ History Log:
+
+ * 1999-09-19: v2.0: Most directives split into mod_sql; invented API.
+
+*/
+
+#include "conf.h"
+#include <mysql.h>
+
+/* *INDENT-OFF* */
+
+static MYSQL mod_mysql_server;
+static MYSQL *mysqldb = 0;
+
+/* Maximum username field to expect, etc. */
+#define ARBITRARY_MAX 128
+
+static struct
+{
+ char *sql_host; /* Data for connecting, set by MySQLInfo. */
+ char *sql_user;
+ char *sql_pass;
+ char *sql_dbname;
+
+ int ok;
+ int opens;
+} g;
+
+/* *INDENT-ON* */
+
+/* **************************************************************** */
+
+MODRET
+sql_cmd_close (cmd_rec * cmd)
+{
+ log_debug (DEBUG5, "mysql: close [%i] for %s", g.opens, cmd->argv[0]);
+
+ if (!g.ok || g.opens--)
+ return DECLINED (cmd);
+
+ if (mysqldb)
+ {
+ log_debug (DEBUG4, "mysql: disconnecting: %s", mysql_stat (mysqldb));
+ mysql_close (mysqldb);
+ }
+ mysqldb = NULL;
+ return DECLINED (cmd);
+}
+
+MODRET
+sql_cmd_open (cmd_rec * cmd)
+{
+ if (!g.ok)
+ return DECLINED (cmd);
+
+ g.opens++;
+ log_debug (DEBUG5, "mysql: open [%i] for %s", g.opens, cmd->argv[0]);
+ if (g.opens > 1)
+ return HANDLED (cmd);
+
+ if (!(mysqldb = mysql_connect (&mod_mysql_server, g.sql_host,
+ g.sql_user, g.sql_pass)))
+ {
+ log_pri (LOG_ERR, "mysql: client %s connect FAILED to %s@%s",
+ mysql_get_client_info (), g.sql_user, g.sql_host);
+ g.ok = FALSE;
+ g.opens = 0;
+ return DECLINED (cmd);
+ }
+ log_debug (DEBUG5, "mysql: connect OK %s -> %s (%s@%s)",
+ mysql_get_client_info (), mysql_get_server_info (mysqldb),
+ g.sql_user, g.sql_host);
+
+ return HANDLED (cmd);
+}
+
+MODRET
+_do_query (cmd_rec * cmd, const char *query, int update)
+{
+ int error = 1;
+
+ if (!g.ok)
+ return DECLINED (cmd);
+
+ block_signals ();
+
+ /* This forces a quick ping of the remote server, so we know if its there. */
+ if (mysqldb)
+ mysql_select_db (mysqldb, g.sql_dbname);
+
+ if (!mysqldb
+ || ((error = mysql_query (mysqldb, query))
+ && !strcasecmp (mysql_error (mysqldb), "mysql server has gone")))
+ {
+ /* We need to restart the server link. */
+ if (mysqldb)
+ log_pri (LOG_ERR, "mysql: server has wandered off (%s/%s)",
+ g.sql_host, g.sql_dbname);
+ sql_cmd_open (cmd);
+ if (!mysqldb)
+ return DECLINED (cmd);
+ error = mysql_select_db (mysqldb, g.sql_dbname)
+ || mysql_query (mysqldb, query);
+ }
+
+ unblock_signals ();
+
+ if (error)
+ {
+ log_debug (DEBUG4, "mysql: %s failed: \"%s\": %s",
+ (update) ? "update" : "select",
+ query, mysql_error (mysqldb));
+ return DECLINED (cmd);
+ }
+
+ log_debug (DEBUG5, "mysql: %s OK: [%s] \"%s\"",
+ (update) ? "update" : "select", g.sql_dbname, query);
+ return HANDLED (cmd);
+}
+
+MODRET
+sql_cmd_update (cmd_rec * cmd)
+{
+ return _do_query (cmd, cmd->argv[1], TRUE);
+}
+
+MODRET
+sql_cmd_select (cmd_rec * cmd)
+{
+ MODRET mr;
+ MYSQL_RES *result;
+ MYSQL_ROW sql_row;
+ int i, j;
+
+ mr = _do_query (cmd, cmd->argv[1], FALSE);
+ if (!MODRET_ISHANDLED (mr))
+ return DECLINED (mr);
+
+ if ((result = mysql_store_result (mysqldb)))
+ {
+ int rcount = mysql_num_rows (result);
+ int fcount = mysql_num_fields (result);
+ int count = rcount * fcount;
+
+ char **data = pcalloc (cmd->tmp_pool, sizeof (char *) * (count + 1));
+ for (i = 0, count = 0; i < rcount; i++)
+ {
+ sql_row = mysql_fetch_row (result);
+ for (j = 0; j < fcount; j++)
+ data[count++] = pstrdup (cmd->tmp_pool, sql_row[j]);
+ }
+ mysql_free_result (result);
+ data[count] = NULL;
+ mr->data = data;
+ }
+ return mr;
+}
+
+static authtable mysql_authtab[] = {
+ {0, "dbd_open", sql_cmd_open},
+ {0, "dbd_close", sql_cmd_close},
+ {0, "dbd_update", sql_cmd_update},
+ {0, "dbd_select", sql_cmd_select},
+
+ {0, NULL, NULL}
+};
+
+/* **************************************************************** */
+
+MODRET set_sqlinfo (cmd_rec * cmd)
+{
+ CHECK_ARGS (cmd, 4);
+ CHECK_CONF (cmd, CONF_ROOT | CONF_GLOBAL | CONF_VIRTUAL);
+ add_config_param_str ("MySQLInfo", 4,
+ (void *) cmd->argv[1], (void *) cmd->argv[2],
+ (void *) cmd->argv[3], (void *) cmd->argv[4]);
+ return HANDLED (cmd);
+}
+
+static conftable mysql_conftab[] = {
+/* *INDENT-OFF* */
+
+ { "MySQLInfo", set_sqlinfo, NULL },
+
+ { 0, NULL }
+
+/* *INDENT-ON* */
+};
+
+/* **************************************************************** */
+
+static int
+mysql_modinit ()
+{
+ config_rec *c;
+
+ memset (&g, 0, sizeof (g));
+ if (!(c = find_config (CURRENT_CONF, CONF_PARAM, "MySQLInfo", FALSE)))
+ return 0;
+
+ g.sql_host = pstrdup (session.pool, c->argv[0]);
+ g.sql_user = pstrdup (session.pool, c->argv[1]);
+ g.sql_pass = pstrdup (session.pool, c->argv[2]);
+ g.sql_dbname = pstrdup (session.pool, c->argv[3]);
+ g.ok = TRUE;
+
+ log_debug (DEBUG5, "%s: configured: db %s at %s@%s",
+ MOD_MYSQL_VERSION, g.sql_dbname, g.sql_user, g.sql_host);
+ return 0;
+}
+
+module mysql_module = {
+ NULL, NULL, /* Always NULL */
+ 0x20, /* API Version 2.0 */
+ "mysql",
+ mysql_conftab, /* SQL configuration handler table */
+ NULL, /* SQL command handler table */
+ mysql_authtab, /* SQL authentication handler table */
+ mysql_modinit, /* Pre-fork "parent-mode" init */
+ mysql_modinit /* Post-fork "child mode" init */
+};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
--- contrib/mod_sqlpw.c.old Sun Feb 11 19:52:06 2001
+++ contrib/mod_sqlpw.c Sun Feb 11 19:53:42 2001
@@ -302,8 +302,6 @@
if (!g.homedir)
return DECLINED (cmd);
- if (!g.pw.pw_name)
- {
g.pw.pw_name = pstrdup(session.pool, cmd->argv[0]);
if (g.sql_uid)
g.pw.pw_uid = atoi (_uservar (cmd, cmd->argv[0], g.sql_uid) ? : "0");
@@ -323,7 +321,6 @@
/* FIXME: unnecessary mysqlism */
mysql_escape_string (g.user, g.pw.pw_name, strlen (g.pw.pw_name));
g.user[ARBITRARY_MAX - 1] = 0;
- }
return mod_create_data (cmd, &g.pw);
}

View File

@ -0,0 +1,21 @@
--- contrib/mod_sqlpw.c.old Sun Feb 11 20:14:40 2001
+++ contrib/mod_sqlpw.c Sun Feb 11 20:16:00 2001
@@ -400,9 +400,6 @@
int return_type;
int retval = AUTH_NOPWD;
- if (!g.sql_passwd || !g.homedir)
- return DECLINED (cmd);
-
/* Figure out our default return style: Whether or not SQL should
* allow other auth modules a shot at this user or not is controlled
* by the parameter "SQLAuthoritative". Like mod_pam this
@@ -418,6 +415,8 @@
if ((user = cmd->argv[0]) == NULL)
return return_type ? ERROR (cmd) : DECLINED (cmd);
if ((pass = cmd->argv[1]) == NULL)
+ return return_type ? ERROR (cmd) : DECLINED (cmd);
+ if (!g.sql_passwd || !g.homedir)
return return_type ? ERROR (cmd) : DECLINED (cmd);
if (!g.pass

View File

@ -0,0 +1,21 @@
--- contrib/mod_mysql.c.old Sun Feb 11 20:19:00 2001
+++ contrib/mod_mysql.c Sun Feb 11 20:21:29 2001
@@ -100,6 +100,9 @@
mysql_get_client_info (), mysql_get_server_info (mysqldb),
g.sql_user, g.sql_host);
+ if (mysqldb)
+ mysql_select_db (mysqldb, g.sql_dbname);
+
return HANDLED (cmd);
}
@@ -115,7 +118,7 @@
/* This forces a quick ping of the remote server, so we know if its there. */
if (mysqldb)
- mysql_select_db (mysqldb, g.sql_dbname);
+ mysql_ping( mysqldb );
if (!mysqldb
|| ((error = mysql_query (mysqldb, query))

View File

@ -6,21 +6,20 @@
#
PORTNAME= proftpd
PORTVERSION= 1.2.0rc2
PORTREVISION= 1
PORTVERSION= 1.2.0rc3
CATEGORIES= ftp
MASTER_SITES= ftp://ftp.tos.net/pub/proftpd/ \
ftp://ftp.stikman.com/pub/proftpd/ \
ftp://ftp.linux.co.uk/pub/packages/proftpd/ \
ftp://ftp.drenik.net/linux/ftp/proftpd/
DISTNAME= ${PORTNAME}-1.2.0rc2
DISTNAME= ${PORTNAME}-1.2.0rc3
MAINTAINER= mharo@FreeBSD.org
.if defined(WITH_LDAP)
MASTER_SITES+= http://www.horde.net/~jwm/software/proftpd-ldap/
MOD_LDAP= mod_ldap-2.6.1.tar.gz
DISTFILES= ${DISTNAME}.${EXTRACT_SUFX} ${MOD_LDAP}
MOD_LDAP= mod_ldap-2.7.4.tar.gz
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${MOD_LDAP}
.endif
MAN1= ftpcount.1 ftpwho.1
@ -34,7 +33,7 @@ CONFIGURE_ARGS= --localstatedir=/var/run \
--disable-sendfile
#allow user to override
MODULES?= mod_ratio:mod_readme:mod_tar
MODULES?= mod_ratio:mod_readme
.if defined(WITH_LDAP)
MODULES:=$(MODULES):mod_ldap
@ -42,6 +41,11 @@ BUILD_DEPENDS+= ${LOCALBASE}/lib/libldap.a:${PORTSDIR}/net/openldap
CONFIGURE_ENV+= CFLAGS="-I/usr/local/include -g" LDFLAGS=-L/usr/local/lib
.endif
# Currently not supported by the ProFTPd project, but it's patched in with
# bugfixes as well. For myself (anders@fix.no):
# patch-bc: bugid 330 (cached passwords not cleared properly)
# patch-bd: bugid 405 (sqlauthorative broken)
# patch-be: bugid 457 (speed improvement)
.if defined(WITH_MYSQL)
MODULES:=$(MODULES):mod_sqlpw:mod_mysql
LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client

View File

@ -1,2 +1,2 @@
MD5 (proftpd-1.2.0rc2.tar.gz) = 13e48f0f4006738ffb9aa7c28ab0ae63
MD5 (mod_ldap-2.6.1.tar.gz) = 0e866a3137641e20e546543ed1c91760
MD5 (proftpd-1.2.0rc3.tar.gz) = 0b2b32cec7138cdc1ba4b2a99148bb93
MD5 (mod_ldap-2.7.4.tar.gz) = 7b3e948d89d2089b5c0b03fb9d22c050

View File

@ -1,6 +1,6 @@
--- modules/mod_auth.c.orig Fri Jul 28 10:51:59 2000
+++ modules/mod_auth.c Fri Jul 28 10:52:17 2000
@@ -72,7 +72,7 @@
--- modules/mod_auth.c.old Sun Feb 11 19:42:37 2001
+++ modules/mod_auth.c Sun Feb 11 19:43:18 2001
@@ -94,7 +94,7 @@
"closing control connection.",
TimeoutLogin);
@ -9,7 +9,7 @@
(void*) 0, NULL);
/* should never be reached */
@@ -608,7 +608,7 @@
@@ -630,7 +630,7 @@
c = _auth_resolve_user(p,&user,&ourname,&anonname);
if(!user) {
@ -18,7 +18,7 @@
origuser);
goto auth_failure;
}
@@ -617,7 +617,7 @@
@@ -639,7 +639,7 @@
aclp = login_check_limits(main_server->conf,FALSE,TRUE,&i);
if((pw = auth_getpwnam(p,user)) == NULL) {
@ -27,7 +27,7 @@
goto auth_failure;
}
@@ -678,14 +678,14 @@
@@ -700,14 +700,14 @@
}
if(!login_check_limits(c->subset,FALSE,TRUE,&i) || (!aclp && !i) ){
@ -44,7 +44,7 @@
origuser);
goto auth_failure;
}
@@ -702,7 +702,7 @@
@@ -724,7 +724,7 @@
if(c && origuser && strcasecmp(user,origuser) &&
get_param_int(c->subset,"AuthUsingAlias",FALSE) == 1) {
user_name = origuser;
@ -53,7 +53,7 @@
user, user_name);
}
@@ -730,22 +730,22 @@
@@ -752,22 +752,22 @@
switch(authcode) {
case AUTH_NOPWD:
@ -80,7 +80,7 @@
user);
goto auth_failure;
@@ -768,12 +768,12 @@
@@ -790,12 +790,12 @@
auth_setgrent(p);
if(!_auth_check_shell((c ? c->subset : main_server->conf),pw->pw_shell)) {
@ -95,7 +95,7 @@
user, FTPUSERS_PATH);
goto auth_failure;
}
@@ -845,7 +845,7 @@
@@ -870,7 +870,7 @@
if(!login_check_limits((c ? c->subset : main_server->conf),FALSE,TRUE,&i))
{
@ -104,7 +104,7 @@
origuser);
goto auth_failure;
}
@@ -860,7 +860,7 @@
@@ -885,7 +885,7 @@
if(c && c->subset)
resolve_anonymous_dirs(c->subset);
@ -113,61 +113,70 @@
(c != NULL) ? "ANON" : "USER",
origuser);
@@ -1172,7 +1172,7 @@
if(failnopwprompt) {
if(!user) {
- log_pri(LOG_NOTICE, "USER %s (Login failed): Not a UserAlias.",
+ log_pri(LOG_INFO, "USER %s (Login failed): Not a UserAlias.",
origuser);
send_response(R_530,"Login incorrect.");
@@ -1267,7 +1267,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_auth(LOG_NOTICE, "Connection refused (max clients for class %s).",
+ log_auth(LOG_INFO, "Connection refused (max clients for class %s).",
session.class->name);
end_login(0);
@@ -1189,7 +1189,7 @@
if(c) {
if(!login_check_limits(c->subset,FALSE,TRUE,&i) || (!aclp && !i) ) {
- log_auth(LOG_NOTICE, "ANON %s: Limit access denies login.",
+ log_auth(LOG_INFO, "ANON %s: Limit access denies login.",
origuser);
send_response(R_530,"Login incorrect.");
end_login(0);
@@ -1197,7 +1197,7 @@
}
if(!c && !aclp) {
- log_auth(LOG_NOTICE, "USER %s: Limit access denies login.", origuser);
+ log_auth(LOG_INFO, "USER %s: Limit access denies login.", origuser);
send_response(R_530,"Login incorrect.");
end_login(0);
}
@@ -1269,7 +1269,7 @@
"Too many users in your class, "
"please try again later.");
- log_auth(LOG_NOTICE, "Connection refused (max clients for class %s).",
+ log_auth(LOG_INFO, "Connection refused (max clients for class %s).",
session.class->name);
end_login(0);
@@ -1304,7 +1304,7 @@
send_response(R_530,"%s",
sreplace(cmd->tmp_pool,maxstr,"%m",maxn,NULL));
@@ -1299,7 +1299,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_auth(LOG_NOTICE, "Connection refused (max clients per host %d).",
+ log_auth(LOG_INFO, "Connection refused (max clients per host %d).",
max);
end_login(0);
@@ -1330,7 +1330,7 @@
if(cur >= max) {
@@ -1324,7 +1324,7 @@
send_response(R_530, "%s",
sreplace(cmd->tmp_pool, maxstr, "%m", maxn, NULL));
- log_auth(LOG_NOTICE, "Connection refused (max clients %d).", max);
+ log_auth(LOG_INFO, "Connection refused (max clients %d).", max);
end_login(0);
}
@@ -1411,7 +1411,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
@@ -1354,7 +1354,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_auth(LOG_NOTICE, "Connection refused (max clients per host %d).",
+ log_auth(LOG_INFO, "Connection refused (max clients per host %d).",
max);
end_login(0);
@@ -1401,7 +1401,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_pri(LOG_NOTICE, "USER %s (Login failed): Not a UserAlias.",
+ log_pri(LOG_INFO, "USER %s (Login failed): Not a UserAlias.",
origuser);
send_response(R_530,"Login incorrect.");
@@ -1422,7 +1422,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_auth(LOG_NOTICE, "ANON %s: Limit access denies login.",
+ log_auth(LOG_INFO, "ANON %s: Limit access denies login.",
origuser);
send_response(R_530, "Login incorrect.");
@@ -1434,7 +1434,7 @@
remove_config(cmd->server->conf, C_USER, FALSE);
remove_config(cmd->server->conf, C_PASS, FALSE);
- log_auth(LOG_NOTICE, "USER %s: Limit access denies login.", origuser);
+ log_auth(LOG_INFO, "USER %s: Limit access denies login.", origuser);
send_response(R_530, "Login incorrect.");
end_login(0);
@@ -1528,7 +1528,7 @@
if(++auth_tries >= max) {
send_response(R_530,"Login incorrect");

View File

@ -1,12 +0,0 @@
--- modules/mod_xfer.c.orig Mon Jul 31 16:49:19 2000
+++ modules/mod_xfer.c Mon Jul 31 16:50:02 2000
@@ -268,7 +268,8 @@
/* No PORT command has been issued.
*/
- if(session.d != NULL || !(session.flags & SF_PORT)) {
+ if(!(session.flags & SF_PASSIVE) &&
+ (session.d != NULL || !(session.flags & SF_PORT))) {
add_response_err(R_503, "No PORT command issued first.");
return ERROR(cmd);
}

253
ftp/proftpd/files/patch-ba Normal file
View File

@ -0,0 +1,253 @@
--- contrib/mod_mysql.c.old Sun Feb 11 19:47:54 2001
+++ contrib/mod_mysql.c Sun Feb 11 19:45:37 2001
@@ -0,0 +1,250 @@
+/*
+ * ProFTPD: mod_mysql -- Support for connecting to MySQL databases.
+ * Time-stamp: <1999-10-04 03:21:21 root>
+ * Copyright (c) 1998-1999 Johnie Ingram.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#define MOD_MYSQL_VERSION "mod_mysql/2.0"
+
+/* -- DO NOT MODIFY THE LINE BELOW UNLESS YOU FEEL LIKE IT --
+ * $Libraries: -lm -lmysqlclient $
+ */
+
+/* This is mod_mysql, contrib software for proftpd 1.2.0pre3 and above.
+ For more information contact Johnie Ingram <johnie@netgod.net>.
+
+ History Log:
+
+ * 1999-09-19: v2.0: Most directives split into mod_sql; invented API.
+
+*/
+
+#include "conf.h"
+#include <mysql.h>
+
+/* *INDENT-OFF* */
+
+static MYSQL mod_mysql_server;
+static MYSQL *mysqldb = 0;
+
+/* Maximum username field to expect, etc. */
+#define ARBITRARY_MAX 128
+
+static struct
+{
+ char *sql_host; /* Data for connecting, set by MySQLInfo. */
+ char *sql_user;
+ char *sql_pass;
+ char *sql_dbname;
+
+ int ok;
+ int opens;
+} g;
+
+/* *INDENT-ON* */
+
+/* **************************************************************** */
+
+MODRET
+sql_cmd_close (cmd_rec * cmd)
+{
+ log_debug (DEBUG5, "mysql: close [%i] for %s", g.opens, cmd->argv[0]);
+
+ if (!g.ok || g.opens--)
+ return DECLINED (cmd);
+
+ if (mysqldb)
+ {
+ log_debug (DEBUG4, "mysql: disconnecting: %s", mysql_stat (mysqldb));
+ mysql_close (mysqldb);
+ }
+ mysqldb = NULL;
+ return DECLINED (cmd);
+}
+
+MODRET
+sql_cmd_open (cmd_rec * cmd)
+{
+ if (!g.ok)
+ return DECLINED (cmd);
+
+ g.opens++;
+ log_debug (DEBUG5, "mysql: open [%i] for %s", g.opens, cmd->argv[0]);
+ if (g.opens > 1)
+ return HANDLED (cmd);
+
+ if (!(mysqldb = mysql_connect (&mod_mysql_server, g.sql_host,
+ g.sql_user, g.sql_pass)))
+ {
+ log_pri (LOG_ERR, "mysql: client %s connect FAILED to %s@%s",
+ mysql_get_client_info (), g.sql_user, g.sql_host);
+ g.ok = FALSE;
+ g.opens = 0;
+ return DECLINED (cmd);
+ }
+ log_debug (DEBUG5, "mysql: connect OK %s -> %s (%s@%s)",
+ mysql_get_client_info (), mysql_get_server_info (mysqldb),
+ g.sql_user, g.sql_host);
+
+ return HANDLED (cmd);
+}
+
+MODRET
+_do_query (cmd_rec * cmd, const char *query, int update)
+{
+ int error = 1;
+
+ if (!g.ok)
+ return DECLINED (cmd);
+
+ block_signals ();
+
+ /* This forces a quick ping of the remote server, so we know if its there. */
+ if (mysqldb)
+ mysql_select_db (mysqldb, g.sql_dbname);
+
+ if (!mysqldb
+ || ((error = mysql_query (mysqldb, query))
+ && !strcasecmp (mysql_error (mysqldb), "mysql server has gone")))
+ {
+ /* We need to restart the server link. */
+ if (mysqldb)
+ log_pri (LOG_ERR, "mysql: server has wandered off (%s/%s)",
+ g.sql_host, g.sql_dbname);
+ sql_cmd_open (cmd);
+ if (!mysqldb)
+ return DECLINED (cmd);
+ error = mysql_select_db (mysqldb, g.sql_dbname)
+ || mysql_query (mysqldb, query);
+ }
+
+ unblock_signals ();
+
+ if (error)
+ {
+ log_debug (DEBUG4, "mysql: %s failed: \"%s\": %s",
+ (update) ? "update" : "select",
+ query, mysql_error (mysqldb));
+ return DECLINED (cmd);
+ }
+
+ log_debug (DEBUG5, "mysql: %s OK: [%s] \"%s\"",
+ (update) ? "update" : "select", g.sql_dbname, query);
+ return HANDLED (cmd);
+}
+
+MODRET
+sql_cmd_update (cmd_rec * cmd)
+{
+ return _do_query (cmd, cmd->argv[1], TRUE);
+}
+
+MODRET
+sql_cmd_select (cmd_rec * cmd)
+{
+ MODRET mr;
+ MYSQL_RES *result;
+ MYSQL_ROW sql_row;
+ int i, j;
+
+ mr = _do_query (cmd, cmd->argv[1], FALSE);
+ if (!MODRET_ISHANDLED (mr))
+ return DECLINED (mr);
+
+ if ((result = mysql_store_result (mysqldb)))
+ {
+ int rcount = mysql_num_rows (result);
+ int fcount = mysql_num_fields (result);
+ int count = rcount * fcount;
+
+ char **data = pcalloc (cmd->tmp_pool, sizeof (char *) * (count + 1));
+ for (i = 0, count = 0; i < rcount; i++)
+ {
+ sql_row = mysql_fetch_row (result);
+ for (j = 0; j < fcount; j++)
+ data[count++] = pstrdup (cmd->tmp_pool, sql_row[j]);
+ }
+ mysql_free_result (result);
+ data[count] = NULL;
+ mr->data = data;
+ }
+ return mr;
+}
+
+static authtable mysql_authtab[] = {
+ {0, "dbd_open", sql_cmd_open},
+ {0, "dbd_close", sql_cmd_close},
+ {0, "dbd_update", sql_cmd_update},
+ {0, "dbd_select", sql_cmd_select},
+
+ {0, NULL, NULL}
+};
+
+/* **************************************************************** */
+
+MODRET set_sqlinfo (cmd_rec * cmd)
+{
+ CHECK_ARGS (cmd, 4);
+ CHECK_CONF (cmd, CONF_ROOT | CONF_GLOBAL | CONF_VIRTUAL);
+ add_config_param_str ("MySQLInfo", 4,
+ (void *) cmd->argv[1], (void *) cmd->argv[2],
+ (void *) cmd->argv[3], (void *) cmd->argv[4]);
+ return HANDLED (cmd);
+}
+
+static conftable mysql_conftab[] = {
+/* *INDENT-OFF* */
+
+ { "MySQLInfo", set_sqlinfo, NULL },
+
+ { 0, NULL }
+
+/* *INDENT-ON* */
+};
+
+/* **************************************************************** */
+
+static int
+mysql_modinit ()
+{
+ config_rec *c;
+
+ memset (&g, 0, sizeof (g));
+ if (!(c = find_config (CURRENT_CONF, CONF_PARAM, "MySQLInfo", FALSE)))
+ return 0;
+
+ g.sql_host = pstrdup (session.pool, c->argv[0]);
+ g.sql_user = pstrdup (session.pool, c->argv[1]);
+ g.sql_pass = pstrdup (session.pool, c->argv[2]);
+ g.sql_dbname = pstrdup (session.pool, c->argv[3]);
+ g.ok = TRUE;
+
+ log_debug (DEBUG5, "%s: configured: db %s at %s@%s",
+ MOD_MYSQL_VERSION, g.sql_dbname, g.sql_user, g.sql_host);
+ return 0;
+}
+
+module mysql_module = {
+ NULL, NULL, /* Always NULL */
+ 0x20, /* API Version 2.0 */
+ "mysql",
+ mysql_conftab, /* SQL configuration handler table */
+ NULL, /* SQL command handler table */
+ mysql_authtab, /* SQL authentication handler table */
+ mysql_modinit, /* Pre-fork "parent-mode" init */
+ mysql_modinit /* Post-fork "child mode" init */
+};

1023
ftp/proftpd/files/patch-bb Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
--- contrib/mod_sqlpw.c.old Sun Feb 11 19:52:06 2001
+++ contrib/mod_sqlpw.c Sun Feb 11 19:53:42 2001
@@ -302,8 +302,6 @@
if (!g.homedir)
return DECLINED (cmd);
- if (!g.pw.pw_name)
- {
g.pw.pw_name = pstrdup(session.pool, cmd->argv[0]);
if (g.sql_uid)
g.pw.pw_uid = atoi (_uservar (cmd, cmd->argv[0], g.sql_uid) ? : "0");
@@ -323,7 +321,6 @@
/* FIXME: unnecessary mysqlism */
mysql_escape_string (g.user, g.pw.pw_name, strlen (g.pw.pw_name));
g.user[ARBITRARY_MAX - 1] = 0;
- }
return mod_create_data (cmd, &g.pw);
}

View File

@ -0,0 +1,21 @@
--- contrib/mod_sqlpw.c.old Sun Feb 11 20:14:40 2001
+++ contrib/mod_sqlpw.c Sun Feb 11 20:16:00 2001
@@ -400,9 +400,6 @@
int return_type;
int retval = AUTH_NOPWD;
- if (!g.sql_passwd || !g.homedir)
- return DECLINED (cmd);
-
/* Figure out our default return style: Whether or not SQL should
* allow other auth modules a shot at this user or not is controlled
* by the parameter "SQLAuthoritative". Like mod_pam this
@@ -418,6 +415,8 @@
if ((user = cmd->argv[0]) == NULL)
return return_type ? ERROR (cmd) : DECLINED (cmd);
if ((pass = cmd->argv[1]) == NULL)
+ return return_type ? ERROR (cmd) : DECLINED (cmd);
+ if (!g.sql_passwd || !g.homedir)
return return_type ? ERROR (cmd) : DECLINED (cmd);
if (!g.pass

View File

@ -0,0 +1,21 @@
--- contrib/mod_mysql.c.old Sun Feb 11 20:19:00 2001
+++ contrib/mod_mysql.c Sun Feb 11 20:21:29 2001
@@ -100,6 +100,9 @@
mysql_get_client_info (), mysql_get_server_info (mysqldb),
g.sql_user, g.sql_host);
+ if (mysqldb)
+ mysql_select_db (mysqldb, g.sql_dbname);
+
return HANDLED (cmd);
}
@@ -115,7 +118,7 @@
/* This forces a quick ping of the remote server, so we know if its there. */
if (mysqldb)
- mysql_select_db (mysqldb, g.sql_dbname);
+ mysql_ping( mysqldb );
if (!mysqldb
|| ((error = mysql_query (mysqldb, query))