On Sat, Jan 04, 2003 at 04:13:49PM -0500, Andrew wrote:
> Would you mind sharing where in the Courier source you found information 
> on the authdaemond protocol? I was looking for this information some 
> time ago but I guess I didn't look hard enough. If you could tell me the 
> specific files to look in that would help a lot.

authlib/authdaemond.c:
  function 'start' waits for a socket connection then calls 'doauth'
  function 'doauth' reads characters up to a newline and then checks for
    PRE xxx    : calls pre(xxx)
    PASSWD xxx : calls passwd(xxx)
    AUTH nnn   : reads nnn bytes then calls auth(data)

function 'auth' reads:
  characters up to newline  -> service
  characters up to newline  -> authtype
  remainder of buffer is passed as a parameter to each auth module

It's the same authentication record as defined in the authlib(7) manpage,
i.e.

              SERVICE<NEWLINE>AUTHTYPE<NEWLINE>AUTHDATA

function 'pre' is used to check a userid exists without checking its
password, see auth_prefunc in authlib(7). It splits its input on spaces:

    PRE module service userid

Look for strcmp, you'll see that setting the module to '.' means try all
modules in turn, the same as is done for authentication. So:

# exim -be '${readsocket{/path/to/socket}{PRE . exim $local_part@$domain}}

will search for a user, and return the parameters if found (address_data and
${extract} give a convenient way to pick out the pieces)

passwd() looks like an interface to the password changing function:

    PASSWD<tab>service<tab>userid<tab>oldpwd<tab>newpwd

but I haven't tried it.

Regards,

Brian.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to