From 2e0d191f46199d8a53c6f6635bdbbc37e0f34e1d Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Mon, 29 May 2006 17:52:18 +0000 Subject: Fix problem with non-NULL values appearing as NULL properly. Submitted by: Alexandre Snarskii --- net/ser/files/patch-modules::auth_db::authorize.c | 44 ----------------------- net/ser/files/patch-modules::postgres::db_val.c | 13 +++++++ 2 files changed, 13 insertions(+), 44 deletions(-) delete mode 100644 net/ser/files/patch-modules::auth_db::authorize.c create mode 100644 net/ser/files/patch-modules::postgres::db_val.c (limited to 'net/ser/files') diff --git a/net/ser/files/patch-modules::auth_db::authorize.c b/net/ser/files/patch-modules::auth_db::authorize.c deleted file mode 100644 index 15fb53b5e220..000000000000 --- a/net/ser/files/patch-modules::auth_db::authorize.c +++ /dev/null @@ -1,44 +0,0 @@ - -$FreeBSD$ - ---- modules/auth_db/authorize.c -+++ modules/auth_db/authorize.c -@@ -101,7 +101,7 @@ - } - pkg_free(col); - -- if ((RES_ROW_N(*res) == 0) || VAL_NULL(ROW_VALUES(RES_ROWS(*res)))) { -+ if (RES_ROW_N(*res) == 0) { - DBG("get_ha1(): no result for user \'%.*s@%.*s\'\n", - _username->user.len, ZSW(_username->user.s), (use_domain ? (_domain->len) : 0), ZSW(_domain->s)); - return 1; -@@ -212,9 +212,7 @@ - rpid.s = NULL; - rpid.len = 0; - for (i = 0; i < avps_str_n; i++) { -- if (avps_str[i].len != 4 -- || VAL_NULL(&(result->rows[0].values[1 + avps_int_n + i])) -- || memcmp(avps_str[i].s, "rpid", 4) != 0) -+ if (avps_str[i].len != 4 || memcmp(avps_str[i].s, "rpid", 4) != 0) - continue; - rpid.s = (char*)VAL_STRING(&(result->rows[0].values[1 + avps_int_n + i])); - if(rpid.s!=NULL) -@@ -230,8 +228,6 @@ - return -1; - case AUTHORIZED: - for (i = 0; i < avps_int_n; i++) { -- if(VAL_NULL(&(result->rows[0].values[1 + i]))) -- continue; - iname.s = &(avps_int[i]); - ivalue.n = VAL_INT(&(result->rows[0].values[1 + i])); - add_avp(AVP_NAME_STR, iname, ivalue); -@@ -240,8 +236,7 @@ - } - for (i = 0; i < avps_str_n; i++) { - value.s = (char*)VAL_STRING(&(result->rows[0].values[1 + avps_int_n + i])); -- if(VAL_NULL(&(result->rows[0].values[1 + avps_int_n + i])) -- || value.s==NULL) -+ if(value.s==NULL) - continue; - iname.s = &(avps_str[i]); - value.len = strlen(value.s); diff --git a/net/ser/files/patch-modules::postgres::db_val.c b/net/ser/files/patch-modules::postgres::db_val.c new file mode 100644 index 000000000000..b2d168147f52 --- /dev/null +++ b/net/ser/files/patch-modules::postgres::db_val.c @@ -0,0 +1,13 @@ + +$FreeBSD$ + +--- modules/postgres/db_val.c ++++ modules/postgres/db_val.c +@@ -185,6 +185,7 @@ + VAL_NULL(_v) = 1; + return 0; + } ++ VAL_NULL(_v) = 0; + + switch(_t) { + case DB_INT: -- cgit v1.2.3