#415 auth_db log problem

1.7.x
closed-fixed
modules (454)
5
2011-09-13
2011-09-10
Richard Revels
No

I'm getting a crash in auth_db when I have a int column being returned as one of the credentials columns and debug is turned up to debug level. Minor change to fix it. Here is a diff from svn

Index: modules/auth_db/authorize.c

--- modules/auth_db/authorize.c (revision 8366)
+++ modules/auth_db/authorize.c (working copy)
@@ -146,6 +146,7 @@
int i;

for (cred=credentials, i=1; cred; cred=cred->next, i++) {
+ LM_DBG("Going through auth avp loop with i = %d and type = %d \n", i, result->col.types[i]);
switch (result->col.types[i]) {
case DB_STR:
ivalue.s = VAL_STR(&(result->rows[0].values[i]));
@@ -163,6 +164,7 @@
cred->avp_name, ivalue.s.len, ZSW(ivalue.s.s));
break;
case DB_STRING:
+ LM_DBG("triggered db_string \n");
ivalue.s.s = (char*)VAL_STRING(&(result->rows[0].values[i]));

if (VAL_NULL(&(result->rows[0].values[i])) ||
@@ -178,6 +180,7 @@
cred->avp_name, ivalue.s.len, ZSW(ivalue.s.s));
break;
case DB_INT:
+ LM_DBG("triggered db_int \n");
if (VAL_NULL(&(result->rows[0].values[i])))
continue;

@@ -188,8 +191,8 @@
return -1;
}

- LM_DBG("set string AVP %d = \"%.*s\"\n",
- cred->avp_name, ivalue.s.len, ZSW(ivalue.s.s));
+ LM_DBG("set string AVP %d = \"%d\"\n",
+ cred->avp_name, ivalue.n);
break;
default:
LM_ERR("subscriber table column %d `%.*s' has unsuported type. "

Discussion

  • Hello,

    Thank you for reporting this. I have committed a fix for this issue both in trunk and in the 1.7 branch.

    Regards,
    Vlad

     
    • assigned_to: nobody --> vladut-paiu
    • status: open --> open-fixed
     
  • Please backport it to 1.6 also and close the report.

    Thanks,
    Bogdan

     
    • status: open-fixed --> closed-fixed
     
  • Hello,

    The issue is not present in 1.6, it appeared with the new 1.7 additions to the AVPs.

    Regards,
    Vlad