On Thursday, 2005-03-31 at 08:12:56 PM, Giovanni Venturi scribbled:
> Alle 09:00, giovedì 31 marzo 2005, Benjamin Lee ha scritto:
> > I think this is the relevant code:
> >
> > /*
> >  * new authorisation, usable by POST and GET
> >  */
> > static URLTranslation *authorise_username(Octstr *username, Octstr
> > *password, Octstr *client_ip)
> > {
> ...
> I tryed to add a fprintf(...) in gw/urltrans.c:
> 
> URLTranslation *urltrans_find_username(URLTranslationList *trans,
>                                        Octstr *name)
> {
>     URLTranslation *t;
>     int i;
> 
>     gw_assert(name != NULL);
>     for (i = 0; i < list_len(trans->list); ++i) {
>         t = list_get(trans->list, i);
>         if (t->type == TRANSTYPE_SENDSMS) {
>             if (octstr_compare(name, t->username) == 0)
>             {
>  -->>   fprintf( stderr, "return t;" ); <<--- I added this and it prints this.
>                 return t;
>             }
>         }
>     }
>     fprintf( stderr, "ritorna NULL" );
>     return NULL;
> }

Which means that you have a valid username...

So try something like the attached patch.

-- 
Benjamin Lee                           mailto:[EMAIL PROTECTED]
Melbourne, Australia                            http://www.realthought.net
Open Source / Linux / BSD / GNU                       tel:+61.4.16.BEN.LEE
__________________________________________________________________________
I cannot believe that God plays dice with the cosmos.
                -- Albert Einstein, on the randomness of quantum mechanics
Index: gw/smsbox.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsbox.c,v
retrieving revision 1.257
diff -u -r1.257 smsbox.c
--- gw/smsbox.c 22 Feb 2005 16:22:03 -0000      1.257
+++ gw/smsbox.c 1 Apr 2005 00:19:57 -0000
@@ -2410,6 +2410,12 @@
     if ((t = urltrans_find_username(translations, username))==NULL)
        return NULL;
 
+       /* if this does not give you enough information try 
+          octstr_dump(urltrans_password, 0) */
+    debug("my.debug", 0, "%s():%s:%d: compare password <%s> urltrans_password 
<%s>", 
+                 __func__, __FILE__, __LINE__,
+                 octstr_get_cstr(password), 
octstr_get_cstr(urltrans_password(t)));    
+
     if (octstr_compare(password, urltrans_password(t))!=0)
        return NULL;
     else {

Reply via email to