Re: SQLAliasAuth Problem - workaround

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

 



It appears that m_username is not being assigned correctly in gksql.cxx
 as we can see that when we create a user "ODBC" for MySQL, the SQLAliasAuth
works fine.

The value of username taken from the gatekeeper.ini file's SQLAliasAuth
section is not being used and is being replaced with "ODBC".

Hence I created a user "ODBC" with the same password given in the ini file and
then I am able to use it.
This error is in both the debug and release builds.

gatekeeper.ini file:-

[Gatekeeper::Auth]
SQLAliasAuth=sufficient;RRQ,ARQ
default=allow

[SQLAliasAuth]
Driver=MySQL
Host=localhost
Database=gkcontrol
User=gnugk
Password=secret
CacheTimeout=300
Query=SELECT CONCAT('sigip:',host,':',port) as authrule FROM users WHERE alias
= '%1' AND GatekeeperId = '%2' AND active
default=deny

MySQL Table useres in database gkcontrol:-
Field         Type           Null    Key     Default
------------  -------------  ------  ------  -------
alias         varchar(20)            PRI
h235password  varchar(40)    YES             (NULL)
active        enum('1','0')                  1
host          varchar(25)    YES             (NULL)
port          varchar(6)     YES             (NULL)
GatekeeperId  varchar(20)

Data in Table users
alias	h235password	active	host		port	GatekeeperId	
-----	------------	------	------------	----	------------
MYEP1	NULL		1	192.168.0.51	1720	MYGK1
YOUREP	NULL		1	192.168.0.51	1720	MYGK2
MYEP2	NULL		1	192.168.0.52	1720	MYGK1

when the user "ODBC" is not in the MySQL access list the GK Log shows:-
gkauth.cxx(444) GkAuth Add default rule with flag ff
gkauth.cxx(444) GkAuth Add SQLAliasAuth rule with flag a
gksql_mysql.cxx(389) SQLAliasAuth MySQL connection to @localhost[gkcontrol]
failed (mysql_real_connect failed): Access denied for user:
'ODBC@localhost'(Using password: YES)
gksql.cxx(112) SQLAliasAuth Database connection failed: @localhost[gkcontrol]
gkauth.cxx(1321) SQLAliasAuth Module creation failed: could not connect to the
database

when the user "ODBC" is inserted in the MySQL users list, the GK Log shows:-
gkauth.cxx(444)	GkAuth	Add default rule with flag ff
gkauth.cxx(444)	GkAuth	Add SQLAliasAuth rule with flag a
gksql.cxx(117)	SQLAliasAuth	Database connection pool created:
@localhost[gkcontrol]
gkauth.cxx(1329)	SQLAliasAuth	Configured query: SELECT
CONCAT('sigip:',host,':',port) as authrule FROM users WHERE alias = '%1' AND
GatekeeperId = '%2' AND active


This may have something to do with the conditional compiler directive
 to consider the username variable protected or
 may be a variable out of scope or
 order of assignment.
The Debug PTRACE is not able to show the MySQL user it has used as it is
blank.

Till then for Win32 users, just create a ODBC user with the same password!
This is all on a Sunday's work! Hope it benefits everyone.

Ap.Muthu




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
List: Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id?49
Homepage: http://www.gnugk.org/


[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux