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

Re: [leafnode-list] Question regarding authentification

Matthias Andree wrote:

> 4) go to www.qmail.org and check out the various checkpasswd thingies
> that are actually provided for qmail's qmail-pop3d, and see if they
> will fit into leafnode somehow.

I had a look. The problem (for me :-) is that checkpassword insists on
reading the username and password from fd3, and I have (due to a lack
of Unix programming knowledge) no idea how to send data from a parent
process to fd3 of a child process. I assume that it has to do something
with pipes, but sifting through Stevens so far was not very helpful.

I assume that it must go somewhat like this (this is pseudo code):

pid = fork();
if ( pid == 0 ) {
    /* child process */
    exec( "checkpassword", "" );
    /* exec doesn't return */
waitpid(pid, &returncode, 0);

but I have no idea how to properly create the pipe that the parent process
can write to fd3 of the child process (is an open file descriptor retained
during an exec() call?).

I assume that it wouldn't be a major fuss to include checkpassword into
the leafnode distribution because it is free. I could still check with
Dan Bernstein first, just to be sure. Of course configure.in would have
to be tweaked so that an already existing checkpassword would not be


/* Cornelius Krasel, U Wuerzburg, Dept. of Pharmacology, Versbacher Str. 9 */
/* D-97078 Wuerzburg, Germany   email: phak004@xxxxxxxxxxxxxxxxxxxxxx  SP4 */
/* "Science is the game we play with God to find out what His rules are."  */

leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list