home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / mailagnt / patch19 < prev    next >
Encoding:
Text File  |  1993-02-04  |  8.3 KB  |  253 lines

  1. Newsgroups: comp.sources.misc
  2. From: ram@eiffel.com (Raphael Manfredi)
  3. Subject: v35i035:  mailagent - Rule Based Mail Filtering, Patch19
  4. Message-ID: <1993Feb5.030749.856@sparky.imd.sterling.com>
  5. X-Md4-Signature: b14b77a43f775197f3c9b0b633ac97c6
  6. Date: Fri, 5 Feb 1993 03:07:49 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: ram@eiffel.com (Raphael Manfredi)
  10. Posting-number: Volume 35, Issue 35
  11. Archive-name: mailagent/patch19
  12. Environment: Perl, Sendmail, UNIX
  13. Patch-To: mailagent: Volume 33, Issue 93-109
  14.  
  15. [The latest patch for mailagent version 2.9 is #19.]
  16.  
  17. System: mailagent version 2.9
  18. Patch #: 19
  19. Priority: HIGH
  20. Subject: undo fix made by previous patch: '-' is NOT allowed
  21. Subject: any '-' in the hostname is now translated into '_' for perl
  22. Subject: documents translation of '-' into '_' within host name
  23. Subject: make sure host name does not have any '-' in it
  24. Date: Wed Feb  3 09:27:01 PST 1993
  25. From: Raphael Manfredi <ram@eiffel.com>
  26.  
  27. Description:
  28.     Undo fix made by previous patch: '-' is NOT allowed in a perl
  29.     variable name, so it is incorrect to allow it in the ~/.mailagent.
  30.     The problem is that some machine name do bear '-' in them. So
  31.     now the filter translates any '-' into '_' and machine specific
  32.     paths must be sepcified with that translation in mind. This
  33.     means if your machine name is 'the-ring', then you must specify
  34.     the PATH for that machine in variable 'p_the_ring'.
  35.  
  36.     Note that only the filter program was modified by this patch.
  37.     Therefore, there is no need to let 'make' perform the full test
  38.     suite if it already passed at patch #18.
  39.  
  40. Repeat-By:
  41.  
  42.     If you machine had a '-' into it, then it did not pass the test
  43.     suite, failing at basic/config for PL < 17 and failing in
  44.     basic/mailagent for PL 18.
  45.  
  46.     Once this patch has been applied, it should pass all the tests.
  47.     Do NOT forget to update the filter program if you had a private
  48.     setuid copy in your own account.
  49.  
  50. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your mailagent source
  51.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  52.     If you don't have the patch program, apply the following by hand,
  53.     or get patch (version 2.0, latest patchlevel).
  54.  
  55.     After patching:
  56.         Configure -d
  57.         make depend
  58.         make
  59.         make install
  60.         make install.man
  61.  
  62.     If patch indicates that patchlevel is the wrong version, you may need
  63.     to apply one or more previous patches, or the patch may already
  64.     have been applied.  See the patchlevel.h file to find out what has or
  65.     has not been applied.  In any event, don't continue with the patch.
  66.  
  67.     If you are missing previous patches they can be obtained from me:
  68.  
  69.         Raphael Manfredi <ram@eiffel.com>
  70.  
  71.     If you send a mail message of the following form it will greatly speed
  72.     processing:
  73.  
  74.         Subject: Command
  75.         @SH mailpatch PATH mailagent 2.9 LIST
  76.                ^ note the c
  77.  
  78.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  79.     or in bang notation from some well-known host, and LIST is the number
  80.     of one or more patches you need, separated by spaces, commas, and/or
  81.     hyphens.  Saying 35- says everything from 35 to the end.
  82.  
  83.     To get some more detailed instructions, send me the following mail:
  84.  
  85.         Subject: Command
  86.         @SH mailhelp PATH
  87.  
  88.  
  89. Index: patchlevel.h
  90. Prereq: 18
  91. 4c4
  92. < #define PATCHLEVEL 18
  93. ---
  94. > #define PATCHLEVEL 19
  95.  
  96. Index: agent/filter/parser.c
  97. Prereq: 2.9.1.4
  98. *** agent/filter/parser.c.old    Wed Feb  3 09:26:43 1993
  99. --- agent/filter/parser.c    Wed Feb  3 09:26:44 1993
  100. ***************
  101. *** 11,17 ****
  102.   */
  103.   
  104.   /*
  105. !  * $Id: parser.c,v 2.9.1.4 93/02/01 09:54:21 ram Exp $
  106.    *
  107.    *  Copyright (c) 1992, Raphael Manfredi
  108.    *
  109. --- 11,17 ----
  110.   */
  111.   
  112.   /*
  113. !  * $Id: parser.c,v 2.9.1.5 93/02/03 09:22:58 ram Exp $
  114.    *
  115.    *  Copyright (c) 1992, Raphael Manfredi
  116.    *
  117. ***************
  118. *** 19,24 ****
  119. --- 19,28 ----
  120.    *  Licence as specified in the README file that comes with dist.
  121.    *
  122.    * $Log:    parser.c,v $
  123. +  * Revision 2.9.1.5  93/02/03  09:22:58  ram
  124. +  * patch19: undo fix made by previous patch: '-' is NOT allowed
  125. +  * patch19: any '-' in the hostname is now translated into '_' for perl
  126. +  * 
  127.    * Revision 2.9.1.4  93/02/01  09:54:21  ram
  128.    * patch17: configuration variables may now have '-' in them
  129.    * 
  130. ***************
  131. *** 398,405 ****
  132.           return;                            /* Ignore it */
  133.   
  134.       while (*nptr++ = *path) {            /* Copy everything until non alphanum */
  135. !         if (*path == '_' || *path == '-') {
  136. !             /* Valid variable characters, although not 'isalnum' */
  137.               path++;
  138.               continue;
  139.           } else if (!isalnum(*path++))    /* Reached a non-alphanumeric char */
  140. --- 402,409 ----
  141.           return;                            /* Ignore it */
  142.   
  143.       while (*nptr++ = *path) {            /* Copy everything until non alphanum */
  144. !         if (*path == '_') {
  145. !             /* Valid variable character, although not 'isalnum' */
  146.               path++;
  147.               continue;
  148.           } else if (!isalnum(*path++))    /* Reached a non-alphanumeric char */
  149. ***************
  150. *** 515,520 ****
  151. --- 519,526 ----
  152.   {
  153.       /* Return a freshly allocated string containing the host name. The string
  154.        * is lower-cased and the domain part is removed from the name.
  155. +      * If any '-' is found in the hostname, it is translated into a '_', since
  156. +      * it would not otherwise be a valid variable name for perl.
  157.        */
  158.       
  159.       char name[MAX_STRING + 1];        /* Constructed name */
  160. ***************
  161. *** 527,534 ****
  162.       while (c = *host) {                /* Lower-case name */
  163.           if (isupper(c))
  164.               *ptr = tolower(c);
  165. !         else
  166.               *ptr = c;
  167.           if (c != '.') {                /* Found a domain delimiter? */
  168.               host++;                    /* No, continue */
  169.               ptr++;
  170. --- 533,543 ----
  171.       while (c = *host) {                /* Lower-case name */
  172.           if (isupper(c))
  173.               *ptr = tolower(c);
  174. !         else {
  175. !             if (c == '-')            /* Although '-' is a valid hostname char */
  176. !                 c = '_';            /* It's not a valid perl variable char */
  177.               *ptr = c;
  178. +         }
  179.           if (c != '.') {                /* Found a domain delimiter? */
  180.               host++;                    /* No, continue */
  181.               ptr++;
  182.  
  183. Index: agent/man/mailagent.SH
  184. Prereq: 2.9.1.9
  185. *** agent/man/mailagent.SH.old    Wed Feb  3 09:26:52 1993
  186. --- agent/man/mailagent.SH    Wed Feb  3 09:26:55 1993
  187. ***************
  188. *** 18,24 ****
  189.   .TH MAILAGENT $manext "Version $VERSION PL$PATCHLEVEL"
  190.   ''' @(#) Manual page for mailagent's filter -- (c) ram February 1991
  191.   '''
  192. ! ''' $Id: mailagent.SH,v 2.9.1.9 93/02/01 10:05:03 ram Exp $
  193.   '''
  194.   '''  Copyright (c) 1991, 1992, Raphael Manfredi
  195.   '''
  196. --- 18,24 ----
  197.   .TH MAILAGENT $manext "Version $VERSION PL$PATCHLEVEL"
  198.   ''' @(#) Manual page for mailagent's filter -- (c) ram February 1991
  199.   '''
  200. ! ''' $Id: mailagent.SH,v 2.9.1.10 93/02/03 09:26:22 ram Exp $
  201.   '''
  202.   '''  Copyright (c) 1991, 1992, Raphael Manfredi
  203.   '''
  204. ***************
  205. *** 26,31 ****
  206. --- 26,34 ----
  207.   '''  License as specified in the README file that comes with dist.
  208.   '''
  209.   ''' $Log:    mailagent.SH,v $
  210. + ''' Revision 2.9.1.10  93/02/03  09:26:22  ram
  211. + ''' patch19: documents translation of '-' into '_' within host name
  212. + ''' 
  213.   ''' Revision 2.9.1.9  93/02/01  10:05:03  ram
  214.   ''' patch17: new configuration variable 'newcmd' for command extensions
  215.   ''' patch17: NOTIFY may now accept a list of addresses instead of just one
  216. ***************
  217. *** 276,282 ****
  218.   be \fIprepended\fR to the default \fIPATH\fR variable supplied by other
  219.   programs. (suggested: /bin:/usr/bin:/usr/ucb). Note that the host name
  220.   must be specified without any domain name appended to it (e.g. for
  221. ! an host name of \fIlyon.eiffel.com\fR, use variable \fIp_lyon\fR).
  222.   .TP
  223.   .I plsave
  224.   Name of the file used to save the patchlevels for archived distributions.
  225. --- 279,287 ----
  226.   be \fIprepended\fR to the default \fIPATH\fR variable supplied by other
  227.   programs. (suggested: /bin:/usr/bin:/usr/ucb). Note that the host name
  228.   must be specified without any domain name appended to it (e.g. for
  229. ! an host name of \fIlyon.eiffel.com\fR, use variable \fIp_lyon\fR). If your
  230. ! host name contains an '-' in it, you must write it as a '_', since '-' is
  231. ! not a valid character for a \fIperl\fR variable name.
  232.   .TP
  233.   .I plsave
  234.   Name of the file used to save the patchlevels for archived distributions.
  235.  
  236. Index: agent/test/basic/config.t
  237. *** agent/test/basic/config.t.old    Wed Feb  3 09:26:59 1993
  238. --- agent/test/basic/config.t    Wed Feb  3 09:26:59 1993
  239. ***************
  240. *** 5,10 ****
  241. --- 5,11 ----
  242.   chop($pwd = `pwd`);
  243.   $path = $ENV{'PATH'};
  244.   $host = $ENV{'HOST'};
  245. + $host =~ s/-/_/g;        # Filter translates '-' into '_' in hostnames
  246.   $user = $ENV{'USER'};
  247.   open(CONFIG, ">.mailagent") || print "1\n";
  248.   print CONFIG <<EOF;
  249.  
  250. *** End of Patch 19 ***
  251.  
  252. exit 0 # Just in case...
  253.