tpop3d-devel
[Top][All Lists]
Advanced

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

Re: [tpop3d-discuss] auth-ldap module for tpop3d


From: Prune
Subject: Re: [tpop3d-discuss] auth-ldap module for tpop3d
Date: Wed, 06 Feb 2002 19:13:37 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1

Chris Lightfoot wrote:
On Wed, Feb 06, 2002 at 05:48:07PM +0100, Prune wrote:
[...]
It's just failing.
aaa (added for test) was 'auth-ldap-filter-attr' at the begining.
can you explain me the first part of the debug.... why is it comparing
the configuration key 'aaa' to the first entry in the configuration
file, then to a blank line, then to another one and the stop ??

Could you send me your patch (as private email if you
don't want to release it to the list yet); it's a bit hard
to debug this without the code in front of me.

You allready have all that you need... :)
the 'patch' is not actually a patch.... it's just a file :)

my part is :


in auth_ldap.c

 /* we get the attrubut used for the search */
    if ((I = stringmap_find(config, "aaa")))
      strncpy(ldap_connection.filter_attr, (char*)I->v, FILTER_MAXLENGTH) ;
    else {
         strcpy(ldap_connection.filter_attr,DEFAULT_FILTER_ATTR);
         print_log(LOG_WARNING, _("auth_mysql_init: filter-attr fail from the conf"));
        }


the stringmap_find returns an error. it's the same as the original... :)
the 'else' is working fine.

as I said, it's like the stringmap_find fuction was missing something while parsing the conf file...
no more clues yet... I'll doubble check to find why.

In the stringmap_find functions below....

item *stringmap_find(const stringmap S, const char *k) {
    stringmap S2;
    int i;
    if (!S || S->key == NULL) return 0;
    for (S2 = S;;) {
        printf("les attrisbuts stringmap : %s\t%s\n",k,S2->key);
        i = strcmp(k, S2->key);
        if (i == 0) return &(S2->d);
        else if (i < 0) {
            if (S2->l) S2 = S2->l;
            else return NULL;
        } else if (i > 0) {
            if (S2->g) S2 = S2->g;
            else return NULL;
        }
    }
}

what is the purpose of  S2->l and S2->g when the key is not found in the configuration file ?
this would help me to understand and, maybe, diagnose :))

Cheers,

Prune

reply via email to

[Prev in Thread] Current Thread [Next in Thread]