]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
pgsql: only disable key if it starts with underscore
authorEric Leblond <eric@regit.org>
Wed, 1 Aug 2012 11:27:15 +0000 (11:27 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 3 Aug 2012 09:26:30 +0000 (11:26 +0200)
ulogd2 was magically making inactive the first key of description
table. This patch improves this system by only doing so when
the key start with an undescore. This way, system like nfacct which
do not have a primary key can be implemented easily.

Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
output/pgsql/ulogd_output_PGSQL.c

index 9529b1c0d469f56a55803c98c37721775fe1ce42..57206f4b781550e6bcea3a8d3314fce2571231a7 100644 (file)
@@ -195,8 +195,9 @@ static int get_columns_pgsql(struct ulogd_pluginstance *upi)
                strncpy(upi->input.keys[i].name, buf, ULOGD_MAX_KEYLEN);
        }
 
-       /* ID is a sequence */
-       upi->input.keys[0].flags |= ULOGD_KEYF_INACTIVE;
+       /* ID (starting by '.') is a sequence */
+       if (upi->input.keys[0].name[0] == '.')
+               upi->input.keys[0].flags |= ULOGD_KEYF_INACTIVE;
 
        PQclear(pi->pgres);
        return 0;