fix security/privacy problem (from ks@ef.purdue.edu (Kirk Smith))
[unix-history] / usr / src / usr.bin / mail / def.h
index 8c7150b..a597628 100644 (file)
@@ -1,17 +1,20 @@
-#
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)def.h       5.2 (Berkeley) %G%
+ */
 
 
-#include "local.h"
-#include <sys/types.h>
+#include <sys/param.h>         /* includes <sys/types.h> */
 #include <signal.h>
 #include <stdio.h>
 #include <signal.h>
 #include <stdio.h>
+#include <sgtty.h>
+#include "local.h"
 
 #undef isalpha
 #undef isdigit
 
 
 #undef isalpha
 #undef isdigit
 
-/*
- * Sccs Id = "@(#)def.h        1.4 %G%";
- */
-
 /*
  * Mail -- a mail program
  *
 /*
  * Mail -- a mail program
  *
 
 
 #define        ESCAPE          '~'             /* Default escape for sending */
 
 
 #define        ESCAPE          '~'             /* Default escape for sending */
-#define        NMLSIZE         20              /* max names in a message list */
-#define        PATHSIZE        35              /* Size of pathnames throughout */
-#define        NAMESIZE        20              /* Max size of user name */
-#define        HSHSIZE         19              /* Hash size for aliases and vars */
+#define        NMLSIZE         1024            /* max names in a message list */
+#define        PATHSIZE        1024            /* Size of pathnames throughout */
+#define        NAMESIZE        32              /* Max size of user name */
+#define        HSHSIZE         59              /* Hash size for aliases and vars */
 #define        HDRFIELDS       3               /* Number of header fields */
 #define        HDRFIELDS       3               /* Number of header fields */
-#define        LINESIZE        512             /* max readable line width */
-#define        SCREEN          18              /* screen size in lines (effective) */
+#define        LINESIZE        BUFSIZ          /* max readable line width */
 #define        STRINGSIZE      ((unsigned) 128)/* Dynamic allocation units */
 #define        STRINGSIZE      ((unsigned) 128)/* Dynamic allocation units */
-#define        MAXARGC         20              /* Maximum list of raw strings */
+#define        MAXARGC         1024            /* Maximum list of raw strings */
 #define        NOSTR           ((char *) 0)    /* Null string pointer */
 #define        MAXEXP          25              /* Maximum expansion of aliases */
 #define        equal(a, b)     (strcmp(a,b)==0)/* A nice function to string compare */
 #define        NOSTR           ((char *) 0)    /* Null string pointer */
 #define        MAXEXP          25              /* Maximum expansion of aliases */
 #define        equal(a, b)     (strcmp(a,b)==0)/* A nice function to string compare */
@@ -50,7 +52,7 @@ struct message {
        short   m_flag;                 /* flags, see below */
        short   m_block;                /* block number of this message */
        short   m_offset;               /* offset in block of message */
        short   m_flag;                 /* flags, see below */
        short   m_block;                /* block number of this message */
        short   m_offset;               /* offset in block of message */
-       unsigned        m_size;         /* Bytes in the message */
+       long    m_size;                 /* Bytes in the message */
        short   m_lines;                /* Lines in the message */
 };
 
        short   m_lines;                /* Lines in the message */
 };
 
