[JDEV] Question about jabber:iq:auth packets and XDB
Joe Breeden
jbreeden at ena.com
Wed Oct 23 09:19:17 CDT 2002
All,
I sent this message in the other day and have since spent some time on the problem and have narrowed down to one line of code in mod_auth_plain.c that could be changed to help me with my need and probably not break any other implementations. Line 70 (see below) is a call to the check routine and as you can see only the password tag from the original XML is passed on to the xdb subsystem. If this line could be modified in a way that the password and resource are passed to the xdb subsystem it shouldn't break anything else and should make things easier for losers like me who want to re-write xdb in some language other than C.
I looked at the xmlnode_get_tag and could see how it can get tags in many ways, but I couldn't see how it could return multiple tags on the same level. A modification to that routine which in found in the source file xmlnode.c around line 331 would be nice. Maybe something allowing a | separated list of tags that would return a structure with all of the found requested tags.
if(xdb_act(m->si->xc, m->user->id, NS_AUTH, "check", NULL, xmlnode_get_tag(m->packet->iq,"password")))
Thanks,
Joe Breeden
Education Networks of America
-----Original Message-----
From: Joe Breeden
Sent: Friday, October 18, 2002 10:31 AM
To: Jdev (E-mail)
Subject: [JDEV] Question about jabber:iq:auth packets and XDB
All,
I have noticed a quirk, if you will, in the way jabberd passes jabber:iq:auth packets to XDB. If you look at the output from my debug log (greatly edited for brevity) it looks like the client is sending a <resource> tag which is getting stripped from the stream when the packet is forwarded to my XDB service.
My guess is that deliver.c is responsible for rewriting the XML, but I can't figure out where as my C is so poor that I wouldn't begin to claim to understand what the program is doing. I want to be able to store the resources a user is sending like xdb_sql does and it seems to me the perfect time to do this would be when an iq:auth packet is received, except that this handy-dandy piece of information is not being passed to my component. Any help here would be appreciated. Thanks in advance.
---------------------------------------------------------------BEGIN TRACE-----------------------------------------------------------------------------------------------------------
Fri Oct 18 08:57:22 2002 mio.c:760 MIO read from socket 15: <iq type='set' id='__AUTH__'><query xmlns='jabber:iq:auth'><username>joehep</username><resource>GAIM</resource><password>password</password></query></iq>
Fri Oct 18 08:57:22 2002 deliver.c:474 DELIVER 4:shrieker.ena.com <route type='auth' to='joehep at shrieker.ena.com/GAIM' from='15 at c2s/812F628'><iq type='set' id='__AUTH__'><query xmlns='jabber:iq:auth'><username>joehep</username><resource>GAIM</resource><password>password</password></query></iq></route>
Fri Oct 18 08:57:22 2002 deliver.c:94 (80D84A0)incoming packet <route type='auth' to='joehep at shrieker.ena.com/GAIM' from='15 at c2s/812F628'><iq type='set' id='__AUTH__'><query xmlns='jabber:iq:auth'><username>joehep</username><resource>GAIM</resource><password>password</password></query></iq></route>
Fri Oct 18 08:57:22 2002 deliver.c:474 DELIVER 2:shrieker.ena.com <xdb type='set' action='check' to='joehep at shrieker.ena.com' from='sessions' ns='jabber:iq:auth' id='85'><password>password</password></xdb>
------------------------------------------------------------------END TRACE-----------------------------------------------------------------------------------------------------------
Again, thanks for the help,
--Joe Breeden
>From Murphy's Laws of Computing:
9. A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20021023/bc2c0ae5/attachment-0002.htm>
More information about the JDev
mailing list