[ulogd2] Revert "ulogd: permit compilation of plugin outside of tree"

Eric Leblond netfilter-cvslog-bounces at lists.netfilter.org
Sat Apr 18 16:57:05 CEST 2009


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=ulogd2.git;a=commit;h=072959dbc1778a8f85aac9d6ef842ce9222d1fea
commit 072959dbc1778a8f85aac9d6ef842ce9222d1fea
Author:     Eric Leblond <eric at inl.fr>
AuthorDate: Sat Apr 18 13:58:26 2009 +0200
Commit:     Eric Leblond <eric at inl.fr>
CommitDate: Sat Apr 18 13:58:26 2009 +0200

    Revert "ulogd: permit compilation of plugin outside of tree"
    
    This reverts commit 0ff525cb0506b2c043bc9df6d7e7b486c865bc38. A stable
    and clean API should be provided if we choose to offer for external
    module capability.

commit bc2536b43495038dbaf6275e85288af22ee971e4
Author:     Eric Leblond <eric at inl.fr>
AuthorDate: Sat Apr 18 13:38:27 2009 +0200
Commit:     Eric Leblond <eric at inl.fr>
CommitDate: Sat Apr 18 13:38:27 2009 +0200

    Documentation: information about procedure variable.
    
    This patch documents the "procedure" option in the database
    plugin configurations.

commit c1c034c930beda542b201d01cf7b9d74baf8af1f
Author:     Romain Bignon <romain at inl.fr>
AuthorDate: Fri Apr 17 14:56:19 2009 +0200
Commit:     Eric Leblond <eric at inl.fr>
CommitDate: Sat Apr 18 13:25:51 2009 +0200

    DB plugins: fixed bug with INSERT* procedures
    
    When procedure begins with INSERT* (without space), it considers it as an
    INSERT statement.
    
    Signed-off-by: Romain Bignon <romain at inl.fr>
       via  072959dbc1778a8f85aac9d6ef842ce9222d1fea (commit)
       via  bc2536b43495038dbaf6275e85288af22ee971e4 (commit)
       via  c1c034c930beda542b201d01cf7b9d74baf8af1f (commit)
      from  49122eee73d381cb24539e0b81092bf8a4b1870d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 072959dbc1778a8f85aac9d6ef842ce9222d1fea
Author: Eric Leblond <eric at inl.fr>
Date:   Sat Apr 18 13:58:26 2009 +0200

    Revert "ulogd: permit compilation of plugin outside of tree"
    
    This reverts commit 0ff525cb0506b2c043bc9df6d7e7b486c865bc38. A stable
    and clean API should be provided if we choose to offer for external
    module capability.

commit bc2536b43495038dbaf6275e85288af22ee971e4
Author: Eric Leblond <eric at inl.fr>
Date:   Sat Apr 18 13:38:27 2009 +0200

    Documentation: information about procedure variable.
    
    This patch documents the "procedure" option in the database
    plugin configurations.

commit c1c034c930beda542b201d01cf7b9d74baf8af1f
Author: Romain Bignon <romain at inl.fr>
Date:   Fri Apr 17 14:56:19 2009 +0200

    DB plugins: fixed bug with INSERT* procedures
    
    When procedure begins with INSERT* (without space), it considers it as an
    INSERT statement.
    
    Signed-off-by: Romain Bignon <romain at inl.fr>

-----------------------------------------------------------------------

 doc/ulogd.sgml            |   10 +++++++++-
 include/Makefile.am       |    1 -
 include/ulogd/Makefile.am |    3 ++-
 include/ulogd/ulogd.h     |    2 --
 util/db.c                 |   23 +++++++++++++----------
 5 files changed, 24 insertions(+), 15 deletions(-)
When procedure begins with INSERT* (without space), it considers it as an
INSERT statement.

Signed-off-by: Romain Bignon <romain at inl.fr>

diff --git a/util/db.c b/util/db.c
index c2b674e..184ad86 100644
--- a/util/db.c
+++ b/util/db.c
@@ -91,19 +91,22 @@ static int sql_createstmt(struct ulogd_pluginstance *upi)
 		return -ENOMEM;
 	}
 
-	if (strncasecmp(procedure, "INSERT INTO", strlen("INSERT INTO")) == 0)
-		sprintf(mi->stmt, "%s (", procedure);
+	if (strncasecmp(procedure,"INSERT", strlen("INSERT")) == 0 &&
+	    (procedure[strlen("INSERT")] == '\0' ||
+			procedure[strlen("INSERT")] == ' ')) {
+		char buf[ULOGD_MAX_KEYLEN];
+		char *underscore;
 
-	if (strcasecmp(procedure,"INSERT") == 0) {
-		if (mi->schema)
-			sprintf(mi->stmt, "insert into %s.%s (", mi->schema, table);
+		if(procedure[6] == '\0') {
+			/* procedure == "INSERT" */
+			if (mi->schema)
+				sprintf(mi->stmt, "insert into %s.%s (", mi->schema, table);
+			else
+				sprintf(mi->stmt, "insert into %s (", table);
+		}
 		else
-			sprintf(mi->stmt, "insert into %s (", table);
-	}
+			sprintf(mi->stmt, "%s (", procedure);
 
-	if (strncasecmp(procedure,"INSERT", strlen("INSERT")) == 0) {
-		char buf[ULOGD_MAX_KEYLEN];
-		char *underscore;
 		mi->stmt_val = mi->stmt + strlen(mi->stmt);
 
 		for (i = 0; i < upi->input.num_keys; i++) {



More information about the netfilter-cvslog mailing list