SCCS-vsn: usr.bin/vacation/vacation.c 4.2
# include <pwd.h>
# include <stdio.h>
# include <sysexits.h>
# include <ctype.h>
# include <pwd.h>
# include <stdio.h>
# include <sysexits.h>
# include <ctype.h>
-# include "useful.h"
-# include "userdbm.h"
-SCCSID(@(#)vacation.c 4.1 %G%);
+static char SccsId[] = "@(#)vacation.c 4.2 %G%";
/*
** VACATION -- return a message to the sender when on vacation.
/*
** VACATION -- return a message to the sender when on vacation.
** care not to return a message too often to prevent
** "I am on vacation" loops.
**
** care not to return a message too often to prevent
** "I am on vacation" loops.
**
-** For best operation, this program should run setuid to
-** root or uucp or someone else that sendmail will believe
-** a -f flag from. Otherwise, the user must be careful
-** to include a header on his .vacation.msg file.
-**
** Positional Parameters:
** the user to collect the vacation message from.
**
** Flag Parameters:
** -I initialize the database.
** Positional Parameters:
** the user to collect the vacation message from.
**
** Flag Parameters:
** -I initialize the database.
-** -tT set the timeout to T. messages arriving more
-** often than T will be ignored to avoid loops.
**
** Side Effects:
** A message is sent back to the sender.
**
** Side Effects:
** A message is sent back to the sender.
+typedef int bool;
+
+# define TRUE 1
+# define FALSE 0
+
# define MAXLINE 256 /* max size of a line */
# define MAXNAME 128 /* max size of one name */
# define MAXLINE 256 /* max size of a line */
# define MAXNAME 128 /* max size of one name */
+typedef struct
+{
+ char *dptr;
+ int dsize;
+} DATUM;
+
+extern DATUM fetch();
+
main(argc, argv)
char **argv;
{
main(argc, argv)
char **argv;
{
initialize();
exit(EX_OK);
initialize();
exit(EX_OK);
- case 't': /* set timeout */
- Timeout = convtime(++p);
- break;
-
default:
usrerr("Unknown flag -%s", p);
exit(EX_USAGE);
default:
usrerr("Unknown flag -%s", p);
exit(EX_USAGE);
{
static char line[MAXLINE];
register char *p;
{
static char line[MAXLINE];
register char *p;
/* read the from line */
if (fgets(line, sizeof line, stdin) == NULL ||
/* read the from line */
if (fgets(line, sizeof line, stdin) == NULL ||
{
char *homedir;
char buf[MAXLINE];
{
char *homedir;
char buf[MAXLINE];
setgid(getgid());
setuid(getuid());
setgid(getgid());
setuid(getuid());
p = malloc(strlen(s) + 1);
if (p == NULL)
p = malloc(strlen(s) + 1);
if (p == NULL)