From 8e2a23b199ae1c410fd2df8270e654308d6f9221 Mon Sep 17 00:00:00 2001 From: Luca Longinotti Date: Sat, 23 Sep 2006 18:17:38 +0000 Subject: Cleanup proftpd. Package-Manager: portage-2.1.2_pre1 --- net-ftp/proftpd/files/proftpd-1.2.10-ftpshut.patch | 24 ++++ .../proftpd-1.2.10-gcc4_mod_quotatab_sql.patch | 12 ++ .../files/proftpd-1.2.10-openssl_0.9.8.patch | 21 ++++ .../proftpd/files/proftpd-1.2.10-sqlshowinfo.patch | 38 ++++++ .../files/proftpd-1.3.0-mod_sql_mysql.patch | 128 +++++++++++++++++++++ net-ftp/proftpd/files/proftpd.conf | 61 +++++----- net-ftp/proftpd/files/proftpd.rc6 | 8 +- 7 files changed, 257 insertions(+), 35 deletions(-) create mode 100644 net-ftp/proftpd/files/proftpd-1.2.10-ftpshut.patch create mode 100644 net-ftp/proftpd/files/proftpd-1.2.10-gcc4_mod_quotatab_sql.patch create mode 100644 net-ftp/proftpd/files/proftpd-1.2.10-openssl_0.9.8.patch create mode 100644 net-ftp/proftpd/files/proftpd-1.2.10-sqlshowinfo.patch create mode 100644 net-ftp/proftpd/files/proftpd-1.3.0-mod_sql_mysql.patch (limited to 'net-ftp/proftpd/files') diff --git a/net-ftp/proftpd/files/proftpd-1.2.10-ftpshut.patch b/net-ftp/proftpd/files/proftpd-1.2.10-ftpshut.patch new file mode 100644 index 000000000000..17a57f938eca --- /dev/null +++ b/net-ftp/proftpd/files/proftpd-1.2.10-ftpshut.patch @@ -0,0 +1,24 @@ +Index: src/response.c +=================================================================== +RCS file: /cvsroot/proftp/proftpd/src/response.c,v +retrieving revision 1.4 +diff -u -r1.4 response.c +--- src/response.c 3 Jun 2003 16:25:23 -0000 1.4 ++++ src/response.c 27 Jun 2005 23:03:35 -0000 +@@ -1,6 +1,6 @@ + /* + * ProFTPD - FTP server daemon +- * Copyright (c) 2001, 2002, 2003 The ProFTPD Project team ++ * Copyright (c) 2001-2005 The ProFTPD Project team + * + * 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 +@@ -169,7 +169,7 @@ + buf[sizeof(buf) - 1] = '\0'; + sstrcat(buf, "\r\n", sizeof(buf)); + +- RESPONSE_WRITE_STR_ASYNC(session.c->outstrm, buf, strlen(buf)) ++ RESPONSE_WRITE_STR_ASYNC(session.c->outstrm, "%s", buf) + } + + void pr_response_send(const char *resp_numeric, const char *fmt, ...) { diff --git a/net-ftp/proftpd/files/proftpd-1.2.10-gcc4_mod_quotatab_sql.patch b/net-ftp/proftpd/files/proftpd-1.2.10-gcc4_mod_quotatab_sql.patch new file mode 100644 index 000000000000..8cfdd22a04ad --- /dev/null +++ b/net-ftp/proftpd/files/proftpd-1.2.10-gcc4_mod_quotatab_sql.patch @@ -0,0 +1,12 @@ +--- proftpd-1.2.10/contrib/mod_quotatab_sql.c.orig 2006-09-04 11:21:09.000000000 +0000 ++++ proftpd-1.2.10/contrib/mod_quotatab_sql.c 2006-09-04 11:22:27.000000000 +0000 +@@ -684,8 +684,7 @@ + return NULL; + } + +- tab->tab_data = pcalloc(tab->tab_pool, sizeof(char)); +- ((char *) tab->tab_data) = pstrdup(tab->tab_pool, select_query); ++ tab->tab_data = (void *) pstrdup(tab->tab_pool, select_query); + } + + /* Set all the necessary function pointers. */ diff --git a/net-ftp/proftpd/files/proftpd-1.2.10-openssl_0.9.8.patch b/net-ftp/proftpd/files/proftpd-1.2.10-openssl_0.9.8.patch new file mode 100644 index 000000000000..7601d4b26a4d --- /dev/null +++ b/net-ftp/proftpd/files/proftpd-1.2.10-openssl_0.9.8.patch @@ -0,0 +1,21 @@ +Index: contrib/mod_tls.c +=================================================================== +RCS file: /cvsroot/proftp/proftpd/contrib/mod_tls.c,v +retrieving revision 1.77 +retrieving revision 1.78 +diff -u -r1.77 -r1.78 +--- contrib/mod_tls.c 14 Jun 2005 01:23:44 -0000 1.77 ++++ contrib/mod_tls.c 18 Jun 2005 21:05:34 -0000 1.78 +@@ -568,7 +568,12 @@ + } + } + ++#if OPENSSL_VERSION_NUMBER < 0x00908001 + PEMerr(PEM_F_DEF_CALLBACK, PEM_R_PROBLEMS_GETTING_PASSWORD); ++#else ++ PEMerr(PEM_F_PEM_DEF_CALLBACK, PEM_R_PROBLEMS_GETTING_PASSWORD); ++#endif ++ + pr_memscrub(buf, buflen); + return -1; + } diff --git a/net-ftp/proftpd/files/proftpd-1.2.10-sqlshowinfo.patch b/net-ftp/proftpd/files/proftpd-1.2.10-sqlshowinfo.patch new file mode 100644 index 000000000000..9bf501a3d2da --- /dev/null +++ b/net-ftp/proftpd/files/proftpd-1.2.10-sqlshowinfo.patch @@ -0,0 +1,38 @@ +--- /var/tmp/portage/proftpd-1.2.10-r7/work/proftpd-1.2.10/contrib/mod_sql.c 2004-08-03 01:44:31.000000000 +0100 ++++ contrib/mod_sql.c 2005-07-29 16:36:08.251407235 +0100 +@@ -2036,7 +2036,7 @@ + *outsp++ = 0; + + /* add the response */ +- pr_response_add( c->argv[0], outs); ++ pr_response_add(c->argv[0], "%s", outs); + + } while((c = find_config_next(c, c->next, CONF_PARAM, name, FALSE)) != NULL); + +@@ -2110,7 +2110,7 @@ + *outsp++ = 0; + + /* add the response */ +- pr_response_add( c->argv[0], outs); ++ pr_response_add(c->argv[0], "%s", outs); + + } while((c = find_config_next(c, c->next, CONF_PARAM, name, FALSE)) != NULL); + +@@ -2201,7 +2201,7 @@ + *outsp++ = 0; + + /* add the response */ +- pr_response_add_err( c->argv[0], outs); ++ pr_response_add_err(c->argv[0], "%s", outs); + + } while((c = find_config_next(c, c->next, CONF_PARAM, name, FALSE)) != NULL); + +@@ -2275,7 +2275,7 @@ + *outsp++ = 0; + + /* add the response */ +- pr_response_add( c->argv[0], outs); ++ pr_response_add(c->argv[0], "%s", outs); + + } while((c = find_config_next(c, c->next, CONF_PARAM, name, FALSE)) != NULL); + diff --git a/net-ftp/proftpd/files/proftpd-1.3.0-mod_sql_mysql.patch b/net-ftp/proftpd/files/proftpd-1.3.0-mod_sql_mysql.patch new file mode 100644 index 000000000000..be382c6835d2 --- /dev/null +++ b/net-ftp/proftpd/files/proftpd-1.3.0-mod_sql_mysql.patch @@ -0,0 +1,128 @@ +Index: contrib/mod_sql_mysql.c +=================================================================== +RCS file: /cvsroot/proftp/proftpd/contrib/mod_sql_mysql.c,v +retrieving revision 1.40 +diff -u -r1.40 mod_sql_mysql.c +--- contrib/mod_sql_mysql.c 21 Apr 2006 01:59:45 -0000 1.40 ++++ contrib/mod_sql_mysql.c 26 May 2006 18:37:14 -0000 +@@ -128,7 +128,7 @@ + * Internal define used for debug and logging. All backends are encouraged + * to use the same format. + */ +-#define MOD_SQL_MYSQL_VERSION "mod_sql_mysql/4.05" ++#define MOD_SQL_MYSQL_VERSION "mod_sql_mysql/4.0.7" + + #define _MYSQL_PORT "3306" + +@@ -158,6 +158,7 @@ + char *pass; + char *db; + char *port; ++ char *unix_sock; + + MYSQL *mysql; + +@@ -431,8 +432,8 @@ + mysql_options(conn->mysql, MYSQL_READ_DEFAULT_GROUP, "client"); + + if (!mysql_real_connect(conn->mysql, conn->host, conn->user, conn->pass, +- conn->db, (int) strtol(conn->port, (char **) NULL, 10), NULL, +- CLIENT_INTERACTIVE)) { ++ conn->db, (int) strtol(conn->port, (char **) NULL, 10), ++ conn->unix_sock, CLIENT_INTERACTIVE)) { + + /* If it didn't work, return an error. */ + sql_log(DEBUG_FUNC, "%s", "exiting \tmysql cmd_open"); +@@ -567,8 +568,7 @@ + * a number or ttl is negative, the connection will be assumed to have no + * associated timer. + */ +-MODRET cmd_defineconnection(cmd_rec *cmd) +-{ ++MODRET cmd_defineconnection(cmd_rec *cmd) { + char *info = NULL; + char *name = NULL; + +@@ -586,12 +586,14 @@ + + _sql_check_cmd(cmd, "cmd_defineconnection"); + +- if ((cmd->argc < 4) || (cmd->argc > 5) || (!cmd->argv[0])) { ++ if (cmd->argc < 4 || ++ cmd->argc > 5 || ++ !cmd->argv[0]) { + sql_log(DEBUG_FUNC, "%s", "exiting \tmysql cmd_defineconnection"); + return ERROR_MSG(cmd, MOD_SQL_MYSQL_VERSION, "badly formed request"); + } + +- conn = (db_conn_t *) palloc(conn_pool, sizeof(db_conn_t)); ++ conn = (db_conn_t *) pcalloc(conn_pool, sizeof(db_conn_t)); + + name = pstrdup(conn_pool, cmd->argv[0]); + conn->user = pstrdup(conn_pool, cmd->argv[1]); +@@ -615,6 +617,7 @@ + if (haveport) { + port = haveport + 1; + *haveport = '\0'; ++ + } else { + port = _MYSQL_PORT; + } +@@ -622,16 +625,28 @@ + if (havehost) { + host = havehost + 1; + *havehost = '\0'; ++ + } else { + host = "localhost"; + } + +- conn->host = pstrdup(conn_pool, host); ++ /* Hack to support ability to configure path to Unix domain socket ++ * for MySQL: if the host string starts with a '/', assume it's ++ * a path to the Unix domain socket to use. ++ */ ++ if (*host == '/') { ++ conn->unix_sock = pstrdup(conn_pool, host); ++ ++ } else { ++ conn->host = pstrdup(conn_pool, host); ++ } ++ + conn->db = pstrdup(conn_pool, db); + conn->port = pstrdup(conn_pool, port); + +- /* insert the new conn_info into the connection hash */ +- if (!(entry = _sql_add_connection(conn_pool, name, (void *) conn))) { ++ /* Insert the new conn_info into the connection hash */ ++ entry = _sql_add_connection(conn_pool, name, (void *) conn); ++ if (!entry) { + sql_log(DEBUG_FUNC, "%s", "exiting \tmysql cmd_defineconnection"); + return ERROR_MSG(cmd, MOD_SQL_MYSQL_VERSION, + "named connection already exists"); +@@ -645,12 +660,19 @@ + entry->timer = 0; + entry->connections = 0; + +- sql_log(DEBUG_INFO, " name: '%s'", entry->name); +- sql_log(DEBUG_INFO, " user: '%s'", conn->user); +- sql_log(DEBUG_INFO, " host: '%s'", conn->host); +- sql_log(DEBUG_INFO, " db: '%s'", conn->db); +- sql_log(DEBUG_INFO, " port: '%s'", conn->port); +- sql_log(DEBUG_INFO, " ttl: '%d'", entry->ttl); ++ sql_log(DEBUG_INFO, " name: '%s'", entry->name); ++ sql_log(DEBUG_INFO, " user: '%s'", conn->user); ++ ++ if (conn->host) { ++ sql_log(DEBUG_INFO, " host: '%s'", conn->host); ++ ++ } else if (conn->unix_sock) { ++ sql_log(DEBUG_INFO, "socket: '%s'", conn->unix_sock); ++ } ++ ++ sql_log(DEBUG_INFO, " db: '%s'", conn->db); ++ sql_log(DEBUG_INFO, " port: '%s'", conn->port); ++ sql_log(DEBUG_INFO, " ttl: '%d'", entry->ttl); + + sql_log(DEBUG_FUNC, "%s", "exiting \tmysql cmd_defineconnection"); + return HANDLED(cmd); diff --git a/net-ftp/proftpd/files/proftpd.conf b/net-ftp/proftpd/files/proftpd.conf index 44f78406e225..0d4eb3e6466b 100644 --- a/net-ftp/proftpd/files/proftpd.conf +++ b/net-ftp/proftpd/files/proftpd.conf @@ -1,14 +1,14 @@ # This is a basic ProFTPD configuration file (rename it to -# 'proftpd.conf' for actual use. It establishes a single server -# and a single anonymous login. It assumes that you have a user/group -# "nobody" and "ftp" for normal operation and anon. - -ServerName "ProFTPD Default Installation" -ServerType standalone -DefaultServer on -RequireValidShell off -AuthPAM off -AuthPAMConfig ftp +# 'proftpd.conf' for actual use. It establishes a single server +# and a single anonymous login. It assumes that you have a user/group +# "nobody" and "ftp" for normal operation and anonymous access. + +ServerName "ProFTPD Default Installation" +ServerType standalone +DefaultServer on +RequireValidShell off +AuthPAM off +AuthPAMConfig ftp # Port 21 is the standard FTP port. Port 21 @@ -17,12 +17,12 @@ Port 21 Umask 022 # To prevent DoS attacks, set the maximum number of child processes -# to 30. If you need to allow more than 30 concurrent connections -# at once, simply increase this value. Note that this ONLY works +# to 30. If you need to allow more than 30 concurrent connections +# at once, simply increase this value. Note that this ONLY works # in standalone mode, in inetd mode you should use an inetd server -# that allows you to limit maximum number of processes per service +# that allows you to limit the maximum number of processes per service # (such as xinetd). -MaxInstances 30 +MaxInstances 30 # Set the user and group under which the server will run. User proftpd @@ -30,28 +30,27 @@ Group proftpd # Normally, we want files to be overwriteable. - AllowOverwrite on + AllowOverwrite on -# A basic anonymous configuration, no upload directories. +# A basic anonymous configuration, with no upload directories. - User ftp - Group ftp + User ftp + Group ftp - # We want clients to be able to login with "anonymous" as well as "ftp" - UserAlias anonymous ftp + # We want clients to be able to login with "anonymous" as well as "ftp". + UserAlias anonymous ftp - # Limit the maximum number of anonymous logins - MaxClients 10 + # Limit the maximum number of anonymous logins. + MaxClients 10 - # We want 'welcome.msg' displayed at login, and '.message' displayed - # in each newly chdired directory. - DisplayLogin welcome.msg - DisplayFirstChdir .message - - # Limit WRITE everywhere in the anonymous chroot - - DenyAll - + # We want 'welcome.msg' displayed at login, and '.message' displayed + # in each newly chdired directory. + DisplayLogin welcome.msg + DisplayFirstChdir .message + # Limit WRITE everywhere in the anonymous chroot. + + DenyAll + diff --git a/net-ftp/proftpd/files/proftpd.rc6 b/net-ftp/proftpd/files/proftpd.rc6 index a86b2fdefad2..d543ded32bba 100644 --- a/net-ftp/proftpd/files/proftpd.rc6 +++ b/net-ftp/proftpd/files/proftpd.rc6 @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-ftp/proftpd/files/proftpd.rc6,v 1.9 2004/07/14 23:42:49 agriffis Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-ftp/proftpd/files/proftpd.rc6,v 1.10 2006/09/23 18:17:38 chtekk Exp $ depend() { need net @@ -9,8 +9,8 @@ depend() { checkconfig() { if [ ! -e /etc/proftpd/proftpd.conf ] ; then - eerror "You need an /etc/proftpd/proftpd.conf file first" - eerror "There is a sample file in /etc/proftpd" + eerror "You need an /etc/proftpd/proftpd.conf file first!" + eerror "There is a sample file in /etc/proftpd." return 1 fi } @@ -18,7 +18,7 @@ checkconfig() { start() { checkconfig || return 1 ebegin "Starting proftpd" - start-stop-daemon --start --quiet --exec /usr/sbin/proftpd -- /var/run/proftpd.pid + start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/proftpd.pid --exec /usr/sbin/proftpd eend $? } -- cgit v1.2.3-65-gdbad