Annotation of 40BSD/cmd/xsend/enroll.c, revision 1.1.1.1

1.1       root        1: #include "xmail.h"
                      2: #include "pwd.h"
                      3: #include "sys/types.h"
                      4: MINT *a[42], *x, *b, *one, *c64, *t45, *z, *q, *r, *two, *t15;
                      5: char buf[256];
                      6: char maildir[] = { "/usr/spool/secretmail"};
                      7: main()
                      8: {
                      9:        int uid, i;
                     10:        FILE *fd;
                     11:        char *myname, fname[128];
                     12:        uid = getuid();
                     13:        myname = getlogin();
                     14:        if(myname == NULL)
                     15:                myname = getpwuid(uid)->pw_name;
                     16:        sprintf(fname, "%s/%s.key", maildir, myname);
                     17:        comminit();
                     18:        setup(getpass("Gimme key: "));
                     19:        mkb();
                     20:        mkx();
                     21: #ifdef debug
                     22:        omout(b);
                     23:        omout(x);
                     24: #endif
                     25:        mka();
                     26:        i = creat(fname, 0644);
                     27:        if(i<0)
                     28:        {       perror("fname");
                     29:                exit(1);
                     30:        }
                     31:        close(i);
                     32:        fd = fopen(fname, "w");
                     33:        for(i=0; i<42; i++)
                     34:                nout(a[i], fd);
                     35:        exit(0);
                     36: }

unix.superglobalmegacorp.com

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