home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 0 / 0984 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  5.1 KB

  1. From: lenny@icus.ICUS.COM (Lenny Tropiano)
  2. Newsgroups: unix-pc.bugs,alt.sources
  3. Subject: Patch to reroute(1) [HDB uucp rmail job rerouter] Version 1.3
  4. Message-ID: <1117@icus.ICUS.COM>
  5. Date: 6 Mar 90 02:44:42 GMT
  6.  
  7. Prequisite: Reroute Version 1.2
  8.  
  9. This patch will bring the reroute program up to version 1.3, basically
  10. a bug fix was reported that it will break filenames that are exactly 14
  11. characters on SYSV machines because the DIR entry will not be null
  12. terminated.   Also a chdir() was added to decrease search time.
  13.  
  14. -- cut here -- -- cut here -- -- cut here -- -- cut here -- -- cut here --
  15.  
  16. *** 1.2/reroute.c    Tue Nov  7 19:13:28 1989
  17. --- 1.3/reroute.c    Mon Mar  5 21:40:41 1990
  18. ***************
  19. *** 2,8
  20.   **                                                                      **
  21.   ** Program name:    reroute.c (Reroute rmail uux jobs to another node)  **
  22.   ** Programmer:      Lenny Tropiano                                      **
  23. ! ** E-Mail address:  ...!icus!lenny -or- lenny@icus.islp.ny.us           **
  24.   ** Organization:    ICUS Software Systems     (c)1989                   **
  25.   ** Date:            November 5, 1989  [Version 1.0]                     **
  26.   ** Patchlevel:      November 6, 1989  [Version 1.1]                     **
  27.  
  28. --- 2,8 -----
  29.   **                                                                      **
  30.   ** Program name:    reroute.c (Reroute rmail uux jobs to another node)  **
  31.   ** Programmer:      Lenny Tropiano                                      **
  32. ! ** E-Mail address:  ...!icus!lenny -or- lenny@icus.ICUS.COM             **
  33.   ** Organization:    ICUS Software Systems     (c)1989                   **
  34.   ** Date:            November 5, 1989  [Version 1.0]                     **
  35.   ** Patchlevel:      November 6, 1989  [Version 1.1]                     **
  36. ***************
  37. *** 10,15
  38.   **                  wasn't stat()'ing the full path of the directory,   **
  39.   **                  in find_path().                                     **
  40.   **                  Reported by Lee Ziegenhals (lcz@sat.datapoint.com)  **
  41.   **                                                                      **
  42.   **************************************************************************
  43.   **                                                                      **
  44.  
  45. --- 10,23 -----
  46.   **                  wasn't stat()'ing the full path of the directory,   **
  47.   **                  in find_path().                                     **
  48.   **                  Reported by Lee Ziegenhals (lcz@sat.datapoint.com)  **
  49. + ** Patchlevel:      March 5, 1990     [Version 1.3]: bug fix where on   **
  50. + **                  System V machines, filenames that are exactly 14    **
  51. + **                  characters does break the strcmp() function because **
  52. + **                  of no "NULL" termination, this was changed to a     **
  53. + **                  strncmp() with a strlen(of the file in question).   **
  54. + **                  For performance, a chdir() to the UUCPSPOOL         **
  55. + **                  directory was added -- making search time minimal.  **
  56. + **                  Reported by Dave Rand (dlr@daver.bungi.com)         **
  57.   **                                                                      **
  58.   **************************************************************************
  59.   **                                                                      **
  60. ***************
  61. *** 59,66
  62.       int    c, 
  63.           badpath = 0,        /* bad -p option        */
  64.           error_flg = 0;        /* some error on argv        */
  65. !     char    *jobid,            /* job id to be rerouted    */
  66. !         *newpath,        /* new path to be reroute to    */
  67.           *strchr(),
  68.           qsystem[SYSLEN];    /* system name for uux        */
  69.       void    reroute(),
  70.  
  71. --- 67,74 -----
  72.       int    c, 
  73.           badpath = 0,        /* bad -p option        */
  74.           error_flg = 0;        /* some error on argv        */
  75. !     char    *jobid = NULL,        /* job id to be rerouted    */
  76. !         *newpath = NULL,    /* new path to be reroute to    */
  77.           *strchr(),
  78.           qsystem[SYSLEN];    /* system name for uux        */
  79.       void    reroute(),
  80. ***************
  81. *** 173,179
  82.       void    copy_to();
  83.   
  84.       sprintf(jobfile,"C.%s",jobid);
  85. !     if ((directory = find_path(UUCP_SPOOL,jobfile)) == (char *)NULL) {
  86.           printf("%s: no uucp job with id: %s\n", progname, jobid);
  87.           exit(0);
  88.       }
  89.  
  90. --- 181,193 -----
  91.       void    copy_to();
  92.   
  93.       sprintf(jobfile,"C.%s",jobid);
  94. !     if (chdir(UUCP_SPOOL)) {
  95. !         fprintf(stderr,"%s: can't change directory to %s.\n",
  96. !             progname, UUCP_SPOOL);
  97. !         perror("chdir()");
  98. !         exit(1);
  99. !     }
  100. !     if ((directory = find_path(".",jobfile)) == (char *)NULL) {
  101.           printf("%s: no uucp job with id: %s\n", progname, jobid);
  102.           exit(0);
  103.       }
  104. ***************
  105. *** 378,384
  106.                       (char *)NULL) 
  107.                       return(retdir);
  108.               } 
  109. !             if (strcmp(dentry->d_name,file) == 0) 
  110.                   return(dirname);
  111.           }
  112.       }
  113.  
  114. --- 392,398 -----
  115.                       (char *)NULL) 
  116.                       return(retdir);
  117.               } 
  118. !             if (strncmp(dentry->d_name,file,strlen(file)) == 0) 
  119.                   return(dirname);
  120.           }
  121.       }
  122. ***************
  123. *** 387,389
  124.       return((char *)NULL);
  125.   
  126.   }
  127.  
  128. --- 401,404 -----
  129.       return((char *)NULL);
  130.   
  131.   }
  132. -- 
  133. | Lenny Tropiano           ICUS Software Systems        lenny@icus.ICUS.COM |
  134. | {ames,pacbell,decuac,sbcs,hombre,rayssd}!icus!lenny   attmail!icus!lenny  |
  135. +------ ICUS Software Systems --  PO Box 1;  Islip Terrace, NY  11752 ------+
  136.