[SCM] proftpd-mod-geoip branch, upstream, updated. upstream/0.2-15-g4c13c8b

Fabrizio Regalli fabreg at fabreg.it
Wed Apr 13 15:04:08 UTC 2011


The following commit has been merged in the upstream branch:
commit 4c13c8be32d33259d446a1e7227139a039fa3602
Author: Fabrizio Regalli <fabreg at fabreg.it>
Date:   Wed Apr 13 17:05:24 2011 +0200

    Imported Upstream version 0.3

diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index 21428f3..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,5 +0,0 @@
-proftpd-mod-geoip (0.2) unstable; urgency=low
-
-  * Initial Release. (closes: #94162)
-
- -- Fabrizio Regalli <fabreg at fabreg.it>  Wed, 16 Feb 2011 11:14:35 +0100
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 7f8f011..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-7
diff --git a/debian/control b/debian/control
deleted file mode 100644
index a78a455..0000000
--- a/debian/control
+++ /dev/null
@@ -1,24 +0,0 @@
-Source: proftpd-mod-geoip
-Section: net
-Priority: optional
-Maintainer: ProFTPD Maintainance Team <pkg-proftpd-maintainers at lists.alioth.debian.org>
-Uploaders: Fabrizio Regalli <fabreg at fabreg.it>,
-	Francesco Paolo Lovergine <frankie at debian.org>
-DM-Upload-Allowed: yes
-Build-Depends: debhelper (>= 7.0.50~), proftpd-dev (>= 1.3.3d-5~), libgeoip-dev, libacl1-dev
-Standards-Version: 3.9.1
-Homepage: http://www.castaglia.org/proftpd/modules/mod_geoip.html
-Vcs-Git: git://git.debian.org/pkg-proftpd/proftpd-mod-geoip.git
-Vcs-Browser: http://git.debian.org/?p=pkg-proftpd/proftpd-mod-geoip.git;a=summary
-
-Package: proftpd-mod-geoip
-Architecture: any
-Depends: proftpd-basic (>= 1.3.3d-4~), geoip-database, ${misc:Depends}, ${shlibs:Depends}, ${proftpd:Depends}
-Description: ProFTPD mod_geoip
- This is mod_geoip module for ProFTPD.
- The mod_geoip module uses the GeoIP library from MaxMind
- to look up various geographic information for a connecting client:
- http://www.maxmind.com/app/c
- This information can be used to set access controls for the server
- 
-
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index a68fc2f..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,30 +0,0 @@
-Format: http://dep.debian.net/deps/dep5/
-Upstream-Name: mod_geoip
-Upstream-Contact: TJ Saunders
-Source: http://www.castaglia.org/proftpd/modules/mod_geoip.html
-
-Files: *
-Copyright: 	2007-2010, TJ Saunders
-License: GPL-2+
-
-License: GPL-2+
- This package 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 package 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, see <http://www.gnu.org/licenses/>
- .
- On Debian systems, the complete text of the GNU General
- Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
-
-Files: debian/*
-Copyright: 2011, Fabrizio Regalli <fabreg at fabreg.it>
-License: GPL-2+
-
diff --git a/debian/proftpd-mod-geoip.dirs b/debian/proftpd-mod-geoip.dirs
deleted file mode 100644
index f0e8d4e..0000000
--- a/debian/proftpd-mod-geoip.dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib/proftpd
-usr/share/proftpd/templates
diff --git a/debian/proftpd-mod-geoip.doc-base b/debian/proftpd-mod-geoip.doc-base
deleted file mode 100644
index 8be4356..0000000
--- a/debian/proftpd-mod-geoip.doc-base
+++ /dev/null
@@ -1,10 +0,0 @@
-Document: proftpd-mod-geoip
-Title: Documentation for the mod_geoip ProFTPD
-Author: 
-Abstract: Configuration reference, modules documentation, FAQs and HOWTOs
-Section: System/Administration
-
-Format: HTML
-Index: /usr/share/doc/proftpd-mod-geoip/mod_geoip.html
-Files: /usr/share/doc/proftpd-mod-geoip/*.html
-
diff --git a/debian/proftpd-mod-geoip.docs b/debian/proftpd-mod-geoip.docs
deleted file mode 100644
index 9e48e6d..0000000
--- a/debian/proftpd-mod-geoip.docs
+++ /dev/null
@@ -1 +0,0 @@
-mod_geoip.html
diff --git a/debian/proftpd-mod-geoip.install b/debian/proftpd-mod-geoip.install
deleted file mode 100644
index e4d2f95..0000000
--- a/debian/proftpd-mod-geoip.install
+++ /dev/null
@@ -1 +0,0 @@
-debian/templates/geoip.conf usr/share/doc/proftpd-mod-geoip/
diff --git a/debian/proftpd-mod-geoip.links b/debian/proftpd-mod-geoip.links
deleted file mode 100644
index 411f03d..0000000
--- a/debian/proftpd-mod-geoip.links
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/doc/proftpd-mod-geoip/geoip.conf usr/share/proftpd/templates/geoip.conf
diff --git a/debian/proftpd-mod-geoip.postrm b/debian/proftpd-mod-geoip.postrm
deleted file mode 100644
index c889943..0000000
--- a/debian/proftpd-mod-geoip.postrm
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ -d /usr/lib/proftpd ]; then
-	echo "Deleting mod_geoip.."
-	rm -f /usr/lib/proftpd/mod_geoip.so
-fi
-
-#DEBHELPER#
-
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 71ef045..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-
-export DH_VERBOSE=1
-VERSION=$(shell grep PROFTPD_VERSION_TEXT /usr/include/proftpd/version.h|cut -d\" -f2)
-MODULE_NAME=mod_geoip
-DEBNAME=proftpd-mod-geoip
-
-%:
-	dh $@
-
-override_dh_auto_build:
-	DESTDIR=$(CURDIR)/debian/$(DEBNAME) prxs -c $(MODULE_NAME).c
-	
-override_dh_auto_install:
-	DESTDIR=$(CURDIR)/debian/$(DEBNAME) prxs -i -c $(MODULE_NAME).c
-
-override_dh_gencontrol:
-	cat /usr/share/proftpd/proftpd-substvars >>$(CURDIR)/debian/substvars
-	dh_gencontrol
-
-clean:
-	$(RM) $(MODULE_NAME).a *.o *.la *.lo
-	$(LIBTOOL) --mode=clean $(RM) "$(MODULE_NAME).o"
-	$(LIBTOOL) --mode=clean $(RM) `echo "$(MODULE_NAME).la" | sed 's/\.la$\/.lo/g'`
-	$(RM) -rf $(CURDIR)/debian/proftpd-mod-geoip $(CURDIR)/debian/*.log $(CURDIR)/debian/files $(CURDIR)/debian/substvars
-
-distclean: clean
-	$(RM) -r .libs/ 
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/debian/templates/geoip.conf b/debian/templates/geoip.conf
deleted file mode 100644
index 4bb1d67..0000000
--- a/debian/templates/geoip.conf
+++ /dev/null
@@ -1,101 +0,0 @@
-#
-# Proftpd sample configuration for geoip.
-#
-<IfModule mod_geoip.c>
-
-# GeoIPEngine
-# Syntax: GeoIPEngine on|off
-# Default: off
-# The GeoIPEngine directive enables or disables the module's lookup of geographic information for a
-# connecting client, and subsequent enforcement of any configured ACLs.
-GeoIPEngine on
-
-
-# Syntax: GeoIPAllowFilter filter pattern
-# Default: none
-# The GeoIPAllowFilter directive is used to configure ACLs based on the 
-# geographic data provided by the GeoIP library.
-# Multiple GeoIPAllowFilter directives in the configuration are supported;
-# if any filter matches the connecting client, the connection will be allowed.
-# The filter parameter specifies the GeoIP value to which to apply the configured
-# pattern for matching. The possible filter values are:
-#  * AreaCode
-#  * ASN
-#  * City
-#  * Continent
-#  * CountryCode
-#  * CountryCode3
-#  * CountryName
-#  * ISP
-#  * Latitude
-#  * Longitude
-#  * NetworkSpeed
-#  * Organization
-#  * PostalCode
-#  * Proxy
-#  * RegionCode
-#  * RegionName
-#  * Timezone 
-# The pattern parameter is case-insensitive regular expression that will be applied to the 
-# specified filter value, if available.
-# Examples: 
-
-# Allow clients with high-speed connections
-# GeoIPAllowFilter NetworkSpeed corporate
-
-# Reject clients connecting from North America or South America
-# GeoIPDenyFilter Continent (NA|SA)
-
-# GeoIPDenyFilter
-# Syntax: GeoIPDenyFilter filter pattern
-# Default: none
-# The GeoIPDenyFilter directive is used to configure ACLs based on the geographic data provided by 
-# the GeoIP library.
-# Multiple GeoIPDenyFilter directives in the configuration are supported; if any filter matches the 
-# connecting client, the connection will be rejected. 
-# See GeoIPAllowFilter for a description of the directive syntax and parameters. 
-
-# GeoIPLog
-# Syntax: GeoIPLog file|"none"
-# Default: None
-# The GeoIPLog directive is used to specify a log file for mod_geoip's reporting on a per-server basis.
-# The file parameter given must be the full path to the file to use for logging.
-# Note that this path must not be to a world-writable directory and, unless AllowLogSymlinks is explicitly
-# set to on (generally a bad idea), the path must not be a symbolic link. 
-GeoIPLog /var/log/proftpd/geoip.log
-
-# GeoIPTable
-# Syntax: GeoIPTable path [flags]
-# Default: None
-# The GeoIPTable directive is used to a GeoIP database file for use by the GeoIP library. The path parameter given must be the full path to the database file.
-# If no GeoIPTable directive is configured, then the GeoIP library will use the default GeoIP Country database file installed with the library. 
-# Otherwise, only the database files configured via GeoIPTable directives will be used.
-# Multiple GeoIPTable directives can be used to configure multiple different GeoIP database files for use at the same time.
-# The possible flags values supported are:
-#   * Standard
-# Reads the database from the filesystem; uses the least memory but causes database to be read for each connection.
-#  * MemoryCache
-# Loads the database into memory; faster performance but uses the most memory. Tables configured with MemoryCache are loaded into the parent process memory, avoiding 
-# the need to read them for each connection.
-#  * CheckCache
-#      Causes the GeoIP library to check for database updates. If the database has been updated, the library will automatically reload the file and/or memory cache.
-#  * IndexCache
-# Loads just the most frequently accessed index portion of the database into memory, resulting in faster lookups than Standard but less memory usage than MemoryCache. 
-# This can be useful for larger databases such as GeoIP Organization and GeoIP City.
-#  * MMapCache
-#  Loads the database into mmap shared memory.
-#  * UTF8
-#   Tells the GeoIP library to return UTF8 strings for the data obtained from this database file. By default, the GeoIP library uses ISO-8859-1 encoded strings. 
-# Multiple different flags can be configured.
-# Examples:
-# GeoIPTable /path/to/GeoIP.dat MemoryCache CheckCache
-# GeoIPTable /path/to/GeoISP.dat Standard
-# GeoIPTable /path/to/GeoIPCity.dat IndexCache
-# Load GeoIP city database into memory on server startup, and use
-# UTF8-encoded city names
-GeoIPTable /usr/share/GeoIP/GeoIP.dat MemoryCache UTF8
-
-# Add your GeoIPAllowFilter/GeoIPDenyFilter rules here
-</IfModule>
-
-
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index ea1942d..0000000
--- a/debian/watch
+++ /dev/null
@@ -1,2 +0,0 @@
-version=3
-http://www.castaglia.org/proftpd/modules/proftpd-mod-geoip-([\d\.]+)\.tar\.gz
diff --git a/mod_geoip.c b/mod_geoip.c
index b68811c..401d309 100644
--- a/mod_geoip.c
+++ b/mod_geoip.c
@@ -1,7 +1,7 @@
 /*
  * ProFTPD: mod_geoip -- a module for looking up country/city/etc for clients
  *
- * Copyright (c) 2010 TJ Saunders
+ * Copyright (c) 2010-2011 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,7 @@
  * For more information contact TJ Saunders <tj at castaglia.org>.
  *
  * --- DO NOT DELETE BELOW THIS LINE ----
- * $Id: mod_geoip.c,v 1.4 2010/10/28 23:57:49 tj Exp tj $
+ * $Id: mod_geoip.c,v 1.5 2011/04/07 20:50:02 tj Exp tj $
  * $Libraries: -lGeoIP$
  */
 
@@ -37,11 +37,11 @@
  * module for Apache.
  */
 
-#define MOD_GEOIP_VERSION		"mod_geoip/0.2"
+#define MOD_GEOIP_VERSION		"mod_geoip/0.3"
 
 /* Make sure the version of proftpd is as necessary. */
-#if PROFTPD_VERSION_NUMBER < 0x0001030301
-# error "ProFTPD 1.3.3rc1 or later required"
+#if PROFTPD_VERSION_NUMBER < 0x0001030402
+# error "ProFTPD 1.3.4rc2 or later required"
 #endif
 
 #include <GeoIP.h>
@@ -125,13 +125,13 @@ static const char *get_geoip_filter_name(int);
 static const char *get_geoip_filter_value(int);
 
 static int check_geoip_filters(void) {
-#if defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
+#if PR_USE_REGEX
   config_rec *c;
 
   c = find_config(main_server->conf, CONF_PARAM, "GeoIPAllowFilter", FALSE);
   while (c) {
     int filter_id, res;
-    regex_t *filter_re;
+    pr_regex_t *filter_re;
     const char *filter_name, *filter_pattern, *filter_value;
 
     pr_signals_handle();
@@ -148,7 +148,7 @@ static int check_geoip_filters(void) {
 
     filter_name = get_geoip_filter_name(filter_id);
 
-    res = regexec(filter_re, filter_value, 0, NULL, 0);
+    res = pr_regexp_exec(filter_re, filter_value, 0, NULL, 0, 0, 0);
     pr_trace_msg(trace_channel, 12,
       "%s filter value %s %s GeoIPAllowFilter pattern '%s'",
       filter_name, filter_value, res == 0 ? "matched" : "did not match",
@@ -167,7 +167,7 @@ static int check_geoip_filters(void) {
   c = find_config(main_server->conf, CONF_PARAM, "GeoIPDenyFilter", FALSE);
   while (c) {
     int filter_id, res;
-    regex_t *filter_re;
+    pr_regex_t *filter_re;
     const char *filter_name, *filter_pattern, *filter_value;
 
     pr_signals_handle();
@@ -184,7 +184,7 @@ static int check_geoip_filters(void) {
 
     filter_name = get_geoip_filter_name(filter_id);
 
-    res = regexec(filter_re, filter_value, 0, NULL, 0);
+    res = pr_regexp_exec(filter_re, filter_value, 0, NULL, 0, 0, 0);
     pr_trace_msg(trace_channel, 12,
       "%s filter value %s %s GeoIPAllowFilter pattern '%s'",
       filter_name, filter_value, res == 0 ? "matched" : "did not match",
@@ -911,10 +911,10 @@ static void set_geoip_values(void) {
  *  GeoIPDenyFilter key regex
  */
 MODRET set_geoipfilter(cmd_rec *cmd) {
-#if defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
+#if PR_USE_REGEX
   register unsigned int i;
   config_rec *c;
-  regex_t *preg;
+  pr_regex_t *pre;
   int filter_id = -1, res;
 
   CHECK_ARGS(cmd, 2);
@@ -933,15 +933,15 @@ MODRET set_geoipfilter(cmd_rec *cmd) {
       cmd->argv[1], "'", NULL));
   }
 
-  preg = pr_regexp_alloc();
+  pre = pr_regexp_alloc(&geoip_module);
 
-  res = regcomp(preg, cmd->argv[2], REG_EXTENDED|REG_NOSUB|REG_ICASE);
+  res = pr_regexp_compile(pre, cmd->argv[2], REG_EXTENDED|REG_NOSUB|REG_ICASE);
   if (res != 0) {
     char errstr[256];
 
     memset(errstr, '\0', sizeof(errstr));
-    regerror(res, preg, errstr, sizeof(errstr)-1);
-    pr_regexp_free(preg);
+    pr_regexp_error(res, pre, errstr, sizeof(errstr)-1);
+    pr_regexp_free(&geoip_module, pre);
 
     CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "pattern '", cmd->argv[2],
       "' failed regex compilation: ", errstr, NULL));
@@ -951,7 +951,7 @@ MODRET set_geoipfilter(cmd_rec *cmd) {
   c->argv[0] = palloc(c->pool, sizeof(int));
   *((int *) c->argv[0]) = filter_id;
   c->argv[1] = pstrdup(c->pool, cmd->argv[2]);
-  c->argv[2] = preg;
+  c->argv[2] = pre;
 
   return PR_HANDLED(cmd);
 
diff --git a/mod_geoip.html b/mod_geoip.html
index 0fdf864..ce606b8 100644
--- a/mod_geoip.html
+++ b/mod_geoip.html
@@ -1,4 +1,4 @@
-<!-- $Id: mod_geoip.html,v 1.4 2010/10/29 00:01:09 tj Exp tj $ -->
+<!-- $Id: mod_geoip.html,v 1.7 2010/10/29 18:53:34 tj Exp tj $ -->
 <!-- $Source: /home/tj/proftpd/modules/doc/RCS/mod_geoip.html,v $ -->
 
 <html>
@@ -23,7 +23,7 @@ look up various geographic information for a connecting client:
 This information can be used to set access controls for the server.
 
 <p>
-This module is contained in the <code>mod_geoip</code> file for
+This module is contained in the <code>mod_geoip.c</code> file for
 ProFTPD 1.3.<i>x</i>, and is not compiled by default.  Installation
 instructions are discussed <a href="#Installation">here</a>.
 
@@ -317,7 +317,8 @@ for connections from California, you might use something like this:
 <b>Environment Variables</b><br>
 The <code>mod_geoip</code> module will set the following environment
 variables whenever a client connects, assuming that the appropriate
-GeoIP tables have been configured:
+GeoIP tables have been configured and the values are known for the connecting
+client:
 <ul>
   <li><code>GEOIP_AREA_CODE</code>
   <li><code>GEOIP_ASN</code>
@@ -388,7 +389,7 @@ according to need, demand, inclination, and time:
 <font color=red>Question</font>: How I can whitelist specific clients from
 <code>mod_geoip</code>'s checking?<br>
 <font color=blue>Answer</font>: You should be able to easily do this using
-<a href="http://www.proftpd.org/docs/howto/Classes.html">classes</a>and the
+<a href="http://www.proftpd.org/docs/howto/Classes.html">classes</a> and the
 <code>mod_ifsession</code> module.  For example:
 <pre>
   &lt;Class geop-whitelist&gt;
@@ -414,7 +415,7 @@ according to need, demand, inclination, and time:
 <hr><br>
 
 Author: <i>$Author: tj $</i><br>
-Last Updated: <i>$Date: 2010/10/29 00:01:09 $</i><br>
+Last Updated: <i>$Date: 2010/10/29 18:53:34 $</i><br>
 
 <br><hr>
 

-- 
mod_geoip for proftpd



More information about the Pkg-proftpd-maintainers mailing list