[sr-dev] git:sr_3.0: modules_k/permissions: group identifier must be positive integer

Juha Heinanen jh at tutpro.com
Wed Feb 10 06:43:57 CET 2010


Module: sip-router
Branch: sr_3.0
Commit: c67e72eb16f277eeae16182e15e0e8ebf319dce0
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c67e72eb16f277eeae16182e15e0e8ebf319dce0

Author: Juha Heinanen <jh at tutpro.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date:   Wed Feb 10 07:15:24 2010 +0200

modules_k/permissions: group identifier must be positive integer

- Group Identifier in address permissions must have a positive integer
  value.

---

 modules_k/permissions/README                    |    4 ++--
 modules_k/permissions/address.c                 |    1 +
 modules_k/permissions/doc/permissions_admin.xml |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules_k/permissions/README b/modules_k/permissions/README
index a3406f2..ff0959f 100644
--- a/modules_k/permissions/README
+++ b/modules_k/permissions/README
@@ -276,8 +276,8 @@ Chapter 1. Admin Guide
    (allow_source_address) or given as pvar arguments (allow_address).
 
    Addresses stored in cached database table can be grouped together into
-   one or more groups specified by a group identifier (unsigned integer).
-   Group identifier is given as argument to allow_address and
+   one or more groups specified by a group identifier (positive integer
+   value). Group identifier is given as argument to allow_address and
    allow_source_address functions.
 
 1.5. Trusted Requests
diff --git a/modules_k/permissions/address.c b/modules_k/permissions/address.c
index e40e510..126c8d8 100644
--- a/modules_k/permissions/address.c
+++ b/modules_k/permissions/address.c
@@ -114,6 +114,7 @@ int reload_address_table(void)
 	val = ROW_VALUES(row + i);
 	if ((ROW_N(row + i) == 4) &&
 	    (VAL_TYPE(val) == DB1_INT) && !VAL_NULL(val) &&
+	    (VAL_INT(val) > 0) && 
 	    (VAL_TYPE(val + 1) == DB1_STRING) && !VAL_NULL(val + 1) &&
 	    inet_aton((char *)VAL_STRING(val + 1), &ip_addr) != 0 &&
 	    (VAL_TYPE(val + 2) == DB1_INT) && !VAL_NULL(val + 2) && 
diff --git a/modules_k/permissions/doc/permissions_admin.xml b/modules_k/permissions/doc/permissions_admin.xml
index 4ad28b7..06512a9 100644
--- a/modules_k/permissions/doc/permissions_admin.xml
+++ b/modules_k/permissions/doc/permissions_admin.xml
@@ -179,7 +179,7 @@
 		<para>
 		Addresses stored in cached database table can be grouped
 		together into one or more groups specified by a group
-		identifier (unsigned integer).  Group
+		identifier (positive integer value).  Group
 		identifier is given as argument to allow_address and
 		allow_source_address functions.
 		</para>




More information about the sr-dev mailing list