summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Fetka <[email protected]>2020-03-11 10:39:28 (GMT)
committer Mario Fetka <[email protected]>2020-03-11 10:39:28 (GMT)
commit5708e35ee04796d06ccf9eae606f82fb041a9cc9 (patch)
tree3ec657c149e5483defdbdc14ac253f530c71f236
parent2b457cf5f6f31d0b8db7e79ea0da7c467b154823 (diff)
Imported Upstream version 0.2upstream/0.2upstream
-rw-r--r--.travis.yml8
-rw-r--r--mod_proxy_protocol.c8
-rw-r--r--mod_proxy_protocol.html24
3 files changed, 33 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml
index 4ae464c..8023d57 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,8 +7,10 @@ compiler:
install:
# for unit tests
- sudo apt-get install -y check
+ - sudo apt-get install -y libsubunit-dev
# for static code analysis
- - sudo apt-get install -y cppcheck rats
+ # - sudo apt-get install -y cppcheck
+ # - sudo apt-get install -y rats
# for test code coverage
- sudo apt-get install -y lcov
- gem install coveralls-lcov
@@ -23,8 +25,8 @@ script:
- git clone --depth 10 https://github.com/proftpd/proftpd.git
- cp mod_proxy_protocol.c proftpd/contrib/
- cd proftpd
- - ./configure LIBS="-lm -lrt -pthread" --enable-devel=coverage --enable-tests --with-module=mod_proxy_protocol
+ - ./configure LIBS="-lm -lsubunit -lrt -pthread" --enable-devel=coverage --enable-tests --with-module=mod_proxy_protocol
- make
- make clean
- - ./configure LIBS="-lm -lrt -pthread" --enable-devel=coverage --enable-dso --enable-tests --with-shared=mod_proxy_protocol
+ - ./configure LIBS="-lm -lsubunit -lrt -pthread" --enable-devel=coverage --enable-dso --enable-tests --with-shared=mod_proxy_protocol
- make
diff --git a/mod_proxy_protocol.c b/mod_proxy_protocol.c
index 28bd7fe..36e9d7f 100644
--- a/mod_proxy_protocol.c
+++ b/mod_proxy_protocol.c
@@ -1,6 +1,6 @@
/*
* ProFTPD - mod_proxy_protocol
- * Copyright (c) 2013-2017 TJ Saunders
+ * Copyright (c) 2013-2020 TJ Saunders
*
* 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
@@ -26,7 +26,11 @@
#include "conf.h"
#include "privs.h"
-#define MOD_PROXY_PROTOCOL_VERSION "mod_proxy_protocol/0.1"
+#ifdef HAVE_SYS_UIO_H
+# include <sys/uio.h>
+#endif /* HAVE_SYS_UIO_H */
+
+#define MOD_PROXY_PROTOCOL_VERSION "mod_proxy_protocol/0.2"
/* Make sure the version of proftpd is as necessary. */
#if PROFTPD_VERSION_NUMBER < 0x0001030504
diff --git a/mod_proxy_protocol.html b/mod_proxy_protocol.html
index ddd2d00..10fa510 100644
--- a/mod_proxy_protocol.html
+++ b/mod_proxy_protocol.html
@@ -140,6 +140,27 @@ of <code>LoadModule</code> directives; the last of which would be:
LoadModule mod_proxy_protocol.c
</pre>
+<b>Note</b> that using <code>mod_proxy_protocol</code> as a shared module
+is <i>required</i> in cases where you want to use both
+<code>mod_proxy_protocol</code> <i>and</i> <code>mod_ifsession</code>. For
+example, perhaps you want to use <code>mod_ifsession</code> to change the
+behavior of some module, <i>e.g.</i> <code>mod_ban</code>, based on the IP
+address of the original client. This means that <code>mod_proxy_protocol</code>
+would need to hande the connection <i>first</i>, so that it can decode the
+<code>PROXY</code> protocol and set the correct client IP address.
+<i>However</i>, the ProFTPD build system is hardcoded to ensure that the
+<code>mod_ifsession</code> will always be first -- <i>if</i> using static
+modules. By using <i>shared</i> modules, you can enforce the proper ordering
+using the <code>LoadModule</code> directive, like so:
+<pre>
+ &lt;IfModule mod_dso.c&gt;
+ ...
+ LoadModule mod_ifsession.c
+ LoadModule mod_proxy_protocol.c
+ &lt;/IfModule&gt;
+</pre>
+The <i>last</i> module loaded will be the <i>first</i> module called.
+
<p>
<b>Trusting Senders of Proxy Data</b><br>
Use of these proxy protocols means changes in audit trails and/or client
@@ -227,11 +248,10 @@ to your existing server:
<p>
<hr>
<font size=2><b><i>
-&copy; Copyright 2013-2017 TJ Saunders<br>
+&copy; Copyright 2013-2019 TJ Saunders<br>
All Rights Reserved<br>
</i></b></font>
<hr>
</body>
</html>
-

Powered by Domaintechnik.at | Hosting - Domain - Webspace