All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Hockney <zeus@ix.netcom.com>
To: Eric Leblond <eric@regit.org>
Cc: The netfilter developer mailinglist <netfilter-devel@vger.kernel.org>
Subject: [ ulogd PATCH 2/2 ] fix to allow not using connstring parameter in pgsql plugin
Date: Mon, 21 Apr 2014 14:16:02 -0600	[thread overview]
Message-ID: <53557C82.5030100@ix.netcom.com> (raw)

commit a565216f3f772514356a067d68b775331b01832a
Author: Bob Hockney <zeus@ix.netcom.com>
Date:   Sat Apr 19 12:43:37 2014 -0600

     Connection parameters other than connstring are ignored, forcing its
     use.  u.string in config_keyset in conffile.h is a character array,
     not a pointer, and is initialized as a zero length string, not a null
     pointer, so the pointer assignment to connstr will always be a valid
     pointer, not NULL, so (! connstr) will always be false.

     Signed-off-by: Bob Hockney <zeus@ix.netcom.com>

diff --git a/output/pgsql/ulogd_output_PGSQL.c 
b/output/pgsql/ulogd_output_PGSQL.c
index fda289e..ac87a64 100644
--- a/output/pgsql/ulogd_output_PGSQL.c
+++ b/output/pgsql/ulogd_output_PGSQL.c
@@ -236,7 +236,7 @@ static int open_db_pgsql(struct ulogd_pluginstance *upi)
      char *schema = NULL;
      char pgbuf[128];

-    if (!connstr) {
+    if (! strlen(connstr)) {
          char *server = host_ce(upi->config_kset).u.string;
          unsigned int port = port_ce(upi->config_kset).u.value;
          char *user = user_ce(upi->config_kset).u.string;

                 reply	other threads:[~2014-04-21 20:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53557C82.5030100@ix.netcom.com \
    --to=zeus@ix.netcom.com \
    --cc=eric@regit.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.