diff options
author | Maxim Sobolev <sobomax@FreeBSD.org> | 2006-04-21 06:30:43 +0000 |
---|---|---|
committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2006-04-21 06:30:43 +0000 |
commit | dfa121d9d966b38ff43f26fb1ce7a474f2e26cb5 (patch) | |
tree | 33a992c0c31ed5427e8c08d35b0c007099d52957 /net/ser/files/patch-modules::auth_db::authorize.c | |
parent | 08d7206941aea6211579aad60e40d3cf98b63ac5 (diff) | |
download | ports-dfa121d9d966b38ff43f26fb1ce7a474f2e26cb5.tar.gz ports-dfa121d9d966b38ff43f26fb1ce7a474f2e26cb5.zip |
Merge in latest local changes and improvements:
o Allow radius and presence modules to be turned off;
o don't override CFLAGS;
o don't duplicate error messages to the console;
o postgresql backend doesn't set NULL flag on results properly, so that
don't use VAL_NULL() macros on them;
o reconnect to MySQL db when necessary;
o relax transaction matching rules, so that it works with wider range of
phones;
o add some missed sanity checks in usrloc;
o ignore incoming UDP messages that are shorter than certain limin (128
bytes). They cannot be SIP messages anyway.
Notes
Notes:
svn path=/head/; revision=160058
Diffstat (limited to 'net/ser/files/patch-modules::auth_db::authorize.c')
-rw-r--r-- | net/ser/files/patch-modules::auth_db::authorize.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/net/ser/files/patch-modules::auth_db::authorize.c b/net/ser/files/patch-modules::auth_db::authorize.c new file mode 100644 index 000000000000..15fb53b5e220 --- /dev/null +++ b/net/ser/files/patch-modules::auth_db::authorize.c @@ -0,0 +1,44 @@ + +$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); |