summaryrefslogtreecommitdiffstats
path: root/output
diff options
context:
space:
mode:
authorEric Leblond <eric@regit.org>2012-08-01 11:27:15 +0000
committerPablo Neira Ayuso <pablo@netfilter.org>2012-08-03 11:26:30 +0200
commit72c935c08d4e414c892fdc3a8aa8163c1c07cebb (patch)
treece680172efe206a2e8988ada2e607abef87ee80d /output
parent008b9b5a2d1242df0d88e4ff2eed2e7918852767 (diff)
pgsql: only disable key if it starts with underscore
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>
Diffstat (limited to 'output')
-rw-r--r--output/pgsql/ulogd_output_PGSQL.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/output/pgsql/ulogd_output_PGSQL.c b/output/pgsql/ulogd_output_PGSQL.c
index 9529b1c..57206f4 100644
--- a/output/pgsql/ulogd_output_PGSQL.c
+++ b/output/pgsql/ulogd_output_PGSQL.c
@@ -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;