version 1.3, 1996/09/16 16:36:04 |
version 1.4, 1996/12/04 09:06:00 |
|
|
if (doall) |
if (doall) |
while ((pw = getpwent()) != NULL) { |
while ((pw = getpwent()) != NULL) { |
(void)setegid(pw->pw_gid); |
(void)setegid(pw->pw_gid); |
|
(void)initgroups(pw->pw_name, pw->pw_gid); |
(void)seteuid(pw->pw_uid); |
(void)seteuid(pw->pw_uid); |
if (!chdir(pw->pw_dir)) |
if (!chdir(pw->pw_dir)) |
cal(); |
cal(); |
|
|
if ((p = strchr(buf, '\n')) != NULL) |
if ((p = strchr(buf, '\n')) != NULL) |
*p = '\0'; |
*p = '\0'; |
else |
else |
while ((ch = getchar()) != '\n' && ch != EOF); |
while ((ch = getchar()) != '\n' && ch != EOF) |
|
; |
if (buf[0] == '\0') |
if (buf[0] == '\0') |
continue; |
continue; |
if (buf[0] != '\t') |
if (buf[0] != '\t') |
|
|
int val; |
int val; |
char *start, savech; |
char *start, savech; |
|
|
for (; !isdigit(*p) && !isalpha(*p) && *p != '*'; ++p); |
for (; !isdigit(*p) && !isalpha(*p) && *p != '*'; ++p) |
|
; |
if (*p == '*') { /* `*' is current month */ |
if (*p == '*') { /* `*' is current month */ |
*flags |= F_ISMONTH; |
*flags |= F_ISMONTH; |
*endp = p+1; |
*endp = p+1; |
|
|
} |
} |
if (isdigit(*p)) { |
if (isdigit(*p)) { |
val = strtol(p, &p, 10); /* if 0, it's failure */ |
val = strtol(p, &p, 10); /* if 0, it's failure */ |
for (; !isdigit(*p) && !isalpha(*p) && *p != '*'; ++p); |
for (; !isdigit(*p) && !isalpha(*p) && *p != '*'; ++p) |
|
; |
*endp = p; |
*endp = p; |
return (val); |
return (val); |
} |
} |
for (start = p; isalpha(*++p);); |
for (start = p; isalpha(*++p);) |
|
; |
savech = *p; |
savech = *p; |
*p = '\0'; |
*p = '\0'; |
if ((val = getmonth(start)) != 0) |
if ((val = getmonth(start)) != 0) |
|
|
*p = savech; |
*p = savech; |
return (0); |
return (0); |
} |
} |
for (*p = savech; !isdigit(*p) && !isalpha(*p) && *p != '*'; ++p); |
for (*p = savech; !isdigit(*p) && !isalpha(*p) && *p != '*'; ++p) |
|
; |
*endp = p; |
*endp = p; |
return (val); |
return (val); |
} |
} |
|
|
char path[MAXPATHLEN + 1]; |
char path[MAXPATHLEN]; |
|
|
FILE * |
FILE * |
opencal() |
opencal() |
|
|
(void)close(pdes[1]); |
(void)close(pdes[1]); |
} |
} |
(void)close(pdes[0]); |
(void)close(pdes[0]); |
|
(void)setuid(geteuid()); |
|
(void)setgid(getegid()); |
execl(_PATH_CPP, "cpp", "-P", "-I.", _PATH_INCLUDE, NULL); |
execl(_PATH_CPP, "cpp", "-P", "-I.", _PATH_INCLUDE, NULL); |
warn("execl: %s", _PATH_CPP); |
warn("execl: %s", _PATH_CPP); |
_exit(1); |
_exit(1); |
|
|
(void)close(pdes[0]); |
(void)close(pdes[0]); |
} |
} |
(void)close(pdes[1]); |
(void)close(pdes[1]); |
|
(void)setuid(geteuid()); |
|
(void)setgid(getegid()); |
execl(_PATH_SENDMAIL, "sendmail", "-i", "-t", "-F", |
execl(_PATH_SENDMAIL, "sendmail", "-i", "-t", "-F", |
"\"Reminder Service\"", "-f", "root", NULL); |
"\"Reminder Service\"", "-f", "root", NULL); |
warn("execl: %s", _PATH_SENDMAIL); |
warn("execl: %s", _PATH_SENDMAIL); |
|
|
(void)close(pdes[1]); |
(void)close(pdes[1]); |
done: (void)fclose(fp); |
done: (void)fclose(fp); |
(void)unlink(path); |
(void)unlink(path); |
while (wait(&status) >= 0); |
while (wait(&status) >= 0) |
|
; |
} |
} |
|
|
static char *months[] = { |
static char *months[] = { |