From 72c935c08d4e414c892fdc3a8aa8163c1c07cebb Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Wed, 1 Aug 2012 11:27:15 +0000 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- output/pgsql/ulogd_output_PGSQL.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'output') 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; -- cgit v1.2.3