You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2009/05/31 06:56:40 UTC
svn commit: r780366 - in /httpd/mod_ftp/trunk/modules/ftp: config.m4
ftp_commands.c ftp_internal.h ftp_lowportd.c mod_ftp.c
Author: wrowe
Date: Sun May 31 04:56:39 2009
New Revision: 780366
URL: http://svn.apache.org/viewvc?rev=780366&view=rev
Log:
Add autoconf logic for both fdpass mechanisms (apxs flavor to follow)
Modified:
httpd/mod_ftp/trunk/modules/ftp/config.m4
httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
httpd/mod_ftp/trunk/modules/ftp/ftp_internal.h
httpd/mod_ftp/trunk/modules/ftp/ftp_lowportd.c
httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c
Modified: httpd/mod_ftp/trunk/modules/ftp/config.m4
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/config.m4?rev=780366&r1=780365&r2=780366&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/config.m4 (original)
+++ httpd/mod_ftp/trunk/modules/ftp/config.m4 Sun May 31 04:56:39 2009
@@ -39,6 +39,11 @@
AC_CHECK_FUNCS(fchmod)
AC_CHECK_HEADERS(arpa/ftp.h)
AC_CHECK_HEADERS(netinet/ip.h)
+ AC_CHECK_MEMBERS([struct msghdr.msg_control, struct msghdr.msg_accrights],
+ [], [], [
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ])
])
APACHE_MODULE(ftp_cmd_pwd, [Example FTP cmd extension (mod_ftp_cmd_pwd)], mod_ftp_cmd_pwd.lo, , no)
Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c?rev=780366&r1=780365&r2=780366&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c Sun May 31 04:56:39 2009
@@ -1777,7 +1777,7 @@
}
}
-#if APR_HAVE_SYS_UN_H
+#ifdef HAVE_FTP_LOWPORTD
if ((local_port > 0) && (local_port < 1024)) {
/*
* Here's the case of low numbered port creation; we have spun off
Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_internal.h
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_internal.h?rev=780366&r1=780365&r2=780366&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_internal.h (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_internal.h Sun May 31 04:56:39 2009
@@ -351,14 +351,21 @@
*
* ftp_lowportd.c
*/
-/* Lone onfiguration option */
+/* Lone configuration option */
const char *lowportd_set_socket(cmd_parms *cmd, void *dummy, const char *arg);
-#if APR_HAVE_SYS_UN_H
+/* The module is enabled by the presence of unix domain sockets */
+#if APR_HAVE_SYS_UN_H && (defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS) \
+ || (defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL))
+
+#define HAVE_FTP_LOWPORTD
+
/* Initialization */
int lowportd_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp);
int lowportd_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp,
server_rec *main_server);
+
+/* Query */
apr_status_t ftp_request_lowport(apr_socket_t **sock, request_rec *r,
apr_sockaddr_t *sa, apr_pool_t *p);
#endif
Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_lowportd.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_lowportd.c?rev=780366&r1=780365&r2=780366&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_lowportd.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_lowportd.c Sun May 31 04:56:39 2009
@@ -23,9 +23,7 @@
#include "unixd.h"
#include "mpm.h"
-/* The module is enabled by the presence of unix domain sockets */
-#if APR_HAVE_SYS_UN_H
-#include <sys/un.h> /* for sockaddr_un */
+#ifdef HAVE_FTP_LOWPORTD
#if APR_HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -39,6 +37,7 @@
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#include <sys/un.h> /* for sockaddr_un */
typedef struct lowportd_req_t {
pid_t ppid;
Modified: httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c?rev=780366&r1=780365&r2=780366&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c Sun May 31 04:56:39 2009
@@ -69,7 +69,7 @@
log_pfn_register(p, "Y", ftp_log_auth_user_id, 0);
}
-#if APR_HAVE_SYS_UN_H
+#ifdef HAVE_FTP_LOWPORTD
return lowportd_pre_config(p, plog, ptemp);
#else
return OK;
@@ -137,7 +137,7 @@
apr_pool_cleanup_register(p, base, ftp_mutexdb_cleanup,
apr_pool_cleanup_null);
-#if APR_HAVE_SYS_UN_H
+#ifdef HAVE_FTP_LOWPORTD
if (lowportd)
/* Initialized only if a server has at least one active_min < 1024 */
return lowportd_post_config(p, plog, ptemp, base);