Annotation of 43BSDReno/usr.bin/mail/temp.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1980 Regents of the University of California.
                      3:  * All rights reserved.
                      4:  *
                      5:  * Redistribution and use in source and binary forms are permitted
                      6:  * provided that: (1) source distributions retain this entire copyright
                      7:  * notice and comment, and (2) distributions including binaries display
                      8:  * the following acknowledgement:  ``This product includes software
                      9:  * developed by the University of California, Berkeley and its contributors''
                     10:  * in the documentation or other materials provided with the distribution
                     11:  * and in all advertising materials mentioning features or use of this
                     12:  * software. Neither the name of the University nor the names of its
                     13:  * contributors may be used to endorse or promote products derived
                     14:  * from this software without specific prior written permission.
                     15:  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
                     16:  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
                     17:  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     18:  */
                     19: 
                     20: #ifndef lint
                     21: static char sccsid[] = "@(#)temp.c     5.14 (Berkeley) 6/1/90";
                     22: #endif /* not lint */
                     23: 
                     24: #include "rcv.h"
                     25: 
                     26: /*
                     27:  * Mail -- a mail program
                     28:  *
                     29:  * Give names to all the temporary files that we will need.
                     30:  */
                     31: 
                     32: char   tempMail[24];
                     33: char   tempQuit[24];
                     34: char   tempEdit[24];
                     35: char   tempSet[24];
                     36: char   tempResid[24];
                     37: char   tempMesg[24];
                     38: 
                     39: tinit()
                     40: {
                     41:        register char *cp;
                     42: 
                     43:        strcpy(tempMail, _PATH_TMP);
                     44:        mktemp(strcat(tempMail, "RsXXXXXX"));
                     45:        strcpy(tempResid, _PATH_TMP);
                     46:        mktemp(strcat(tempResid, "RqXXXXXX"));
                     47:        strcpy(tempQuit, _PATH_TMP);
                     48:        mktemp(strcat(tempQuit, "RmXXXXXX"));
                     49:        strcpy(tempEdit, _PATH_TMP);
                     50:        mktemp(strcat(tempEdit, "ReXXXXXX"));
                     51:        strcpy(tempSet, _PATH_TMP);
                     52:        mktemp(strcat(tempSet, "RxXXXXXX"));
                     53:        strcpy(tempMesg, _PATH_TMP);
                     54:        mktemp(strcat(tempMesg, "RxXXXXXX"));
                     55: 
                     56:        /*
                     57:         * It's okay to call savestr in here because main will
                     58:         * do a spreserve() after us.
                     59:         */
                     60:        if (myname != NOSTR) {
                     61:                if (getuserid(myname) < 0) {
                     62:                        printf("\"%s\" is not a user of this system\n",
                     63:                            myname);
                     64:                        exit(1);
                     65:                }
                     66:        } else {
                     67:                if ((cp = username()) == NOSTR) {
                     68:                        myname = "ubluit";
                     69:                        if (rcvmode) {
                     70:                                printf("Who are you!?\n");
                     71:                                exit(1);
                     72:                        }
                     73:                } else
                     74:                        myname = savestr(cp);
                     75:        }
                     76:        if ((cp = getenv("HOME")) == NOSTR)
                     77:                cp = ".";
                     78:        homedir = savestr(cp);
                     79:        if (debug)
                     80:                printf("user = %s, homedir = %s\n", myname, homedir);
                     81: }

unix.superglobalmegacorp.com

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