[ ulogd PATCH 2/2 ] fix to allow not using connstring parameter in pgsql plugin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit a565216f3f772514356a067d68b775331b01832a
Author: Bob Hockney <zeus@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx>

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;
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux