1 # 2 3 #include "rcv.h" 4 5 /* 6 * Mail -- a mail program 7 * 8 * Give names to all the temporary files that we will need. 9 */ 10 11 static char *SccsId = "@(#)temp.c 1.1 10/08/80"; 12 13 char tempMail[14]; 14 char tempQuit[14]; 15 char tempEdit[14]; 16 char tempSet[14]; 17 char tempResid[14]; 18 char tempMesg[14]; 19 20 tinit() 21 { 22 register char *cp, *cp2; 23 char uname[9]; 24 register int err = 0; 25 register int pid; 26 27 pid = getpid(); 28 sprintf(tempMail, "/tmp/Rs%05d", pid); 29 sprintf(tempResid, "/tmp/Rq%05d", pid); 30 sprintf(tempQuit, "/tmp/Rm%05d", pid); 31 sprintf(tempEdit, "/tmp/Re%05d", pid); 32 sprintf(tempSet, "/tmp/Rx%05d", pid); 33 sprintf(tempMesg, "/tmp/Rx%05d", pid); 34 35 if (strlen(myname) != 0) { 36 uid = getuserid(myname); 37 if (uid == -1) 38 goto youlose; 39 } 40 else { 41 uid = getuid() & UIDMASK; 42 if (username(uid, uname) < 0) { 43 copy("ubluit", myname); 44 youlose: 45 err++; 46 if (rcvmode) { 47 printf("Who are you!?\n"); 48 exit(1); 49 } 50 } 51 copy(uname, myname); 52 } 53 mailname = mailspace; 54 cp = value("HOME"); 55 if (cp == NOSTR) 56 cp = "."; 57 copy(cp, homedir); 58 findmail(); 59 cp = copy(homedir, mbox); 60 copy("/mbox", cp); 61 cp = copy(homedir, mailrc); 62 copy("/.mailrc", cp); 63 cp = copy(homedir, deadletter); 64 copy("/dead.letter", cp); 65 if (debug) { 66 printf("uid = %d, user = %s, mailname = %s\n", 67 uid, myname, mailname); 68 printf("deadletter = %s, mailrc = %s, mbox = %s\n", 69 deadletter, mailrc, mbox); 70 } 71 } 72