@@ -58,13 +60,17 @@ struct message {
  * flag bits.
  */
 
  * flag bits.
  */
 
-#define        MUSED           1               /* entry is used, but this bit isn't */
-#define        MDELETED        2               /* entry has been deleted */
-#define        MSAVED          4               /* entry has been saved */
-#define        MTOUCH          8               /* entry has been noticed */
-#define        MPRESERVE       16              /* keep entry in sys mailbox */
-#define        MMARK           32              /* message is marked! */
-#define        MODIFY          64              /* message has been modified */
+#define        MUSED           (1<<0)          /* entry is used, but this bit isn't */
+#define        MDELETED        (1<<1)          /* entry has been deleted */
+#define        MSAVED          (1<<2)          /* entry has been saved */
+#define        MTOUCH          (1<<3)          /* entry has been noticed */
+#define        MPRESERVE       (1<<4)          /* keep entry in sys mailbox */
+#define        MMARK           (1<<5)          /* message is marked! */
+#define        MODIFY          (1<<6)          /* message has been modified */
+#define        MNEW            (1<<7)          /* message has never been seen */
+#define        MREAD           (1<<8)          /* message has been read sometime. */
+#define        MSTATUS         (1<<9)          /* message status has changed */
+#define        MBOX            (1<<10)         /* Send this to mbox, regardless */
 
 /*
  * Format of the command description table.
 
 /*
  * Format of the command description table.
@@ -97,8 +103,11 @@ struct cmd {
 
 #define        P       040             /* Autoprint dot after command */
 #define        I       0100            /* Interactive command bit */
 
 #define        P       040             /* Autoprint dot after command */
 #define        I       0100            /* Interactive command bit */
-#define        M       0200            /* Illegal from send mode bit */
+#define        M       0200            /* Legal from send mode bit */
 #define        W       0400            /* Illegal when read only bit */
 #define        W       0400            /* Illegal when read only bit */
+#define        F       01000           /* Is a conditional command */
+#define        T       02000           /* Is a transparent command */
+#define        R       04000           /* Cannot be called from collect */
 
 /*
  * Oft-used mask values
 
 /*
  * Oft-used mask values
@@ -184,6 +193,14 @@ struct grouphead {
 #define        NOGRP   ((struct grouphead *) 0)/* The nil grouphead pointer */
 #define        NOGE    ((struct group *) 0)    /* The nil group pointer */
 
 #define        NOGRP   ((struct grouphead *) 0)/* The nil grouphead pointer */
 #define        NOGE    ((struct group *) 0)    /* The nil group pointer */
 
+/*
+ * Structure of the hash table of ignored header fields
+ */
+struct ignore {
+       struct ignore   *i_link;        /* Next ignored field in bucket */
+       char            *i_field;       /* This ignored field */
+};
+
 /*
  * Token values returned by the scanner used for argument lists.
  * Also, sizes of scanner-related things.
 /*
  * Token values returned by the scanner used for argument lists.
  * Also, sizes of scanner-related things.
@@ -202,7 +219,16 @@ struct grouphead {
 #define TPLUS  10                      /* A '+' */
 
 #define        REGDEP  2                       /* Maximum regret depth. */
 #define TPLUS  10                      /* A '+' */
 
 #define        REGDEP  2                       /* Maximum regret depth. */
-#define        STRINGLEN       64              /* Maximum length of string token */
+#define        STRINGLEN       1024            /* Maximum length of string token */
+
+/*
+ * Constants for conditional commands.  These describe whether
+ * we should be executing stuff or not.
+ */
+
+#define        CANY            0               /* Execute in send or receive mode */
+#define        CRCV            1               /* Execute in receive mode only */
+#define        CSEND           2               /* Execute in send mode only */
 
 /*
  * Kludges to handle the change from setexit / reset to setjmp / longjmp
 
 /*
  * Kludges to handle the change from setexit / reset to setjmp / longjmp
@@ -219,6 +245,24 @@ struct grouphead {
 #ifndef VMUNIX
 #define        vfork() fork()
 #endif
 #ifndef VMUNIX
 #define        vfork() fork()
 #endif
+#ifndef        SIGRETRO
+#define        sigchild()
+#endif
+
+/*
+ * 4.2bsd signal interface help...
+ */
+#ifdef VMUNIX
+#define        sigset(s, a)    signal(s, a)
+#define        sigsys(s, a)    signal(s, a)
+#endif
+
+/*
+ * Truncate a file to the last character written. This is
+ * useful just before closing an old file that was opened
+ * for read/write.
+ */
+#define trunc(stream)  ftruncate(fileno(stream), (long) ftell(stream))
 
 /*
  * Forward declarations of routine types to keep lint and cc happy.
 
 /*
  * Forward declarations of routine types to keep lint and cc happy.
@@ -229,6 +273,7 @@ FILE        *collect();
 FILE   *infix();
 FILE   *mesedit();
 FILE   *mespipe();
 FILE   *infix();
 FILE   *mesedit();
 FILE   *mespipe();
+FILE   *popen();
 FILE   *setinput();
 char   **unpack();
 char   *addto();
 FILE   *setinput();
 char   **unpack();
 char   *addto();
@@ -241,6 +286,7 @@ char        *expand();
 char   *gets();
 char   *hfield();
 char   *index();
 char   *gets();
 char   *hfield();
 char   *index();
+char   *name1();
 char   *nameof();
 char   *nextword();
 char   *getenv();
 char   *nameof();
 char   *nextword();
 char   *getenv();
@@ -249,18 +295,24 @@ char      *hcontents();
 char   *netmap();
 char   *netname();
 char   *readtty();
 char   *netmap();
 char   *netname();
 char   *readtty();
+char   *reedit();
 char   *rename();
 char   *revarpa();
 char   *rindex();
 char   *rpair();
 char   *salloc();
 char   *savestr();
 char   *rename();
 char   *revarpa();
 char   *rindex();
 char   *rpair();
 char   *salloc();
 char   *savestr();
-char   *savestr();
+char   *skin();
 char   *snarf();
 char   *snarf();
+char   *strcat();
+char   *strcpy();
 char   *value();
 char   *vcopy();
 char   *yankword();
 off_t  fsize();
 char   *value();
 char   *vcopy();
 char   *yankword();
 off_t  fsize();
+#ifndef VMUNIX
+int    (*sigset())();
+#endif
 struct cmd     *lex();
 struct grouphead       *findgroup();
 struct name    *cat();
 struct cmd     *lex();
 struct grouphead       *findgroup();
 struct name    *cat();
@@ -274,4 +326,6 @@ struct      name    *put();
 struct name    *usermap();
 struct name    *verify();
 struct var     *lookup();
 struct name    *usermap();
 struct name    *verify();
 struct var     *lookup();
-unsigned       int     msize();
+long   transmit();
+int    icequal();
+int    cmpdomain();