[tpop3d-discuss] ldap virtual auth plugin : near release

Chris Lightfoot chris at ex-parrot.com
Thu, 21 Feb 2002 00:20:22 +0000


On Mon, Feb 18, 2002 at 05:08:52PM +0100, Prune wrote:
    [ auth-ldap stuff ]

I've been workin on integrating this-- there are a couple
of things I'm not happy with in the existing code, for
instance the use of fixed-length buffers, which I'm
changing, but in the meantime, I have a couple of
questions:

  - Firstly, can you give me some example data against
    which the plugin should be able to authenticate (in
    LDIF format or whatever). I'm not very familiar with
    LDAP and it's not quite clear to me what the code is
    expecting to find in the directory.

> /* auth_mysql_new_user_pass */
> 
> authcontext auth_mysql_new_user_pass(const char *user, const char *pass, const char *host /* unused */) {
>   authcontext a = NULL;
>   char *local_part = NULL;
>   const char *domain;
>   char *filter = NULL;
    [...]
>     /* we split the login and the domain from the email style login given by the user */
>     domain = user + strcspn(user, "@%!");
>     if (domain == user || !*domain) return NULL;
>     ++domain;
>     local_part = xmalloc(domain - user);
>     if (!local_part) return NULL;
>     memset(local_part, 0, domain - user);
>     strncpy(local_part, user, domain - user - 1);

  - Secondly, you never use the domain in constructing the
    query against the directory. How do you specify the
    existence of accounts in more than one domain?


I think I understand broadly what your code does, though,
so I should be able to finish integrating it and do
another pre-release within the next few days.

-- 
 ``There's so much comedy on television.
   Does that cause comedy in the streets?'' (Dick Cavett)