[Serusers] Error loading "trusted" table (permissions.so)

Miklos Tirpak miklos at iptel.org
Mon Jan 19 11:51:08 CET 2009


On 01/16/2009 06:05 PM, caio wrote:
> 
> Miklos Tirpak escribió:
>> On 01/16/2009 04:25 PM, caio wrote:
>>> ser version 0.9.7
>>> but it does work on Gentoo linux.
>>> when implemented on Solaris it fails.
>>
>> Do the two machines query the same database server?
> 
> No, they don't. They are stand-alone with its respective (local) mysql db.

Could you give a try to another DB server? For example query the linux 
mysql server from the Solaris machine, if it is accessible.

> 
>>
>> There might be a problem with the field types, please check that they 
>> are strings, and not blobs. Please send me a "describe trusted" mysql 
>> output.
> 
> mysql> desc trusted;
> +--------------+-------------+------+-----+---------+-------+
> | Field        | Type        | Null | Key | Default | Extra |
> +--------------+-------------+------+-----+---------+-------+
> | src_ip       | varchar(39) | NO   | PRI | NULL    |       |
> | proto        | varchar(4)  | NO   | PRI | NULL    |       |
> | from_pattern | varchar(64) | NO   | PRI | NULL    |       |
> +--------------+-------------+------+-----+---------+-------+
> 3 rows in set (0.00 sec)
> 
> Casually, i add a few DBG() calls on 'trusted.c' and now at log see 
> these messages:
> 
>  0(0) DEBUG: register_fifo_cmd: new command (trusted_reload) registered
>  0(0) DEBUG: register_fifo_cmd: new command (trusted_dump) registered
>  0(0) unixsock_register_cmd: New command (trusted_reload) registered
>  0(0) unixsock_register_cmd: New command (trusted_dump) registered
>  0(0) RES_ROWS (row): 135511480
>  0(0) Number of rows in trusted table: 1
>  0(0) row: 135511480
>  0(0) val: 135511648
>  0(0) val + 1: 135511664
>  0(0) val + 2: 135511680
>  0(0) ROW_VALUES (val): 135511648SQL
>  0(0) ROW_N(row + i): 3
>  0(0) VAL_TYPE(val), is DB_STRING?: 2
>  0(0) VAL_TYPE(val + 1), is DB_STRING?: 2
>  0(0) VAL_TYPE(val + 2), is DB_STRING?: 1
>  0(0) DB_INT: 0
>  0(0) DB_DOUBLE: 1
>  0(0) DB_STRING: 2
>  0(0) DB_STR: 3
>  0(0) VAL_NULL(val): 0
>  0(0) VAL_NULL(val + 1): 0
>  0(0) VAL_NULL(val + 2): 0
>  0(0) VAL_STRING(val): 200.2.127.153
>  0(0) VAL_STRING(val + 1): any
>  0(0) VAL_DOUBLE(val + 2): 0
>  0(0) ERROR: permissions: trusted_reload(): Database problem
>  0(0) release_connection(): Removing connection from the pool
>  0(0) init_trusted(): Reload of trusted table failed
>  0(0) Error while initializing allow_trusted function
>  0(0) init_mod(): Error while initializing module permissions
> 
> Seem that VAL_TYPE of "val + 2" isn't STRING, read it as DOUBLE 
> (DB_DOUBLE = 1).
> Do not know why.
> And because of this the 'if' conditions never are satisfy on trusted.c 
> (line #396):
> 
>                 if ((ROW_N(row + i) == 3) &&
>                     (VAL_TYPE(val) == DB_STRING) && !VAL_NULL(val) &&
>                     (VAL_TYPE(val + 1) == DB_STRING) && !VAL_NULL(val + 
> 1) &&
>                     (VAL_TYPE(val + 2) == DB_STRING) && !VAL_NULL(val + 
> 2)) {


Thank you very much for the debug lines! I think SER simply uses the 
field types returned by the mysql server, so there might be a problem 
with the server or library. You can check what the field types are along 
with their names returned by the server in modules/mysql/res.c, search 
for the mysql_fetch_fields function.

Miklos

> 
> Caio
> 
>>
>> Regards,
>> Miklos
>>
>>>
>>> regards,
>>> caio
>>>
>>> Miklos Tirpak escribió:
>>>> Hello,
>>>>
>>>> what is your SER version?
>>>> I works for me with 2.0, compiled from CVS.
>>>>
>>>> Miklos
>>>>
>>>> On 01/16/2009 01:00 PM, caio wrote:
>>>>> Hello all,
>>>>>
>>>>> Does anyone knows about this "permission.so" module error when try 
>>>>> to load "trusted" table (mysql)?
>>>>>
>>>>> If "trusted" table is empty, there is no error, but whan at least 
>>>>> there is 1 record, the error appears.
>>>>>
>>>>> for example:
>>>>>
>>>>> mysql> select * from trusted;
>>>>> +---------------+-------+--------------+
>>>>> | src_ip        | proto | from_pattern |
>>>>> +---------------+-------+--------------+
>>>>> | 10.124.35.253 | any   | ^sip:.*$     |
>>>>> +---------------+-------+--------------+
>>>>>
>>>>> and when I try lo restart ser:
>>>>>
>>>>> Jan 15 15:34:45 delcolimba /usr/local/sbin/ser[703]: [ID 966737 
>>>>> daemon.info] permissions - initializing
>>>>> Jan 15 15:34:45 delcolimba /usr/local/sbin/ser[703]: [ID 414293 
>>>>> daemon.warning] Default allow file 
>>>>> (/usr/local/etc/ser/permissions.allow) not found => empty rule set
>>>>> Jan 15 15:34:45 delcolimba /usr/local/sbin/ser[703]: [ID 844440 
>>>>> daemon.warning] Default deny file 
>>>>> (/usr/local/etc/ser/permissions.deny) not found => empty rule set
>>>>>
>>>>> Jan 15 15:34:45 delcolimba /usr/local/sbin/ser[703]: [ID 895822 
>>>>> daemon.error] ERROR: permissions: trusted_reload(): Database problem
>>>>> Jan 15 15:34:45 delcolimba /usr/local/sbin/ser[703]: [ID 650101 
>>>>> daemon.crit] init_trusted(): Reload of trusted table failed
>>>>> Jan 15 15:34:45 delcolimba /usr/local/sbin/ser[703]: [ID 345573 
>>>>> daemon.error] Error while initializing allow_trusted function
>>>>> Jan 15 15:34:45 delcolimba /usr/local/sbin/ser[703]: [ID 660978 
>>>>> daemon.error] init_mod(): Error while initializing module permissions
>>>>>
>>>>>
>>>>> or when executing serctl fifo cmd:
>>>>>
>>>>> root at delcolimba /usr/local # sbin/serctl fifo trusted_dump
>>>>> 200 OK
>>>>>
>>>>> root at delcolimba /usr/local # sbin/serctl fifo trusted_reload
>>>>> 400 Trusted table reload failed
>>>>>
>>>>> root at delcolimba /usr/local # tail /var/adm/messages
>>>>>
>>>>> Jan 15 15:45:37 delcolimba /usr/local/sbin/ser[717]: [ID 895822 
>>>>> daemon.error] ERROR: permissions: trusted_reload(): Database problem
>>>>> Jan 15 15:45:37 delcolimba /usr/local/sbin/ser[717]: [ID 450600 
>>>>> daemon.error] ERROR: fifo_server: command (trusted_reload) 
>>>>> processing failed
>>>>>
>>>>>
>>>>> Thank you,
>>>>>
>>>>> Caio
>>>>> _______________________________________________
>>>>> Serusers mailing list
>>>>> Serusers at lists.iptel.org
>>>>> http://lists.iptel.org/mailman/listinfo/serusers
>>>
>>> _______________________________________________
>>> Serusers mailing list
>>> Serusers at lists.iptel.org
>>> http://lists.iptel.org/mailman/listinfo/serusers
> 
> _______________________________________________
> Serusers mailing list
> Serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers



More information about the sr-users mailing list