home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / kit / pch27 < prev    next >
Encoding:
Text File  |  1993-05-04  |  31.5 KB  |  1,172 lines

  1. Newsgroups: comp.sources.unix
  2. From: ram@acri.fr (Raphael Manfredi)
  3. Subject: v26i233: kit - the ultimate mailing kit, Patch27
  4. Sender: unix-sources-moderator@efficacy.home.vix.com
  5. Approved: WhoAmI@efficacy.home.vix.com
  6.  
  7. Submitted-By: ram@acri.fr (Raphael Manfredi)
  8. Posting-Number: Volume 26, Issue 233
  9. Archive-Name: kit/pch27
  10.  
  11. [The latest patch for kit version 2.0 is #28.]
  12.  
  13. System: kit version 2.0
  14. Patch #: 27
  15. Priority: MEDIUM
  16. Subject: updated Copyright dates and my e-mail address
  17. Subject: dependency with cshar not needed any more
  18. Subject: manual page name was mis-spelled BABTAR
  19. Subject: added support for 64 bits architecture (tested on Alpha)
  20. Subject: do not use cshar's makekit any more but use our own archiver
  21. Subject: copyright dates updated
  22. Subject: added support for kit's own archiver variables
  23. Subject: will now skip leading comments in kit parts (when concatenated)
  24. Subject: updated copyright dates
  25. Subject: cshar(1) man page not referenced any more.
  26. Subject: now contains a pointer to some unshar(1) man page
  27. Date: Mon Apr 26 13:22:47 MET DST 1993
  28. From: Raphael Manfredi <ram@eiffel.com>
  29.  
  30. Description:
  31.     Updated Copyright dates and my e-mail address which is now
  32.     <ram@acri.fr>.
  33.  
  34.     Dependency with cshar not needed any more. Kit's own shell archiver
  35.     (written in shell scripts) is now always used. The cshar makekit
  36.     program apparently has a nasty bug which sometimes makes it spit an
  37.     extra empty leading part which then confuses unkit.
  38.  
  39.     Manual page name for badtar was mis-spelled BABTAR.
  40.  
  41.     Added support for 64 bits architecture (tested on Alpha).
  42.  
  43.     Added support for kit's own archiver variables in the 'secure'
  44.     script. Until now, it only understood cshar's variable.
  45.  
  46.     Will now skip leading comments in kit parts (when concatenated), but
  47.     is still looking for "naughty" characters after a leading '>> ' so
  48.     that nobody can defeat this check with a '>> something && command'.
  49.     If that introduces a security hole I am not aware of, please let me
  50.     know.
  51.  
  52.  
  53. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your kit source
  54.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  55.     If you don't have the patch program, apply the following by hand,
  56.     or get patch (version 2.0, latest patchlevel).
  57.  
  58.     After patching:
  59.         Configure -d
  60.         make
  61.         make install
  62.  
  63.     If patch indicates that patchlevel is the wrong version, you may need
  64.     to apply one or more previous patches, or the patch may already
  65.     have been applied.  See the patchlevel.h file to find out what has or
  66.     has not been applied.  In any event, don't continue with the patch.
  67.  
  68.     If you are missing previous patches they can be obtained from me:
  69.  
  70.         Raphael Manfredi <ram@acri.fr>
  71.  
  72.     If you send a mail message of the following form it will greatly speed
  73.     processing:
  74.  
  75.         Subject: Command
  76.         @SH mailpatch PATH kit 2.0 LIST
  77.                ^ note the c
  78.  
  79.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  80.     or in bang notation from some well-known host, and LIST is the number
  81.     of one or more patches you need, separated by spaces, commas, and/or
  82.     hyphens.  Saying 35- says everything from 35 to the end.
  83.  
  84.     To get some more detailed instructions, send me the following mail:
  85.  
  86.         Subject: Command
  87.         @SH mailhelp PATH
  88.  
  89.  
  90. Index: patchlevel.h
  91. Prereq: 26
  92. 2c2
  93. < #define PATCHLEVEL 26
  94. ---
  95. > #define PATCHLEVEL 27
  96.  
  97. Index: des/des.c
  98. Prereq: 2.0.1.2
  99. *** des/des.c.old    1992/01/11 19:15:41
  100. --- des/des.c    1993/04/26 11:18:34
  101. ***************
  102. *** 4,16 ****
  103.    */
  104.   
  105.   /*
  106. !  * $Id: des.c,v 2.0.1.2 92/01/11 19:15:41 ram Exp $
  107.    *
  108.    * $Log: des.c,v $
  109. !  * Revision 2.0.1.2  92/01/11  19:15:41  ram
  110.    * patch11: added declarations for static functions
  111.    * patch11: reported by Monty Solomon <roscom!monty@bu.edu>
  112. !  *
  113.    * Revision 2.0.1.1  91/04/01  15:39:35  ram
  114.    * patch1: created
  115.    * 
  116. --- 4,19 ----
  117.    */
  118.   
  119.   /*
  120. !  * $Id: des.c,v 2.0.1.3 1993/04/26 11:18:34 ram Exp $
  121.    *
  122.    * $Log: des.c,v $
  123. !  * Revision 2.0.1.3  1993/04/26  11:18:34  ram
  124. !  * patch27: added support for 64 bits architecture (tested on Alpha)
  125. !  *
  126. !  * Revision 2.0.1.2  92/01/11  19:15:41  ram
  127.    * patch11: added declarations for static functions
  128.    * patch11: reported by Monty Solomon <roscom!monty@bu.edu>
  129. !  * 
  130.    * Revision 2.0.1.1  91/04/01  15:39:35  ram
  131.    * patch1: created
  132.    * 
  133. ***************
  134. *** 20,31 ****
  135.   
  136.   #include "../config.h"
  137.   
  138.   #if BYTEORDER == 0x1234
  139.   #define LITTLE_ENDIAN
  140.   #endif
  141.   
  142. ! #ifdef    LITTLE_ENDIAN
  143. ! unsigned long byteswap();
  144.   #endif
  145.   
  146.   /* Tables defined in the Data Encryption Standard documents */
  147. --- 23,49 ----
  148.   
  149.   #include "../config.h"
  150.   
  151. + /* Provision for 64 bits machines -> remaps long to int. If the machine is
  152. +  * ILP 64 (Integer, Long and Pointer types on 64 bits), then everything is fine,
  153. +  * since both longs and ints can be used. If the machine is LP 64, then it has
  154. +  * a 32 bits arithmetic and long must be used as an int.
  155. +  */
  156. + #if (BYTEORDER | 0xffff) == 0xffff
  157. + typedef long long_t;            /* 32 bits machines */
  158. + typedef unsigned long ulong_t;
  159.   #if BYTEORDER == 0x1234
  160.   #define LITTLE_ENDIAN
  161.   #endif
  162. + #else
  163. + typedef int long_t;                /* 64 bits, hopefully */
  164. + typedef unsigned int ulong_t;
  165. + #if BYTEORDER & 0x1234ffff
  166. + #define LITTLE_ENDIAN
  167. + #endif
  168. + #endif
  169.   
  170. ! #ifdef LITTLE_ENDIAN
  171. ! ulong_t byteswap();
  172.   #endif
  173.   
  174.   /* Tables defined in the Data Encryption Standard documents */
  175. ***************
  176. *** 166,172 ****
  177.   /* End of DES-defined tables */
  178.   
  179.   /* Lookup tables initialized once only at startup by desinit() */
  180. ! static long (*sp)[64];        /* Combined S and P boxes */
  181.   
  182.   static char (*iperm)[16][8];    /* Initial and final permutations */
  183.   static char (*fperm)[16][8];
  184. --- 184,190 ----
  185.   /* End of DES-defined tables */
  186.   
  187.   /* Lookup tables initialized once only at startup by desinit() */
  188. ! static long_t (*sp)[64];        /* Combined S and P boxes */
  189.   
  190.   static char (*iperm)[16][8];    /* Initial and final permutations */
  191.   static char (*fperm)[16][8];
  192. ***************
  193. *** 187,193 ****
  194.   /* Declare static functions */
  195.   static permute();
  196.   static round();
  197. ! static long f();
  198.   static perminit();
  199.   static int spinit();
  200.   
  201. --- 205,211 ----
  202.   /* Declare static functions */
  203.   static permute();
  204.   static round();
  205. ! static long_t f();
  206.   static perminit();
  207.   static int spinit();
  208.   
  209. ***************
  210. *** 208,214 ****
  211.       }
  212.       desmode = mode;
  213.       
  214. !     if((sp = (long (*)[64])malloc(sizeof(long) * 8 * 64)) == NULL){
  215.           return -1;
  216.       }
  217.       spinit();
  218. --- 226,232 ----
  219.       }
  220.       desmode = mode;
  221.       
  222. !     if((sp = (long_t (*)[64])malloc(sizeof(long_t) * 8 * 64)) == NULL){
  223.           return -1;
  224.       }
  225.       spinit();
  226. ***************
  227. *** 311,318 ****
  228.   char *block;
  229.   {
  230.       register int i;
  231. !     unsigned long work[2];         /* Working data storage */
  232. !     long tmp;
  233.   
  234.       permute(block,iperm,(char *)work);    /* Initial Permutation */
  235.   #ifdef LITTLE_ENDIAN
  236. --- 329,336 ----
  237.   char *block;
  238.   {
  239.       register int i;
  240. !     ulong_t work[2];         /* Working data storage */
  241. !     long_t tmp;
  242.   
  243.       permute(block,iperm,(char *)work);    /* Initial Permutation */
  244.   #ifdef LITTLE_ENDIAN
  245. ***************
  246. *** 340,347 ****
  247.   char *block;
  248.   {
  249.       register int i;
  250. !     unsigned long work[2];    /* Working data storage */
  251. !     long tmp;
  252.   
  253.       permute(block,iperm,(char *)work);    /* Initial permutation */
  254.   
  255. --- 358,365 ----
  256.   char *block;
  257.   {
  258.       register int i;
  259. !     ulong_t work[2];    /* Working data storage */
  260. !     long_t tmp;
  261.   
  262.       permute(block,iperm,(char *)work);    /* Initial permutation */
  263.   
  264. ***************
  265. *** 402,410 ****
  266.   static
  267.   round(num,block)
  268.   int num;                /* i.e. the num-th one     */
  269. ! unsigned long *block;
  270.   {
  271. !     long f();
  272.   
  273.       /* The rounds are numbered from 0 to 15. On even rounds
  274.        * the right half is fed to f() and the result exclusive-ORs
  275. --- 420,428 ----
  276.   static
  277.   round(num,block)
  278.   int num;                /* i.e. the num-th one     */
  279. ! ulong_t *block;
  280.   {
  281. !     long_t f();
  282.   
  283.       /* The rounds are numbered from 0 to 15. On even rounds
  284.        * the right half is fed to f() and the result exclusive-ORs
  285. ***************
  286. *** 418,429 ****
  287.   }
  288.   /* The nonlinear function f(r,k), the heart of DES */
  289.   static
  290. ! long
  291.   f(r,subkey)
  292. ! unsigned long r;        /* 32 bits */
  293.   unsigned char subkey[8];    /* 48-bit key for this round */
  294.   {
  295. !     register unsigned long rval,rt;
  296.   #ifdef    TRACE
  297.       unsigned char *cp;
  298.       int i;
  299. --- 436,447 ----
  300.   }
  301.   /* The nonlinear function f(r,k), the heart of DES */
  302.   static
  303. ! long_t
  304.   f(r,subkey)
  305. ! ulong_t r;        /* 32 bits */
  306.   unsigned char subkey[8];    /* 48-bit key for this round */
  307.   {
  308. !     register ulong_t rval,rt;
  309.   #ifdef    TRACE
  310.       unsigned char *cp;
  311.       int i;
  312. ***************
  313. *** 489,495 ****
  314.   {
  315.       char pbox[32];
  316.       int p,i,s,j,rowcol;
  317. !     long val;
  318.   
  319.       /* Compute pbox, the inverse of p32i.
  320.        * This is easier to work with
  321. --- 507,513 ----
  322.   {
  323.       char pbox[32];
  324.       int p,i,s,j,rowcol;
  325. !     long_t val;
  326.   
  327.       /* Compute pbox, the inverse of p32i.
  328.        * This is easier to work with
  329. ***************
  330. *** 525,533 ****
  331.   #ifdef    LITTLE_ENDIAN
  332.   /* Byte swap a long */
  333.   static
  334. ! unsigned long
  335.   byteswap(x)
  336. ! unsigned long x;
  337.   {
  338.       register char *cp,tmp;
  339.   
  340. --- 543,551 ----
  341.   #ifdef    LITTLE_ENDIAN
  342.   /* Byte swap a long */
  343.   static
  344. ! ulong_t
  345.   byteswap(x)
  346. ! ulong_t x;
  347.   {
  348.       register char *cp,tmp;
  349.   
  350.  
  351. Index: btoa/atob.c
  352. Prereq: 2.0
  353. *** btoa/atob.c.old    1991/02/19 15:49:21
  354. --- btoa/atob.c    1993/04/26 11:18:01
  355. ***************
  356. *** 15,45 ****
  357.   
  358.       Raphael Manfredi (ram) modified this file, in order to produce
  359.       meaningfull error messages (otherwise, fatal() was called, even
  360. !     when a temporary file could not be created...); added error()
  361.   */
  362.   
  363.   /*
  364. !  * $Id: atob.c,v 2.0 1991/02/19 15:49:21 ram Exp $
  365.    *
  366.    * $Log: atob.c,v $
  367. !  * Revision 2.0  1991/02/19  15:49:21  ram
  368. !  * Baseline for first official release.
  369.    *
  370.    */
  371.   
  372.   #include <stdio.h>
  373.   
  374.   #define reg register
  375.   
  376.   #define streq(s0, s1)  strcmp(s0, s1) == 0
  377.   
  378.   #define times85(x)    ((((((x<<2)+x)<<2)+x)<<2)+x)
  379.   
  380. ! long int Ceor = 0;
  381. ! long int Csum = 0;
  382. ! long int Crot = 0;
  383. ! long int word = 0;
  384. ! long int bcount = 0;
  385.   
  386.   fatal() {
  387.     fprintf(stderr, "bad format or Csum to atob\n");
  388. --- 15,62 ----
  389.   
  390.       Raphael Manfredi (ram) modified this file, in order to produce
  391.       meaningfull error messages (otherwise, fatal() was called, even
  392. !     when a temporary file could not be created...); added error().
  393. !     RAM also added support for 64 bits platforms.
  394.   */
  395.   
  396.   /*
  397. !  * $Id: atob.c,v 2.0.1.1 1993/04/26 11:18:01 ram Exp $
  398.    *
  399.    * $Log: atob.c,v $
  400. !  * Revision 2.0.1.1  1993/04/26  11:18:01  ram
  401. !  * patch27: added support for 64 bits architecture (tested on Alpha)
  402.    *
  403. +  * Revision 2.0  91/02/19  15:49:21  ram
  404. +  * Baseline for first official release.
  405. +  * 
  406.    */
  407.   
  408.   #include <stdio.h>
  409. + #include "../config.h"
  410.   
  411. + /* Provision for 64 bits machines -> remaps long to int. If the machine is
  412. +  * ILP 64 (Integer, Long and Pointer types on 64 bits), then everything is fine,
  413. +  * since both longs and ints can be used. If the machine is LP 64, then it has
  414. +  * a 32 bits arithmetic and long must be used as an int.
  415. +  */
  416. + #if (BYTEORDER | 0xffff) == 0xffff
  417. + typedef long long_t;            /* 32 bits machines */
  418. + #else
  419. + typedef int long_t;                /* 64 bits, hopefully */
  420. + #endif
  421.   #define reg register
  422.   
  423.   #define streq(s0, s1)  strcmp(s0, s1) == 0
  424.   
  425.   #define times85(x)    ((((((x<<2)+x)<<2)+x)<<2)+x)
  426.   
  427. ! long_t Ceor = 0;
  428. ! long_t Csum = 0;
  429. ! long_t Crot = 0;
  430. ! long_t word = 0;
  431. ! long_t bcount = 0;
  432.   
  433.   fatal() {
  434.     fprintf(stderr, "bad format or Csum to atob\n");
  435. ***************
  436. *** 74,89 ****
  437.         ++bcount;
  438.       } 
  439.       else if (bcount < 4) {
  440. !       word = times85(word);
  441.         word += DE(c);
  442.         ++bcount;
  443.       } 
  444.       else {
  445. !       word = times85(word) + DE(c);
  446. !       byteout((int)((word >> 24) & 255));
  447. !       byteout((int)((word >> 16) & 255));
  448. !       byteout((int)((word >> 8) & 255));
  449. !       byteout((int)(word & 255));
  450.         word = 0;
  451.         bcount = 0;
  452.       }
  453. --- 91,106 ----
  454.         ++bcount;
  455.       } 
  456.       else if (bcount < 4) {
  457. !       word = times85((int) word);
  458.         word += DE(c);
  459.         ++bcount;
  460.       } 
  461.       else {
  462. !       word = times85((int) word) + DE(c);
  463. !       byteout((int)(((int) word >> 24) & 255));
  464. !       byteout((int)(((int) word >> 16) & 255));
  465. !       byteout((int)(((int) word >> 8) & 255));
  466. !       byteout((int)((int) word & 255));
  467.         word = 0;
  468.         bcount = 0;
  469.       }
  470. ***************
  471. *** 100,106 ****
  472.     Ceor ^= c;
  473.     Csum += c;
  474.     Csum += 1;
  475. !   if ((Crot & 0x80000000)) {
  476.       Crot <<= 1;
  477.       Crot += 1;
  478.     } 
  479. --- 117,123 ----
  480.     Ceor ^= c;
  481.     Csum += c;
  482.     Csum += 1;
  483. !   if (Crot & 0x80000000) {
  484.       Crot <<= 1;
  485.       Crot += 1;
  486.     } 
  487. ***************
  488. *** 114,123 ****
  489.   main(argc, argv) char **argv;
  490.   {
  491.     reg c;
  492. !   reg long int i;
  493.     char tmp_name[100];
  494.     char buf[100];
  495. !   long int n1, n2, oeor, osum, orot;
  496.   
  497.     if (argc != 1) {
  498.       fprintf(stderr,"bad args to %s\n", argv[0]);
  499. --- 131,140 ----
  500.   main(argc, argv) char **argv;
  501.   {
  502.     reg c;
  503. !   reg long_t i;
  504.     char tmp_name[100];
  505.     char buf[100];
  506. !   long_t n1, n2, oeor, osum, orot;
  507.   
  508.     if (argc != 1) {
  509.       fprintf(stderr,"bad args to %s\n", argv[0]);
  510. ***************
  511. *** 150,160 ****
  512.         decode(c);
  513.       }
  514.     }
  515. !   if (scanf("btoa End N %ld %lx E %lx S %lx R %lx\n", &n1, &n2, &oeor, &osum, &orot) != 5) {
  516.       error("could not read check sum");
  517.     }
  518.     if ((n1 != n2) || (oeor != Ceor) || (osum != Csum) || (orot != Crot)) {
  519. !     fatal();
  520.     } 
  521.     else {
  522.       /*copy OK tmp file to stdout*/;
  523. --- 167,181 ----
  524.         decode(c);
  525.       }
  526.     }
  527. !   if (scanf("btoa End N %d %x E %x S %x R %x\n", &n1, &n2, &oeor, &osum, &orot) != 5) {
  528.       error("could not read check sum");
  529.     }
  530.     if ((n1 != n2) || (oeor != Ceor) || (osum != Csum) || (orot != Crot)) {
  531. !     fprintf(stderr, "n1: %d, n2: %d\n", n1, n2);
  532. !     fprintf(stderr, "oeor: %d, Ceor %d\n", oeor, Ceor);
  533. !     fprintf(stderr, "osum: %d, Csum %d\n", osum, Csum);
  534. !     fprintf(stderr, "orot: %d, Crot %d\n", orot, Crot);
  535. !     error("check sum did not match original");
  536.     } 
  537.     else {
  538.       /*copy OK tmp file to stdout*/;
  539.  
  540. Index: kit/kit.SH
  541. Prereq: 2.0.1.13
  542. *** kit/kit.SH.old    1993/01/11 18:06:46
  543. --- kit/kit.SH    1993/04/26 11:19:14
  544. ***************
  545. *** 17,23 ****
  546.   $startsh
  547.   # @(#) converts to ascii && packages a whole directory
  548.   # @(#) (c) E. Mogenet April, 1990
  549. ! # @(#) (c) R. Manfredi, 1990 1991
  550.   
  551.   # Which patch-level is it ?
  552.   pl='$PATCHLEVEL'
  553. --- 17,23 ----
  554.   $startsh
  555.   # @(#) converts to ascii && packages a whole directory
  556.   # @(#) (c) E. Mogenet April, 1990
  557. ! # @(#) (c) R. Manfredi, 1990-1993
  558.   
  559.   # Which patch-level is it ?
  560.   pl='$PATCHLEVEL'
  561. ***************
  562. *** 26,37 ****
  563.   !GROK!THIS!
  564.   $spitshell >>kit <<'!NO!SUBS!'
  565.   
  566. ! # $Id: kit.SH,v 2.0.1.13 93/01/11 18:06:46 ram Exp $
  567.   #
  568.   # $Log: kit.SH,v $
  569. ! # Revision 2.0.1.13  93/01/11  18:06:46  ram
  570. ! # patch22: now uses external getopt script for option parsing
  571.   #
  572.   # Revision 2.0.1.12  92/11/03  10:12:34  ram
  573.   # patch21: option parsing can now deal with embeded spaces in arguments
  574.   # 
  575. --- 26,40 ----
  576.   !GROK!THIS!
  577.   $spitshell >>kit <<'!NO!SUBS!'
  578.   
  579. ! # $Id: kit.SH,v 2.0.1.14 1993/04/26 11:19:14 ram Exp $
  580.   #
  581.   # $Log: kit.SH,v $
  582. ! # Revision 2.0.1.14  1993/04/26  11:19:14  ram
  583. ! # patch27: do not use cshar's makekit any more but use our own archiver
  584.   #
  585. + # Revision 2.0.1.13  93/01/11  18:06:46  ram
  586. + # patch22: now uses external getopt script for option parsing
  587. + # 
  588.   # Revision 2.0.1.12  92/11/03  10:12:34  ram
  589.   # patch21: option parsing can now deal with embeded spaces in arguments
  590.   # 
  591. ***************
  592. *** 347,358 ****
  593.   "
  594.   fi
  595.   
  596. ! # Check whether we can use cshar or not
  597. ! if (makekit -v) >/dev/null 2>&1; then
  598. !     makekit="makekit -k100 -s $maxsize -n $partname ${split_file}* $others"
  599. ! else
  600. !     makekit="$libdir/makeshar -s $maxsize -n $partname ${split_file}* $others"
  601. ! fi
  602.   
  603.   echo "Coding with $coding"
  604.   # Beware: 'eval $coding < $tmpfile' is not portable
  605. --- 350,359 ----
  606.   "
  607.   fi
  608.   
  609. ! # Kit used to use cshar's makekit program when available but due to a
  610. ! # really strange bug when packing some files (leading to a blank archive #1),
  611. ! # kit's own archiving program is now always used.
  612. ! makekit="$libdir/makeshar -s $maxsize -n $partname ${split_file}* $others"
  613.   
  614.   echo "Coding with $coding"
  615.   # Beware: 'eval $coding < $tmpfile' is not portable
  616.  
  617. Index: man/kit.SH
  618. Prereq: 2.0.1.12
  619. *** man/kit.SH.old    1993/02/08 18:14:56
  620. --- man/kit.SH    1993/04/26 11:22:28
  621. ***************
  622. *** 18,30 ****
  623.   .TH KIT $manext "Version $VERSION PL$PATCHLEVEL"
  624.   ''' @(#) Manual page for mailing kit -- (c) ram July 1990
  625.   '''
  626. ! ''' $Id: kit.SH,v 2.0.1.12 93/02/08 18:14:56 ram Exp $
  627.   '''
  628.   ''' $Log: kit.SH,v $
  629. ! ''' Revision 2.0.1.12  93/02/08  18:14:56  ram
  630.   ''' patch24: documents new options -d, -s and -S for unkit
  631.   ''' patch24: new file 'secure' installed in private library
  632. ! '''
  633.   ''' Revision 2.0.1.11  93/01/11  18:08:33  ram
  634.   ''' patch22: manual page now carries version number and patchlevel
  635.   ''' patch22: added OPTIONS section for quick reference
  636. --- 18,34 ----
  637.   .TH KIT $manext "Version $VERSION PL$PATCHLEVEL"
  638.   ''' @(#) Manual page for mailing kit -- (c) ram July 1990
  639.   '''
  640. ! ''' $Id: kit.SH,v 2.0.1.13 1993/04/26 11:22:28 ram Exp $
  641.   '''
  642.   ''' $Log: kit.SH,v $
  643. ! ''' Revision 2.0.1.13  1993/04/26  11:22:28  ram
  644. ! ''' patch27: cshar(1) man page not referenced any more.
  645. ! ''' patch27: now contains a pointer to some unshar(1) man page
  646. ! '''
  647. ! ''' Revision 2.0.1.12  93/02/08  18:14:56  ram
  648.   ''' patch24: documents new options -d, -s and -S for unkit
  649.   ''' patch24: new file 'secure' installed in private library
  650. ! ''' 
  651.   ''' Revision 2.0.1.11  93/01/11  18:08:33  ram
  652.   ''' patch22: manual page now carries version number and patchlevel
  653.   ''' patch22: added OPTIONS section for quick reference
  654. ***************
  655. *** 579,587 ****
  656.   although the acknowledgment feature itself will only be handled by 2.0 PL15 and
  657.   later versions.
  658.   .SH "SEE ALSO"
  659. ! atob($manext), btoa($manext), cshar(1), makekit(1).
  660.   .SH AUTHOR
  661. ! Raphael Manfredi <ram@eiffel.com>.
  662.   
  663.   \fIKit\fR was first developed at the Ecole des Mines, Saint-Etienne,
  664.   France. Many improvements were added at Interactive Software
  665. --- 583,591 ----
  666.   although the acknowledgment feature itself will only be handled by 2.0 PL15 and
  667.   later versions.
  668.   .SH "SEE ALSO"
  669. ! atob($manext), btoa($manext), unshar(1), makekit(1).
  670.   .SH AUTHOR
  671. ! Raphael Manfredi <ram@acri.fr>.
  672.   
  673.   \fIKit\fR was first developed at the Ecole des Mines, Saint-Etienne,
  674.   France. Many improvements were added at Interactive Software
  675.  
  676. Index: btoa/btoa.c
  677. Prereq: 2.0
  678. *** btoa/btoa.c.old    1991/02/19 15:49:25
  679. --- btoa/btoa.c    1993/04/26 11:18:21
  680. ***************
  681. *** 16,45 ****
  682.       'z' encodes 32-bit zero; 'x' is used to mark the end of encoded data.
  683.   
  684.       Paul Rutter Joe Orost
  685.   */
  686.   
  687.   /*
  688. !  * $Id: btoa.c,v 2.0 1991/02/19 15:49:25 ram Exp $
  689.    *
  690.    * $Log: btoa.c,v $
  691. !  * Revision 2.0  1991/02/19  15:49:25  ram
  692. !  * Baseline for first official release.
  693.    *
  694.    */
  695.   
  696.   #include <stdio.h>
  697.   
  698.   #define reg register
  699.   
  700.   #define MAXPERLINE 78
  701.   
  702. ! long int Ceor = 0;
  703. ! long int Csum = 0;
  704. ! long int Crot = 0;
  705. ! long int ccount = 0;
  706. ! long int bcount = 0;
  707. ! long int word;
  708.   
  709.   #define EN(c)    (int) ((c) + '!')
  710.   
  711. --- 16,63 ----
  712.       'z' encodes 32-bit zero; 'x' is used to mark the end of encoded data.
  713.   
  714.       Paul Rutter Joe Orost
  715. +     Raphael Manfredi added support for 64 bits platforms.
  716.   */
  717.   
  718.   /*
  719. !  * $Id: btoa.c,v 2.0.1.1 1993/04/26 11:18:21 ram Exp $
  720.    *
  721.    * $Log: btoa.c,v $
  722. !  * Revision 2.0.1.1  1993/04/26  11:18:21  ram
  723. !  * patch27: added support for 64 bits architecture (tested on Alpha)
  724.    *
  725. +  * Revision 2.0  91/02/19  15:49:25  ram
  726. +  * Baseline for first official release.
  727. +  * 
  728.    */
  729.   
  730.   #include <stdio.h>
  731. + #include "../config.h"
  732. + /* Provision for 64 bits machines -> remaps long to int. If the machine is
  733. +  * ILP 64 (Integer, Long and Pointer types on 64 bits), then everything is fine,
  734. +  * since both longs and ints can be used. If the machine is LP 64, then it has
  735. +  * a 32 bits arithmetic and long must be used as an int.
  736. +  */
  737. + #if (BYTEORDER | 0xffff) == 0xffff
  738. + typedef long long_t;            /* 32 bits machines */
  739. + #else
  740. + typedef int long_t;                /* 64 bits, hopefully */
  741. + #endif
  742.   
  743.   #define reg register
  744.   
  745.   #define MAXPERLINE 78
  746.   
  747. ! long_t Ceor = 0;
  748. ! long_t Csum = 0;
  749. ! long_t Crot = 0;
  750. ! long_t ccount = 0;
  751. ! long_t bcount = 0;
  752. ! long_t word;
  753.   
  754.   #define EN(c)    (int) ((c) + '!')
  755.   
  756. ***************
  757. *** 48,54 ****
  758.     Ceor ^= c;
  759.     Csum += c;
  760.     Csum += 1;
  761. !   if ((Crot & 0x80000000)) {
  762.       Crot <<= 1;
  763.       Crot += 1;
  764.     } 
  765. --- 66,72 ----
  766.     Ceor ^= c;
  767.     Csum += c;
  768.     Csum += 1;
  769. !   if (Crot & 0x80000000) {
  770.       Crot <<= 1;
  771.       Crot += 1;
  772.     } 
  773. ***************
  774. *** 68,92 ****
  775.     }
  776.   }
  777.   
  778. ! wordout(word) reg long int word;
  779.   {
  780.     if (word == 0) {
  781.       charout('z');
  782.     } 
  783.     else {
  784. !     reg int tmp = 0;
  785.   
  786.       if (word < 0)
  787.       { /* Because some don't support unsigned long */
  788.         tmp = 32;
  789. !       word = word - (long)(85 * 85 * 85 * 85 * 32);
  790.       }
  791.       if (word < 0) {
  792.         tmp = 64;
  793. !       word = word - (long)(85 * 85 * 85 * 85 * 32);
  794.       }
  795. !     charout(EN((word / (long)(85 * 85 * 85 * 85)) + tmp));
  796. !     word %= (long)(85 * 85 * 85 * 85);
  797.       charout(EN(word / (85 * 85 * 85)));
  798.       word %= (85 * 85 * 85);
  799.       charout(EN(word / (85 * 85)));
  800. --- 86,110 ----
  801.     }
  802.   }
  803.   
  804. ! wordout(word) reg long_t word;
  805.   {
  806.     if (word == 0) {
  807.       charout('z');
  808.     } 
  809.     else {
  810. !     reg long_t tmp = 0;
  811.   
  812.       if (word < 0)
  813.       { /* Because some don't support unsigned long */
  814.         tmp = 32;
  815. !       word = word - (long_t)(85 * 85 * 85 * 85 * 32);
  816.       }
  817.       if (word < 0) {
  818.         tmp = 64;
  819. !       word = word - (long_t)(85 * 85 * 85 * 85 * 32);
  820.       }
  821. !     charout(EN((word / (long_t)(85 * 85 * 85 * 85)) + tmp));
  822. !     word %= (long_t)(85 * 85 * 85 * 85);
  823.       charout(EN(word / (85 * 85 * 85)));
  824.       word %= (85 * 85 * 85);
  825.       charout(EN(word / (85 * 85)));
  826. ***************
  827. *** 109,116 ****
  828.   main(argc,argv)
  829.   char **argv;
  830.   {
  831. !   reg c;
  832. !   reg long int n;
  833.   
  834.     if (argc != 1) {
  835.       fprintf(stderr,"bad args to %s\n", argv[0]);
  836. --- 127,134 ----
  837.   main(argc,argv)
  838.   char **argv;
  839.   {
  840. !   reg int c;
  841. !   reg long_t n;
  842.   
  843.     if (argc != 1) {
  844.       fprintf(stderr,"bad args to %s\n", argv[0]);
  845. ***************
  846. *** 130,135 ****
  847.       ; /* this avoids bug in BITNET, which changes blank line to spaces */
  848.     else
  849.       putchar('\n');
  850. !   printf("xbtoa End N %ld %lx E %lx S %lx R %lx\n", n, n, Ceor, Csum, Crot);
  851.     exit(0);
  852.   }
  853. --- 148,155 ----
  854.       ; /* this avoids bug in BITNET, which changes blank line to spaces */
  855.     else
  856.       putchar('\n');
  857. !   printf("xbtoa End N %d %x E %x S %x R %x\n",
  858. !     (int) n, (int) n, (int) Ceor, (int) Csum, (int) Crot);
  859.     exit(0);
  860.   }
  861.  
  862. Index: README
  863. *** README.old    1993/02/19 14:49:51
  864. --- README    1993/04/26 11:15:17
  865. ***************
  866. *** 1,6 ****
  867.                                kit 2.0
  868.   
  869. !            Copyright (c) 1990 1991 1992, Raphael Manfredi
  870.   
  871.   You may copy this kit in whole or in part as long as you don't try to
  872.   make money off it, or pretend you wrote it.
  873. --- 1,6 ----
  874.                                kit 2.0
  875.   
  876. !               Copyright (c) 1990-1993, Raphael Manfredi
  877.   
  878.   You may copy this kit in whole or in part as long as you don't try to
  879.   make money off it, or pretend you wrote it.
  880. ***************
  881. *** 14,25 ****
  882.   in MANIFEST.
  883.   
  884.   Kit used to rely on Rich Salz's cshar package but is now self-contained.
  885. - However, if you have the opportunity to get cshar, I would recommend its
  886. - installation. Kit will automatically use the tools from cshar when they
  887. - are available.
  888.   
  889.   In order to use kit, you must have an implementation of compress. If you
  890. ! miss it, send me a mail: ram@eiffel.com (Raphael Manfredi).
  891.   
  892.   Moreover, hexdecode, hexencode, atob and btoa must be installed. The
  893.   public-domain implementation of des, which is provided with kit, must
  894. --- 14,22 ----
  895.   in MANIFEST.
  896.   
  897.   Kit used to rely on Rich Salz's cshar package but is now self-contained.
  898.   
  899.   In order to use kit, you must have an implementation of compress. If you
  900. ! miss it, send me a mail: ram@acri.fr (Raphael Manfredi).
  901.   
  902.   Moreover, hexdecode, hexencode, atob and btoa must be installed. The
  903.   public-domain implementation of des, which is provided with kit, must
  904. ***************
  905. *** 44,50 ****
  906.   4) Read the manual entries before running.
  907.   
  908.   5) IMPORTANT! Communicate any problem and suggested patches to
  909. ! me, ram@eiffel.com (Raphael Manfredi), so we can keep this
  910.   distribution in sync. If you have a problem, there will be someone
  911.   who might have had it or will have it too.
  912.   
  913. --- 41,47 ----
  914.   4) Read the manual entries before running.
  915.   
  916.   5) IMPORTANT! Communicate any problem and suggested patches to
  917. ! me, ram@acri.fr (Raphael Manfredi), so we can keep this
  918.   distribution in sync. If you have a problem, there will be someone
  919.   who might have had it or will have it too.
  920.   
  921. ***************
  922. *** 70,78 ****
  923.   
  924.   CREDITS
  925.   
  926. ! Kit relies on four public-domain softwares:
  927.   
  928. -     - cshar, written by Rich Salz (kit will use it if possible).
  929.       - des, written by Phil Karn, which is provided with kit.
  930.       - btoa (as a stripped down implementation).
  931.       - badtar, written by Mike Williams, with a few enhancements.
  932. --- 67,74 ----
  933.   
  934.   CREDITS
  935.   
  936. ! Kit relies on three public-domain softwares:
  937.   
  938.       - des, written by Phil Karn, which is provided with kit.
  939.       - btoa (as a stripped down implementation).
  940.       - badtar, written by Mike Williams, with a few enhancements.
  941. ***************
  942. *** 107,110 ****
  943.   I strive to keep it accurate, things get so hectic here that sometimes I
  944.   simply forget to update it.
  945.   
  946. !     Raphael Manfredi <ram@eiffel.com>
  947. --- 103,106 ----
  948.   I strive to keep it accurate, things get so hectic here that sometimes I
  949.   simply forget to update it.
  950.   
  951. !     Raphael Manfredi <ram@acri.fr>
  952.  
  953. Index: kit/secure
  954. Prereq: 2.0.1.2
  955. *** kit/secure.old    1993/02/10 15:29:00
  956. --- kit/secure    1993/04/26 11:20:27
  957. ***************
  958. *** 1,12 ****
  959.   #!/usr/bin/perl
  960.   
  961. ! # $Id: secure,v 2.0.1.2 93/02/10 15:29:00 ram Exp $
  962.   #
  963.   # $Log: secure,v $
  964. ! # Revision 2.0.1.2  93/02/10  15:29:00  ram
  965.   # patch25: forgot checks for archives with more than 10 parts
  966.   # patch25: kit's own shar removes ark*isdone for multipart archives
  967. ! #
  968.   # Revision 2.0.1.1  93/02/08  18:12:21  ram
  969.   # patch24: created
  970.   # 
  971. --- 1,16 ----
  972.   #!/usr/bin/perl
  973.   
  974. ! # $Id: secure,v 2.0.1.3 1993/04/26 11:20:27 ram Exp $
  975.   #
  976.   # $Log: secure,v $
  977. ! # Revision 2.0.1.3  1993/04/26  11:20:27  ram
  978. ! # patch27: added support for kit's own archiver variables
  979. ! # patch27: will now skip leading comments in kit parts (when concatenated)
  980. ! #
  981. ! # Revision 2.0.1.2  93/02/10  15:29:00  ram
  982.   # patch25: forgot checks for archives with more than 10 parts
  983.   # patch25: kit's own shar removes ark*isdone for multipart archives
  984. ! # 
  985.   # Revision 2.0.1.1  93/02/08  18:12:21  ram
  986.   # patch24: created
  987.   # 
  988. ***************
  989. *** 48,54 ****
  990.           next if /^test -f '[\w.]+' -a "\$\{1\}\" != "-c"\s*$/;
  991.           next if /^test \d+ -ne `wc -c <\s*'[\w.]+'`\s*$/;
  992.           next if /^test ! -f ark\$\{i\}isdone\s*$/i;
  993. !         next if /^test "\$\{missing\}" = ""\s*$/i;
  994.           &error;
  995.       } elsif (s/^rm //) {
  996.           next if /^-f ark\[1-9\]isdone$/;
  997. --- 52,58 ----
  998.           next if /^test -f '[\w.]+' -a "\$\{1\}\" != "-c"\s*$/;
  999.           next if /^test \d+ -ne `wc -c <\s*'[\w.]+'`\s*$/;
  1000.           next if /^test ! -f ark\$\{i\}isdone\s*$/i;
  1001. !         next if /^test "\$\{?missing\}?" = ""\s*$/i;
  1002.           &error;
  1003.       } elsif (s/^rm //) {
  1004.           next if /^-f ark\[1-9\]isdone$/;
  1005. ***************
  1006. *** 63,70 ****
  1007.           &erorr;
  1008.       } elsif (s/^for (.*); do\s*$/$1/) {
  1009.           &loose_check;
  1010.       } else {
  1011. !         next if /^missing="(\$\{missing\}\s+\$\{i\})?"$/i;
  1012.           &error;
  1013.       }
  1014.   }
  1015. --- 67,77 ----
  1016.           &erorr;
  1017.       } elsif (s/^for (.*); do\s*$/$1/) {
  1018.           &loose_check;
  1019. +     } elsif (s/^>>\s?//) {    # Kit leading comments
  1020. +         &comment_check;
  1021.       } else {
  1022. !         next if /^missing="(\$\{?missing\}?\s+\$\{?i\}?)?"$/i;
  1023. !         next if /^missing=''$/i;
  1024.           &error;
  1025.       }
  1026.   }
  1027. ***************
  1028. *** 78,83 ****
  1029. --- 85,91 ----
  1030.   }
  1031.   
  1032.   # Check arguments to echo (no fear for () or {} subshells for instance), etc...
  1033. + sub comment_check    { &error if /[&^`\\|;><?]/; }
  1034.   sub echo_check        { &error if /[&^*[`\\|;><?]/; }
  1035.   sub loose_check        { &error if /[&^*([{}`\\|;><?]/; }
  1036.   sub strong_check    { &error if /[=\$^&*([{}`\\|;><?]/; }
  1037.  
  1038. Index: kit/unkit.SH
  1039. Prereq: 2.0.1.16
  1040. *** kit/unkit.SH.old    1993/02/08 18:13:58
  1041. --- kit/unkit.SH    1993/04/26 11:21:29
  1042. ***************
  1043. *** 17,33 ****
  1044.   $startsh
  1045.   # @(#) unkit, reversal of kit
  1046.   # @(#) (c) E. Mogenet April 1990
  1047. ! # @(#) (c) R. Manfredi, 1990 1991
  1048.   
  1049. ! # $Id: unkit.SH,v 2.0.1.16 93/02/08 18:13:58 ram Exp $
  1050.   #
  1051.   # $Log: unkit.SH,v $
  1052. ! # Revision 2.0.1.16  93/02/08  18:13:58  ram
  1053.   # patch24: new option -d to specify directory where kits are
  1054.   # patch24: added security checks (options -s and -S) on shell archives
  1055.   # patch24: avoid sending an acknowledgment when -l option used
  1056.   # patch24: (reported by Christian Bertin <bertin@acri.fr>)
  1057. ! #
  1058.   # Revision 2.0.1.15  93/01/11  18:07:29  ram
  1059.   # patch22: now uses external getopt script for option parsing
  1060.   # patch22: fixed some typos in the help message
  1061. --- 17,36 ----
  1062.   $startsh
  1063.   # @(#) unkit, reversal of kit
  1064.   # @(#) (c) E. Mogenet April 1990
  1065. ! # @(#) (c) R. Manfredi, 1990-1993
  1066.   
  1067. ! # $Id: unkit.SH,v 2.0.1.17 1993/04/26 11:21:29 ram Exp $
  1068.   #
  1069.   # $Log: unkit.SH,v $
  1070. ! # Revision 2.0.1.17  1993/04/26  11:21:29  ram
  1071. ! # patch27: updated copyright dates
  1072. ! #
  1073. ! # Revision 2.0.1.16  93/02/08  18:13:58  ram
  1074.   # patch24: new option -d to specify directory where kits are
  1075.   # patch24: added security checks (options -s and -S) on shell archives
  1076.   # patch24: avoid sending an acknowledgment when -l option used
  1077.   # patch24: (reported by Christian Bertin <bertin@acri.fr>)
  1078. ! # 
  1079.   # Revision 2.0.1.15  93/01/11  18:07:29  ram
  1080.   # patch22: now uses external getopt script for option parsing
  1081.   # patch22: fixed some typos in the help message
  1082.  
  1083. Index: badtar/badtar.SH
  1084. Prereq: 2.0.1.2
  1085. *** badtar/badtar.SH.old    1992/05/02 14:10:56
  1086. --- badtar/badtar.SH    1993/04/26 11:15:53
  1087. ***************
  1088. *** 15,29 ****
  1089.   echo "Extracting badtar/badtar.$manext (with variable substitutions)"
  1090.   $rm -f badtar.$manext
  1091.   $spitshell >badtar.$manext <<!GROK!THIS!
  1092. ! .TH BABTAR $manext ram
  1093.   ''' @(#) Manual page for badtar -- (c) ram January 1992
  1094.   '''
  1095. ! ''' $Id: badtar.SH,v 2.0.1.2 92/05/02 14:10:56 ram Exp $
  1096.   '''
  1097.   ''' $Log: badtar.SH,v $
  1098. ! ''' Revision 2.0.1.2  92/05/02  14:10:56  ram
  1099. ! ''' patch16: fixed incorrect extraction message
  1100.   '''
  1101.   ''' Revision 2.0.1.1  92/01/11  19:12:35  ram
  1102.   ''' patch11: created
  1103.   ''' 
  1104. --- 15,32 ----
  1105.   echo "Extracting badtar/badtar.$manext (with variable substitutions)"
  1106.   $rm -f badtar.$manext
  1107.   $spitshell >badtar.$manext <<!GROK!THIS!
  1108. ! .TH BADTAR $manext ram
  1109.   ''' @(#) Manual page for badtar -- (c) ram January 1992
  1110.   '''
  1111. ! ''' $Id: badtar.SH,v 2.0.1.3 1993/04/26 11:15:53 ram Exp $
  1112.   '''
  1113.   ''' $Log: badtar.SH,v $
  1114. ! ''' Revision 2.0.1.3  1993/04/26  11:15:53  ram
  1115. ! ''' patch27: manual page name was mis-spelled BABTAR
  1116.   '''
  1117. + ''' Revision 2.0.1.2  92/05/02  14:10:56  ram
  1118. + ''' patch16: fixed incorrect extraction message
  1119. + ''' 
  1120.   ''' Revision 2.0.1.1  92/01/11  19:12:35  ram
  1121.   ''' patch11: created
  1122.   ''' 
  1123.  
  1124. Index: kit/mailkit.SH
  1125. Prereq: 2.0.1.12
  1126. *** kit/mailkit.SH.old    1993/01/11 18:06:55
  1127. --- kit/mailkit.SH    1993/04/26 11:19:31
  1128. ***************
  1129. *** 16,29 ****
  1130.   $spitshell >mailkit <<!GROK!THIS!
  1131.   $startsh
  1132.   # @(#) Mailer for kit files
  1133. ! # @(#) (c) R. Manfredi, 1990 1991
  1134.   
  1135. ! # $Id: mailkit.SH,v 2.0.1.12 93/01/11 18:06:55 ram Exp $
  1136.   #
  1137.   # $Log: mailkit.SH,v $
  1138. ! # Revision 2.0.1.12  93/01/11  18:06:55  ram
  1139. ! # patch22: now uses external getopt script for option parsing
  1140.   #
  1141.   # Revision 2.0.1.11  92/11/03  10:12:40  ram
  1142.   # patch21: option parsing can now deal with embeded spaces in arguments
  1143.   # 
  1144. --- 16,32 ----
  1145.   $spitshell >mailkit <<!GROK!THIS!
  1146.   $startsh
  1147.   # @(#) Mailer for kit files
  1148. ! # @(#) (c) R. Manfredi, 1990-1993
  1149.   
  1150. ! # $Id: mailkit.SH,v 2.0.1.13 1993/04/26 11:19:31 ram Exp $
  1151.   #
  1152.   # $Log: mailkit.SH,v $
  1153. ! # Revision 2.0.1.13  1993/04/26  11:19:31  ram
  1154. ! # patch27: copyright dates updated
  1155.   #
  1156. + # Revision 2.0.1.12  93/01/11  18:06:55  ram
  1157. + # patch22: now uses external getopt script for option parsing
  1158. + # 
  1159.   # Revision 2.0.1.11  92/11/03  10:12:40  ram
  1160.   # patch21: option parsing can now deal with embeded spaces in arguments
  1161.   # 
  1162.  
  1163. *** End of Patch 27 ***
  1164.