1: #include "remind.h"
2:
3: main(argc, argv)
4: int argc;
5: char **argv;
6: { register int i;
7: register char *p;
8: int errflg;
9: struct passwd *pw;
10:
11: signal (SIGHUP,SIG_IGN); /* Ignore Hangups */
12:
13: m.nrcvrs = m.msgbytes = m.bits = m.dirsize = errflg = 0;
14:
15: for (i = 1; i++ < argc;)
16: { p = *++argv;
17: if (*p>='a' && *p<='z')
18: puserid(p); /* Alphabetic -- Receiver id */
19: else if (*p == '-')
20: pflags(&p[1]); /* -flags */
21: else if (getdt(p)) /* Anything else - date or time */
22: { fprintf (stderr,invalid, p);
23: errflg = -1;
24: }
25: /*
26: while( *p ) *p++ = 0;
27: **/
28: }
29:
30: Uid = getuid();
31: if((pw=getpwuid(Uid))==NULL)
32: strxfer("??",m.sender,3);
33: else
34: {
35: strcpy(m.sender,pw->pw_name);
36: if(!pw->pw_shell[0])
37: strcpy(shell,"/bin/sh");
38: else
39: strcpy(shell,pw->pw_shell);
40: }
41: #ifdef DEBUG
42: {
43: fprintf(stderr,"Original Uid = %d\n",Uid);
44: fprintf(stderr,"Sender = %s\n",m.sender);
45: }
46: #endif DEBUG
47: if (m.nrcvrs == 0)
48: puserid(m.sender);
49: if (checkusers() || errflg) exit(1);
50:
51: if (m.msgbytes == 0 && argc != 1) getmsg();
52:
53: m.nobytes = m.msgbytes + 8*m.nrcvrs + m.dirsize;
54:
55: #ifndef DEBUG
56: while ((i = fork()) == -1) sleep(5);
57: if (i) exit(0); /* The rest will be done in background mode */
58: #endif DEBUG
59:
60: /*
61: setpgrp();
62: */
63: if (dtime() && argc!=1)
64: deliver();
65: else
66: enqueue();
67:
68: }
Defined functions
main
defined in line
3;
never used