fix security/privacy problem (from ks@ef.purdue.edu (Kirk Smith))
[unix-history] / usr / src / usr.bin / mail / def.h
index f945473..a597628 100644 (file)
@@ -1,6 +1,12 @@
-#
+/*
+ * 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 <sys/types.h>
+#include <sys/param.h>         /* includes <sys/types.h> */
 #include <signal.h>
 #include <stdio.h>
 #include <sgtty.h>
 #include <signal.h>
 #include <stdio.h>
 #include <sgtty.h>
@@ -9,10 +15,6 @@
 #undef isalpha
 #undef isdigit
 
 #undef isalpha
 #undef isdigit
 
-/*
- * Sccs Id = "@(#)def.h        2.10 %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        10            /* 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        LINESIZE        BUFSIZ          /* max readable line width */
 #define        STRINGSIZE      ((unsigned) 128)/* Dynamic allocation units */
 #define        HDRFIELDS       3               /* Number of header fields */
 #define        LINESIZE        BUFSIZ          /* max readable line width */
 #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 */
@@ -217,7 +219,7 @@ struct ignore {
 #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
 
 /*
  * Constants for conditional commands.  These describe whether
@@ -247,6 +249,21 @@ struct ignore {
 #define        sigchild()
 #endif
 
 #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.
  */
@@ -293,7 +310,9 @@ char        *value();
 char   *vcopy();
 char   *yankword();
 off_t  fsize();
 char   *vcopy();
 char   *yankword();
 off_t  fsize();
+#ifndef VMUNIX
 int    (*sigset())();
 int    (*sigset())();
+#endif
 struct cmd     *lex();
 struct grouphead       *findgroup();
 struct name    *cat();
 struct cmd     *lex();
 struct grouphead       *findgroup();
 struct name    *cat();