Annotation of researchv10no/cmd/nupas/send/authorize.c, revision 1.1

1.1     ! root        1: #include <stdio.h>
        !             2: #include "mail.h"
        !             3: #include "string.h"
        !             4: #include "dest.h"
        !             5: #include "aux.h"
        !             6: #include "process.h"
        !             7: 
        !             8: /*
        !             9:  *  Run a command to authorize or refuse entry.  Return status 0 means
        !            10:  *  authorize, -1 means refuse.
        !            11:  */
        !            12: extern
        !            13: authorize(dp)
        !            14:        dest *dp;
        !            15: {
        !            16:        process *pp;
        !            17:        string *errstr;
        !            18: 
        !            19:        dp->authorized = 1;
        !            20:        pp = proc_start(s_to_c(dp->repl1), (stream *)NULL, (stream *)NULL,
        !            21:                        outstream(), -1);
        !            22:        if (pp == NULL)
        !            23:                return;
        !            24:        errstr = s_new();
        !            25:        while (s_read_line(pp->std[2]->fp, errstr) != NULL)
        !            26:                ;
        !            27:        if ((dp->pstat = proc_wait(pp)) != 0) {
        !            28:                dp->repl2 = errstr;
        !            29:                dp->status = d_noforward;
        !            30:        } else
        !            31:                s_free(errstr);
        !            32:        proc_free(pp);
        !            33: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.