summaryrefslogtreecommitdiffstats
path: root/source/a/zoo/zoo_2.10-18.diff
blob: b0c74134772e5fe83134a7c625cc3178e9662d73 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
--- zoo-2.10.orig/debian/patches/01_old_fixes.dpatch
+++ zoo-2.10/debian/patches/01_old_fixes.dpatch
@@ -0,0 +1,597 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_old_fixes.dpatch by Jose Carlos Medeiros <debian@psabs.com.br>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Old fixes, that were made before this package has changed to use dpatch.
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch ${2:+-d $2}}"
+
+if [ $# -lt 1 ]; then
+  echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+  exit 1
+fi
+
+case "$1" in
+  -patch) patch $patch_opts -p1 < $0;;
+  -unpatch) patch $patch_opts -p1 -R < $0;;
+  *)
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad zoo-2.10~/ar.h zoo-2.10/ar.h
+--- zoo-2.10~/ar.h	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/ar.h	2005-11-16 17:28:23.308950960 -0200
+@@ -7,6 +7,7 @@
+ ***********************************************************/
+ 
+ #include <stdio.h>
++#include <sys/types.h>
+ 
+ #ifdef ANSI_HDRS
+ # include <limits.h>
+@@ -15,9 +16,11 @@
+ /* uchar should be 8 bits or more */
+ /* typedef unsigned char  uchar;   -- already in zoo.h */
+ 
++#ifndef _SYS_TYPES_H
+ typedef unsigned int   uint;    /* 16 bits or more */
+ typedef unsigned short ushort;  /* 16 bits or more */
+ typedef unsigned long  ulong;   /* 32 bits or more */
++#endif
+ 
+ /* T_UINT16 must be #defined in options.h to be 
+ a 16-bit unsigned integer type */
+diff -urNad zoo-2.10~/basename.c zoo-2.10/basename.c
+--- zoo-2.10~/basename.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/basename.c	2005-11-16 17:28:23.308950960 -0200
+@@ -18,7 +18,7 @@
+ 
+ /* This function strips device/directory information from
+ a pathname and returns just the plain filename */
+-void basename (pathname, fname)
++void zoo_basename (pathname, fname)
+ char *pathname;
+ char fname[];
+ {
+diff -urNad zoo-2.10~/fiz.1 zoo-2.10/fiz.1
+--- zoo-2.10~/fiz.1	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/fiz.1	2005-11-16 17:28:23.309950808 -0200
+@@ -5,7 +5,7 @@
+ .\"
+ .TH FIZ 1 "Jan 31, 1988"
+ .SH NAME
+-fiz \- analyze damaged zoo archive for data revovery
++fiz \- analyze damaged zoo archive for data recovery
+ .SH SYNOPSIS
+ .I fiz
+ .RB archive[ .zoo ]
+diff -urNad zoo-2.10~/linux.c zoo-2.10/linux.c
+--- zoo-2.10~/linux.c	1969-12-31 21:00:00.000000000 -0300
++++ zoo-2.10/linux.c	2005-11-16 17:28:23.310950656 -0200
+@@ -0,0 +1,73 @@
++/* machine.c for Linux. */
++
++/* Basically code stolen from bsd.c, and adjusted for Linux. */
++
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <unistd.h>
++
++/* Function isadir() returns 1 if the supplied handle is a directory,
++ * else it returns 0. */
++
++int isadir (ZOOFILE f)
++{
++  struct stat buffer;           /* buffer to hold file information */
++
++  if (fstat (fileno (f), &buffer) == -1) 
++    return (0);                 /* inaccessible -- assume not dir */
++  else
++    {
++      if (buffer.st_mode & S_IFDIR)
++	return (1);
++      else
++	return (0);
++    }
++}
++
++
++/* Standard UNIX-compatible time routines */
++#include "nixtime.i"
++
++/* Standard UNIX-specific file attribute routines */
++#include "nixmode.i"
++
++/* Function gettz() returns the offset from GMT in seconds */
++long gettz()
++{
++#define SEC_IN_DAY      (24L * 60L * 60L)
++#define INV_VALUE       (SEC_IN_DAY + 1L)
++
++  static long retval = INV_VALUE;    /* cache, init to impossible value */
++  struct timeval tp;
++  struct timezone tzp;
++
++  if (retval != INV_VALUE)           /* if have cached value, return it */
++    return retval;
++  
++   gettimeofday (&tp, &tzp);            
++
++   retval = tzp.tz_minuteswest * 60 - tzp.tz_dsttime * 3600L;
++   return retval;
++}
++
++/* Function fixfname() converts the supplied filename to a syntax
++ * legal for the host system.  It is used during extraction.
++ * Undocumented */
++
++char *fixfname(char *fname)
++{
++  return fname; /* default is no-op */
++}
++
++/* Function zootrunc() truncates the file passed to it.
++ * Undocumented. */
++
++int zootrunc(FILE *f)
++{
++  long seekpos;
++  int fd = fileno(f);
++
++  seekpos = lseek(fd, 0L, SEEK_CUR);
++  if (seekpos >= 0)
++    return ftruncate(fd, seekpos);
++}
+diff -urNad zoo-2.10~/machine.c zoo-2.10/machine.c
+--- zoo-2.10~/machine.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/machine.c	2005-11-16 17:28:23.310950656 -0200
+@@ -48,6 +48,10 @@
+ /* PART 2.  FOR EACH SPECIFIC SYSTEM, INCLUDE A C FILE HERE.           */
+ /***********************************************************************/
+ 
++#ifdef LINUX
++#include "linux.c"
++#endif
++
+ #ifdef SYS_V
+ #include "sysv.c"
+ #endif
+diff -urNad zoo-2.10~/makefile zoo-2.10/makefile
+--- zoo-2.10~/makefile	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/makefile	2005-11-16 17:28:23.311950504 -0200
+@@ -23,7 +23,7 @@
+ MODEL =
+ EXTRA = -DBIG_MEM -DNDEBUG
+ LINTFLAGS = -DLINT
+-OPTIM = -O
++OPTIM = -O -Wall
+ DESTDIR = /usr/local/bin
+ 
+ #List of all object files created for Zoo
+@@ -53,6 +53,7 @@
+ 	@echo "ultrix:       ULTRIX 4.1"
+ 	@echo "convex:       Convex C200 series"
+ 	@echo "sysv:         System V Release 2 or 3; or SCO Xenix"
++	@echo "linux:        Linux"
+ 	@echo "scodos:       Cross-compiler under SCO Xenix/UNIX for MS-DOS"
+ 	@echo "xenix286:     Older Xenix/286 (not tested)"
+ 	@echo "xenix68k:     Xenix/68000 (not tested)"
+@@ -94,6 +95,10 @@
+ bsd:
+ 	$(MAKE) CFLAGS="-c $(OPTIM) -DBSD4_3" $(TARGETS)
+ 
++# Linux
++linux:
++	$(MAKE) CC="gcc" CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DANSI_HDRS" $(TARGETS)
++
+ # ULTRIX 4.1
+ ultrix:
+ 	$(MAKE) CFLAGS="-c $(OPTIM) -DULTRIX" $(TARGETS)
+@@ -235,7 +240,11 @@
+ parse.o: zoofns.h zooio.h
+ portable.o: /usr/include/stdio.h assert.h debug.h machine.h options.h
+ portable.o: portable.h various.h zoo.h zoofns.h zooio.h
+-prterror.o: /usr/include/stdio.h /usr/include/varargs.h options.h various.h
++
++# I deleted varags.h dependancy from prterror.o since that is a
++# dependancy covered by a #ifdef, and in Debian's case #undef'ed
++
++prterror.o: /usr/include/stdio.h options.h various.h
+ prterror.o: zoofns.h zooio.h
+ sysv.o: /usr/include/sys/stat.h /usr/include/sys/types.h /usr/include/time.h
+ sysv.o: nixmode.i nixtime.i
+diff -urNad zoo-2.10~/makelist.c zoo-2.10/makelist.c
+--- zoo-2.10~/makelist.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/makelist.c	2005-11-16 17:28:23.311950504 -0200
+@@ -21,6 +21,8 @@
+ 
+ char *nameptr PARMS((char *));
+ void modpath PARMS((char *));
++int isadir PARMS((ZOOFILE));
++int isfdir PARMS((char *));
+ 
+ /*******************/
+ /*
+diff -urNad zoo-2.10~/misc.c zoo-2.10/misc.c
+--- zoo-2.10~/misc.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/misc.c	2005-11-16 17:28:23.313950200 -0200
+@@ -8,6 +8,7 @@
+ Copyright (C) 1986, 1987 Rahul Dhesi -- All rights reserved
+ (C) Copyright 1988 Rahul Dhesi -- All rights reserved
+ */
++#include <signal.h>
+ #include "options.h"
+ /* Miscellaneous functions needed by Zoo but not by Ooz */
+ 
+@@ -201,7 +202,7 @@
+ ZOOFILE zoo_file;
+ {
+ #ifndef NOSIGNAL  
+-   T_SIGNAL (*oldsignal)();
++   T_SIGNAL (*oldsignal)(int);
+    oldsignal = signal (SIGINT, SIG_IGN);
+ #endif
+    if (fwr_dir (direntry, zoo_file) == -1)
+diff -urNad zoo-2.10~/misc2.c zoo-2.10/misc2.c
+--- zoo-2.10~/misc2.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/misc2.c	2005-11-16 17:28:23.312950352 -0200
+@@ -7,6 +7,10 @@
+ Copyright (C) 1986, 1987 Rahul Dhesi -- All rights reserved
+ (C) Copyright 1988 Rahul Dhesi -- All rights reserved
+ */
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <fcntl.h>
++#include <unistd.h>
+ #include "options.h"
+ /* Miscellaneous routines */
+ #include "portable.h"
+diff -urNad zoo-2.10~/nixtime.i zoo-2.10/nixtime.i
+--- zoo-2.10~/nixtime.i	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/nixtime.i	2005-11-16 17:28:23.313950200 -0200
+@@ -10,6 +10,9 @@
+ 
+                                     -- Rahul Dhesi  1986/12/31
+ */
++#include <sys/types.h>
++#include <time.h>
++#include <utime.h>
+ 
+ struct tm *localtime();
+ 
+@@ -51,9 +54,10 @@
+ {
+ 	long mstonix();
+ 	long gettz();
+-	long utimbuf[2];
+-	utimbuf[0] = utimbuf[1] = gettz() + mstonix (date, time);
+-	return (utime (path, utimbuf));
++        struct utimbuf utbf;
++
++	utbf.actime = utbf.modtime = gettz() + mstonix (date, time);
++	return (utime (path, &utbf));
+ }
+ 
+ /****************
+diff -urNad zoo-2.10~/options.h zoo-2.10/options.h
+--- zoo-2.10~/options.h	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/options.h	2005-11-16 17:28:23.314950048 -0200
+@@ -13,6 +13,32 @@
+ 
+ 
+ /***********************************************************************/
++/* Linux                                                               */
++/***********************************************************************/
++
++#ifdef LINUX
++#define FILTER
++#define IO_MACROS
++#define EXISTS(f)		(access(f, 00) == 0)
++#define FNLIMIT 1023
++#define CHEKDIR
++#define NIXTIME
++#define NIXFNAME
++#define NEEDCTYP
++#define NOENUM
++#define REN_STDC
++#define SETBUF
++#define GETTZ
++#define FATTR
++#define T_SIGNAL        void
++#define STDARG
++#define HAVE_ISATTY          /* undocumented #define option */
++#define ANSI_PROTO
++#define VOIDPTR  void * 
++#define NO_STDIO_FN          /* Do we need this? RUARI QUINN */
++#endif /* Linux */
++
++/***********************************************************************/
+ /* SYSTEM V (should be compatible with most releases)                  */
+ /***********************************************************************/
+ 
+diff -urNad zoo-2.10~/portable.h zoo-2.10/portable.h
+--- zoo-2.10~/portable.h	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/portable.h	2005-11-16 17:28:23.314950048 -0200
+@@ -90,6 +90,12 @@
+ #define  MKDIR(x)       mkdir(x, 0777)
+ #endif
+ 
++/* Linux */
++#ifdef LINUX
++#define NIX_IO       /* standard **IX I/O */
++#define  MKDIR(x)       mkdir(x, 0777)
++#endif
++
+ /* Amiga */
+ #ifdef MCH_AMIGA
+ # include "MCH_AMIGA NEEDS REVISION"
+diff -urNad zoo-2.10~/zoo.1 zoo-2.10/zoo.1
+--- zoo-2.10~/zoo.1	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/zoo.1	2005-11-16 17:33:56.112357152 -0200
+@@ -955,7 +955,7 @@
+     2526: DIR  [changes] ==>   95
+     2587: DATA
+ ****************
+-    3909: DIR  [copyrite] ==> 1478
++    3909: DIR  [copyright] ==> 1478
+     3970: DATA
+     4769: DATA
+ ****************
+@@ -1041,7 +1041,7 @@
+ Matches any sequence of zero or more characters.
+ .PP
+ .TP
+-.B \?
++.B ?
+ Matches any single character.
+ .sp 1
+ Arbitrary combinations of 
+@@ -1466,23 +1466,12 @@
+ .I zoo
+ on all systems.  So far as I can tell, this
+ upward compatibility (all manipulations) and downward
+-compatiblity (ability to extract and list)
++compatibility (ability to extract and list)
+ is maintained by
+ .I zoo
+ versions up to 2.01.  Version 2.1 adds the incompatibility
+ that if high-performance compression is used, earlier
+ versions cannot extract files compressed with version 2.1.
+-This is the only incompatibility that is permissible.
+-You are forbidden, with the force of
+-copyright law, to create from the
+-.I zoo
+-source code any derivative work
+-that violates this compatibility goal,
+-whether knowingly or through negligence.
+-If any violation of this
+-compatibility goal is observed,
+-this should be
+-considered a serious problem and reported to me.
+ .SH CHANGES
+ Here is a list of changes occurring from version 1.50 to
+ version 2.01.  In parentheses is given the version in which each
+@@ -1581,7 +1570,7 @@
+ .TP
+ \-
+ (2.01) Blanks around equal signs in commands given to "make"
+-were removed from the mk* scripts for better compatiblity
++were removed from the mk* scripts for better compatibility
+ with more **IX implementations including Sun's.
+ .TP
+ \-
+diff -urNad zoo-2.10~/zoo.c zoo-2.10/zoo.c
+--- zoo-2.10~/zoo.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/zoo.c	2005-11-16 17:28:23.319949288 -0200
+@@ -15,6 +15,7 @@
+ (C) Copyright 1988 Rahul Dhesi -- All rights reserved
+ (C) Copyright 1991 Rahul Dhesi -- All rights reserved
+ */
++#include <unistd.h>
+ #include "options.h"
+ #include "zooio.h"
+ #include "various.h"
+diff -urNad zoo-2.10~/zoo.h zoo-2.10/zoo.h
+--- zoo-2.10~/zoo.h	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/zoo.h	2005-11-16 17:28:23.321948984 -0200
+@@ -1,5 +1,6 @@
+ /* derived from: zoo.h 2.16 88/01/27 23:21:36 */
+-
++#ifndef ZOO_H
++#define ZOO_H
+ /*
+ The contents of this file are hereby released to the public domain.
+ 
+@@ -240,3 +241,4 @@
+ #define	MAXGEN				0x0f
+ /* version mask to prune down to correct size on large-word machines */
+ #define VER_MASK				0xffff
++#endif
+diff -urNad zoo-2.10~/zooadd.c zoo-2.10/zooadd.c
+--- zoo-2.10~/zooadd.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/zooadd.c	2005-11-16 17:28:23.318949440 -0200
+@@ -9,11 +9,13 @@
+ (C) Copyright 1988 Rahul Dhesi -- All rights reserved
+ (C) Copyright 1991 Rahul Dhesi -- All rights reserved
+ */
++#include <unistd.h>
+ #include "options.h"
+ /* Adds files specified in parameter-list to archive zoo_path. */
+ 
+ #define LONGEST	20					/* assumed length of longest filename */
+ #include "zoomem.h"             /* to define MAXADD */
++#undef PORTABLE
+ #include "zoo.h"
+ #include "zooio.h"
+ #include "various.h"
+@@ -37,6 +39,7 @@
+ void copyfields PARMS ((struct direntry *, struct tiny_header *));
+ void storefname PARMS ((struct direntry *, char *, int));
+ char *choosefname PARMS ((struct direntry *));
++int isadir PARMS((ZOOFILE));
+ 
+ extern struct zoo_header zoo_header;
+ 
+@@ -132,7 +135,7 @@
+ 
+ if (zoo_file == NOFILE)
+    prterror ('f', could_not_open, zoo_path);
+-basename(zoo_path, zoo_fname);      /* get basename of archive */
++zoo_basename(zoo_path, zoo_fname);  /* get basename of archive */
+ rootname (zoo_path, zoo_bak);       /* name without extension */
+ strcat (zoo_bak, BACKUP_EXT);       /* name of backup of this archive */
+ 
+@@ -222,7 +225,7 @@
+ 		break;
+ 	}
+ 
+-   basename (this_path, this_fname);   /* get just filename for later */
++   zoo_basename (this_path, this_fname);   /* get just filename for later */
+ 
+    this_file = zooopen(this_path, Z_READ);
+    if (this_file == NOFILE) {
+diff -urNad zoo-2.10~/zooadd2.c zoo-2.10/zooadd2.c
+--- zoo-2.10~/zooadd2.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/zooadd2.c	2005-11-16 17:28:23.317949592 -0200
+@@ -7,7 +7,9 @@
+ Copyright (C) 1986, 1987 Rahul Dhesi -- All rights reserved
+ (C) Copyright 1988 Rahul Dhesi -- All rights reserved
+ */
++#include <unistd.h>
+ #include "options.h"
++#undef PORTABLE
+ #include "zoo.h"
+ #ifndef	OK_STDIO
+ #include <stdio.h>
+@@ -20,7 +22,7 @@
+ #include "assert.h"
+ #include "debug.h"
+ #include "parse.h"
+-
++int isfdir PARMS((char *));
+ /*
+ Miscellaneous routines to support zooadd().
+ */
+diff -urNad zoo-2.10~/zooext.c zoo-2.10/zooext.c
+--- zoo-2.10~/zooext.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/zooext.c	2005-11-16 17:28:23.320949136 -0200
+@@ -14,7 +14,8 @@
+ /* Extract file from archive.  Extracts files specified in parameter-list
+    from archive zoo_path.  If none specified, extracts all files from
+    archive. */
+-
++#include <unistd.h>
++#include <signal.h>
+ #include "options.h"
+ #include "zoo.h"
+ #include "parse.h"      /* defines struct for parse() */
+@@ -62,7 +63,7 @@
+ char *whichname;                          /* which name to extract */
+ char matchname[PATHSIZE];                 /* for pattern matching only */
+ #ifndef NOSIGNAL
+-T_SIGNAL (*oldsignal)();        /* to save previous SIGINT handler */
++T_SIGNAL (*oldsignal)(int);        /* to save previous SIGINT handler */
+ #endif
+ ZOOFILE zoo_file;                         /* open archive */
+ long next_ptr;                            /* pointer to within archive */
+@@ -626,7 +627,7 @@
+ 
+ /* Ctrl_c() is called if ^C is hit while a file is being extracted.
+    It closes the files, deletes it, and exits. */
+-T_SIGNAL ctrl_c()
++T_SIGNAL ctrl_c(int dummy)
+ {
+ #ifndef NOSIGNAL
+    signal (SIGINT, SIG_IGN);     /* ignore any more */
+diff -urNad zoo-2.10~/zoofns.h zoo-2.10/zoofns.h
+--- zoo-2.10~/zoofns.h	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/zoofns.h	2005-11-16 17:28:23.320949136 -0200
+@@ -42,12 +42,12 @@
+ int cfactor PARMS ((long, long));
+ int chname PARMS ((char *, char *));
+ int cmpnum PARMS ((unsigned int, unsigned int, unsigned int, unsigned int));
+-T_SIGNAL ctrl_c PARMS ((void));
++T_SIGNAL ctrl_c PARMS ((int));
+ int exists PARMS ((char *));
+ int getfile PARMS ((ZOOFILE, ZOOFILE, long, int));
+ int getutime PARMS ((char *, unsigned *, unsigned *));
+ int gettime PARMS ((ZOOFILE, unsigned *, unsigned *));
+-T_SIGNAL handle_break PARMS ((void));
++T_SIGNAL handle_break PARMS ((int));
+ 
+ #ifdef USE_ASCII
+ int isupper PARMS ((int));
+@@ -85,7 +85,7 @@
+ void addfname PARMS ((char *, long, unsigned int, unsigned int, 
+ 							unsigned, unsigned));
+ void add_version PARMS ((char *, struct direntry *));
+-void basename PARMS ((char *, char []));
++void zoo_basename PARMS ((char *, char []));
+ void break_off PARMS ((void));
+ void close_file PARMS ((ZOOFILE));
+ void comment PARMS ((char *, char *));
+diff -urNad zoo-2.10~/zooio.h zoo-2.10/zooio.h
+--- zoo-2.10~/zooio.h	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/zooio.h	2005-11-16 17:28:23.321948984 -0200
+@@ -7,6 +7,7 @@
+ 
+ 											-- Rahul Dhesi 1988/01/24
+ */
++#include "zoo.h"
+ #ifndef	OK_STDIO
+ #include <stdio.h>
+ #define	OK_STDIO
+diff -urNad zoo-2.10~/zoolist.c zoo-2.10/zoolist.c
+--- zoo-2.10~/zoolist.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/zoolist.c	2005-11-16 17:28:23.322948832 -0200
+@@ -47,6 +47,7 @@
+ int ver_too_high PARMS((struct zoo_header *));
+ int needed PARMS((char *, struct direntry *, struct zoo_header *));
+ void printtz PARMS((int));
++int fputchar PARMS ((int));
+ 
+ void zoolist (argv, option, argc)
+ char **argv, *option;
+@@ -414,7 +415,7 @@
+ 					if (direntry.fattr == 0)
+ 						printf ("--- ");
+ 					else if ((direntry.fattr >> 22) == 1)
+-						printf ("%03o ", direntry.fattr & 0x1ff);
++						printf ("%03lo ", direntry.fattr & 0x1ff);
+ 					else
+ 						printf ("??? ");
+ 				}
+diff -urNad zoo-2.10~/zoopack.c zoo-2.10/zoopack.c
+--- zoo-2.10~/zoopack.c	2005-11-16 17:11:21.000000000 -0200
++++ zoo-2.10/zoopack.c	2005-11-16 17:28:23.323948680 -0200
+@@ -10,6 +10,7 @@
+ Copyright (C) 1986, 1987 Rahul Dhesi -- All rights reserved
+ (C) Copyright 1988 Rahul Dhesi -- All rights reserved
+ */
++#include <unistd.h>
+ #include "options.h"
+ /* Packs an archive.  The sequence is:
+    1. Copy all files from current archive to new one.
+@@ -171,7 +172,7 @@
+ } else {
+    strcpy (temp_file, xes);
+ }
+-mktemp (temp_file);                    /* ... and make unique */
++mkstemp (temp_file);                    /* ... and make unique */
+ new_file = zoocreate (temp_file);
+ if (new_file == NOFILE)
+    prterror ('f', "Could not create temporary file %s.\n", temp_file);
+@@ -388,7 +389,7 @@
+ 
+ /* handle_break() */
+ /* Sets break_hit to 1 when called */
+-T_SIGNAL handle_break()
++T_SIGNAL handle_break(int dummy)
+ {
+ #ifndef NOSIGNAL
+    signal (SIGINT, SIG_IGN);     /* ignore future control ^Cs for now */
--- zoo-2.10.orig/debian/patches/00options
+++ zoo-2.10/debian/patches/00options
@@ -0,0 +1 @@
+DPEP_OPTION_EXEC_TEMPLATE=1
--- zoo-2.10.orig/debian/patches/00list
+++ zoo-2.10/debian/patches/00list
@@ -0,0 +1,5 @@
+01_old_fixes
+02_traversal_directory
+03_fix_manage_archive_under_AMD64
+04_fix_fullpath_buffer_overflow
+05_CVE-2006-1269.dpatch
--- zoo-2.10.orig/debian/patches/00template
+++ zoo-2.10/debian/patches/00template
@@ -0,0 +1,43 @@
+#!/bin/sh
+# Sample debian/patches/00template script
+# era Thu May 15 23:24:07 2003
+
+# This simply creates the equivalent of the hard-coded template.
+# Adapt and hack to suit your needs.
+
+file="$1"
+shift
+description="$@"
+
+fullnameguess="$(getent passwd $(id -un) | cut -f5 -d: | cut -f1 -d,)"
+domainguess=$([ -f /etc/mailname ] && cat /etc/mailname || hostname -f)
+emailguess="${DEBEMAIL:-${EMAIL:-$(logname)@${domainguess}}}"
+
+cat <<EOF
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## ${file} by ${DEBFULLNAME:-$fullnameguess} <$emailguess>
+##
+## All lines beginning with \`## DP:' are a description of the patch.
+## DP: ${description:-No description}
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="\${patch_opts:--f --no-backup-if-mismatch \${2:+-d \$2}}"
+
+if [ \$# -lt 1 ]; then
+  echo >&2 "\`basename \$0\`: script expects -patch|-unpatch as argument"
+  exit 1
+fi
+
+case "\$1" in
+  -patch) patch \$patch_opts -p1 < \$0;;
+  -unpatch) patch \$patch_opts -p1 -R < \$0;;
+  *)
+    echo >&2 "\`basename \$0\`: script expects -patch|-unpatch as argument"
+    exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+EOF
+
--- zoo-2.10.orig/debian/patches/02_traversal_directory.dpatch
+++ zoo-2.10/debian/patches/02_traversal_directory.dpatch
@@ -0,0 +1,70 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_traversal_directory.dpatch by Jose Carlos Medeiros <debian@psabs.com.br>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: patch to solve problem with "directory traversal bug" CVE id CAN-2005-2349
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch ${2:+-d $2}}"
+
+if [ $# -lt 1 ]; then
+  echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+  exit 1
+fi
+
+case "$1" in
+  -patch) patch $patch_opts -p1 < $0;;
+  -unpatch) patch $patch_opts -p1 -R < $0;;
+  *)
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad zoo-2.10/portable.c /tmp/dpep.W7Aoaj/zoo-2.10/portable.c
+--- zoo-2.10/portable.c	2005-07-22 15:34:22.000000000 -0300
++++ /tmp/dpep.W7Aoaj/zoo-2.10/portable.c	2005-07-25 14:43:57.757855384 -0300
+@@ -364,6 +364,41 @@
+       show_dir(direntry);
+    }
+ #endif
++   /* #########################################################################
++    * 
++    *  THIS CODE WAS WRITTEN TO SOLVE PROBLEM WITH DIRECTORY TRAVERSAL SECURITY
++    *  BUG (CVE id CAN-2005-2349).
++    *  
++    *  ########################################################################
++    */
++   char *p;
++   /* take off '../'   */
++   while ((p = strstr( direntry->dirname, "../" )) != NULL) {
++      while (*(p+3) != '\0') {
++        *p = *(p + 3);
++        p++;
++      }
++      *p = *(p+3); /* move last null */
++      //printf("zoo: skipped \"../\" path component in '%s'\n", direntry->dirname);
++   }
++   /* take off  '/'  */
++   if ( direntry->dirname[0] == '/' ) {
++      p = direntry->dirname;
++      while (*p != '\0') {
++        *p = *(p + 1);
++        p++;
++      }
++      *p = *(p+1); /* move last null */
++      //printf("zoo: skipped \"/\" path component in '%s'\n", direntry->dirname);
++   }
++   /* direntry->dirlen = strlen(direntry->dirname); */
++
++   /* ##################################################################
++    * 
++    * END
++    *
++    * ###################################################################
++   */
+    return (0);
+ }
+ 
--- zoo-2.10.orig/debian/patches/03_fix_manage_archive_under_AMD64.dpatch
+++ zoo-2.10/debian/patches/03_fix_manage_archive_under_AMD64.dpatch
@@ -0,0 +1,107 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 03_fix_manage_archive_under_AMD64.dpatch by Jose Carlos Medeiros <debian@psabs.com.br>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: patch to solve problems managing files under AMD64 and maybe under others 64 archs.
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch ${2:+-d $2}}"
+
+if [ $# -lt 1 ]; then
+  echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+  exit 1
+fi
+
+case "$1" in
+  -patch) patch $patch_opts -p1 < $0;;
+  -unpatch) patch $patch_opts -p1 -R < $0;;
+  *)
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad zoo-2.10~/makefile zoo-2.10/makefile
+--- zoo-2.10~/makefile	2005-11-16 12:10:06.773065688 -0200
++++ zoo-2.10/makefile	2005-11-16 12:12:50.816127352 -0200
+@@ -54,6 +54,7 @@
+ 	@echo "convex:       Convex C200 series"
+ 	@echo "sysv:         System V Release 2 or 3; or SCO Xenix"
+ 	@echo "linux:        Linux"
++	@echo "linux64:      Linux with 64 bit long"
+ 	@echo "scodos:       Cross-compiler under SCO Xenix/UNIX for MS-DOS"
+ 	@echo "xenix286:     Older Xenix/286 (not tested)"
+ 	@echo "xenix68k:     Xenix/68000 (not tested)"
+@@ -99,6 +100,10 @@
+ linux:
+ 	$(MAKE) CC="gcc" CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DANSI_HDRS" $(TARGETS)
+ 
++# Linux64
++linux64:
++	$(MAKE) CC="gcc" CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DLONG64 -DANSI_HDRS" $(TARGETS)
++
+ # ULTRIX 4.1
+ ultrix:
+ 	$(MAKE) CFLAGS="-c $(OPTIM) -DULTRIX" $(TARGETS)
+diff -urNad zoo-2.10~/misc.c zoo-2.10/misc.c
+--- zoo-2.10~/misc.c	2005-11-16 12:10:06.775065384 -0200
++++ zoo-2.10/misc.c	2005-11-16 12:20:48.366528656 -0200
+@@ -173,7 +173,11 @@
+ 
+    frd_zooh (header, zoo_file);
+ 
++#ifdef LONG64
++   if ((int)(header->zoo_start = header->zoo_minus) != 0)
++#else
+    if ((header->zoo_start + header->zoo_minus) != 0L)
++#endif
+       prterror ('f', failed_consistency);
+    if (ver_too_high (header))
+       prterror ('f', wrong_version, header->major_ver, header->minor_ver);
+diff -urNad zoo-2.10~/zoodel.c zoo-2.10/zoodel.c
+--- zoo-2.10~/zoodel.c	1991-07-05 13:00:00.000000000 -0300
++++ zoo-2.10/zoodel.c	2005-11-16 12:20:19.776874944 -0200
+@@ -138,7 +138,11 @@
+    
+    /* read archive header */
+    frd_zooh (&zoo_header, zoo_file);
++#ifdef LONG64
++   if ((int)(zoo_header.zoo_start + zoo_header.zoo_minus) != 0)
++#else
+    if ((zoo_header.zoo_start + zoo_header.zoo_minus) != 0L)
++#endif
+       prterror ('f', failed_consistency);
+    if (ver_too_high (&zoo_header))
+       prterror ('f', wrong_version, zoo_header.major_ver, zoo_header.minor_ver);
+diff -urNad zoo-2.10~/zooext.c zoo-2.10/zooext.c
+--- zoo-2.10~/zooext.c	2005-11-16 12:10:06.783064168 -0200
++++ zoo-2.10/zooext.c	2005-11-16 12:22:08.373365768 -0200
+@@ -164,7 +164,11 @@
+ } else {
+    /* read header */
+    frd_zooh (&zoo_header, zoo_file);
++#ifdef LONG64
++   if ((int)(zoo_header.zoo_start + zoo_header.zoo_minus) != 0) {
++#else
+    if ((zoo_header.zoo_start + zoo_header.zoo_minus) != 0L) {
++#endif
+       prterror ('w', failed_consistency);
+       bad_header++;
+ 		exit_status = 1;
+diff -urNad zoo-2.10~/zoopack.c zoo-2.10/zoopack.c
+--- zoo-2.10~/zoopack.c	2005-11-16 12:10:06.786063712 -0200
++++ zoo-2.10/zoopack.c	2005-11-16 12:23:01.145343208 -0200
+@@ -140,7 +140,11 @@
+ /* Read the header of the old archive. */
+ frd_zooh(&old_zoo_header, zoo_file);
+ 
++#ifdef LONG64
++if ((int)(old_zoo_header.zoo_start + old_zoo_header.zoo_minus) != 0) {
++#else
+ if ((old_zoo_header.zoo_start + old_zoo_header.zoo_minus) != 0L) {
++#endif
+    prterror ('w', failed_consistency);
+    ++bad_header;                    /* remember for future error message */
+ }
--- zoo-2.10.orig/debian/patches/04_fix_fullpath_buffer_overflow.dpatch
+++ zoo-2.10/debian/patches/04_fix_fullpath_buffer_overflow.dpatch
@@ -0,0 +1,44 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 04_fix_fullpath_buffer_overflow.dpatch by Jose Carlos Medeiros <debian@psabs.com.br>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix  "fullpath()" File Name Handling Buffer Overflow, CAN-2006-0855
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch ${2:+-d $2}}"
+
+if [ $# -lt 1 ]; then
+  echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+  exit 1
+fi
+
+case "$1" in
+  -patch) patch $patch_opts -p1 < $0;;
+  -unpatch) patch $patch_opts -p1 -R < $0;;
+  *)
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad zoo-2.10~/misc.c zoo-2.10/misc.c
+--- zoo-2.10~/misc.c	2006-03-03 18:51:31.000000000 -0300
++++ zoo-2.10/misc.c	2006-03-03 18:54:29.000000000 -0300
+@@ -136,11 +136,14 @@
+ char *fullpath (direntry)
+ struct direntry *direntry;
+ {
+-	static char result[PATHSIZE];
++	static char result[PATHSIZE+PATHSIZE+12]; // Room for enough space
+ 	combine (result,
+ 				direntry->dirlen != 0 ? direntry->dirname : "", 
+ 				(direntry->namlen != 0) ? direntry->lfname : direntry->fname
+ 			  );
++	if (strlen (result) >= PATHSIZE) {
++		prterror ('f', "Combined dirname and filename too long\n"); 
++	}
+ 	return (result);
+ }
+ 
--- zoo-2.10.orig/debian/patches/05_CVE-2006-1269.dpatch
+++ zoo-2.10/debian/patches/05_CVE-2006-1269.dpatch
@@ -0,0 +1,37 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 05_CVE-2006-1269.dpatch by Alec Berryman <alec@thened.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=183426
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch ${2:+-d $2}}"
+
+if [ $# -lt 1 ]; then
+  echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+  exit 1
+fi
+
+case "$1" in
+  -patch) patch $patch_opts -p1 < $0;;
+  -unpatch) patch $patch_opts -p1 -R < $0;;
+  *)
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad zoo-2.10~/parse.c zoo-2.10/parse.c
+--- zoo-2.10~/parse.c	1991-07-05 17:00:00.000000000 +0100
++++ zoo-2.10/parse.c	2006-05-18 14:16:32.000000000 +0100
+@@ -39,7 +39,7 @@
+    char *namep;                   /* points to relevant part of tempname */
+ 
+    char *p;
+-   strcpy (tempname, fname);
++   strncpy (tempname, fname, LFNAMESIZE);
+ 
+ #ifdef DEBUG
+ printf ("parse:  supplied name is [%s].\n", tempname);
--- zoo-2.10.orig/debian/compat
+++ zoo-2.10/debian/compat
@@ -0,0 +1 @@
+5
--- zoo-2.10.orig/debian/changelog
+++ zoo-2.10/debian/changelog
@@ -0,0 +1,139 @@
+zoo (2.10-18) unstable; urgency=low
+
+  * Added patch to solve "CVE-2006-1269: local arbitrary code execution",
+    thanks to Alec Berryman <alec@thened.net> (closes: #367858)
+  * Updated to DH_COMPAT 5
+
+ -- Jose Carlos Medeiros <debian@psabs.com.br>  Fri, 19 May 2006 19:23:24 -0300
+
+zoo (2.10-17) unstable; urgency=low
+
+  * Added 04_fix_fullpath_buffer_overflow patch to fix a Buffer Overflow,
+    CAN-2006-0855. Thanks to Jean-SébastienGuay-Leroux 
+    <jean-sebastien_at_guay-leroux.com>, (closes: #354461)
+
+ -- Jose Carlos Medeiros <debian@psabs.com.br>  Fri,  3 Mar 2006 18:56:02 -0300
+
+zoo (2.10-16) unstable; urgency=low
+
+  * Added 03_fix_manage_archive_under_AMD64 patch, thanks to carlj
+    <Carl.Johnson.carlj@peak.org>. (closes: #335114)
+  * Updated debian/rules to test and compile to AMD64.
+  * Updated to Standards-Version 3.6.2.
+  * Changed 01_old_fixes dpatch to solve problem "missing \?" in zoo.1.
+
+ -- Jose Carlos Medeiros <debian@psabs.com.br>  Wed, 16 Nov 2005 16:48:24 -0200
+
+zoo (2.10-15) unstable; urgency=low
+
+  * Added dpatch as Build-Depends in debian/control.
+  * Added debian/watch file. (closes: #322246)
+  * Updated linux.c in 01_old_fixes. (closes: #322194)
+    Thanks to Robert Millan <rmh@aybabtu.com>
+
+ -- Jose Carlos Medeiros <debian@psabs.com.br>  Tue,  9 Aug 2005 15:07:48 -0300
+
+zoo (2.10-14) unstable; urgency=low
+
+  * Changed call from "mktemp" to "mkstemp" in zoopack.c file.
+  * Added debian/patches/00options, debian/patches/00list and
+    debian/patches/00template files.
+  * Updated rules and control to use dpatch.
+  * Added 01_old_fixes.dpatch file with old changes.
+  * Added 02_traversal_directory.dpatch to solve problem with "directory
+    traversal security bug - CVE id CAN-2005-2349". Thanks to 
+    Jorge Ventura <jorge.ventura@fusemail.com> (closes: #309594)
+  * Changed upstream source link in copyright file.
+
+ -- Jose Carlos Medeiros <debian@psabs.com.br>  Fri, 22 Jul 2005 12:59:07 -0300
+
+zoo (2.10-13) unstable; urgency=low
+
+  * Updated zoo.1 file (thanks to A Costa <agcosta@gis.net>). (closes: #302817)
+  * Changed email of Mantainer in control file.
+  * Updated fiz.1 file (thanks to A Costa <agcosta@gis.net>). (closes: #309874)
+
+ -- Jose Carlos Medeiros <debian@psabs.com.br>  Tue,  7 Jun 2005 20:47:51 -0300
+
+zoo (2.10-12) unstable; urgency=low
+
+  * New maintainer (closes: #302895)
+  * Created compat file.
+  * Deleted debian/docs unused file.
+  * Changed rules to complain debhelper > 4.0.
+  * Changed README.compilers to README.debian.
+
+ -- Jose Carlos Medeiros <jose@psabs.com.br>  Wed, 13 Apr 2005 18:39:14 -0300
+
+zoo (2.10-11) unstable; urgency=low
+
+  * New maintainer (closes: #258470)
+  * Move to main from non-free (zoo is now in public domain).
+  * Updated copyright file
+  * Updated zoo.1 file
+  * Removed unnecessary, compile related files from the binary package.
+  * Standards-Version: 3.6.1.0
+
+ -- Niklas Vainio <nvainio+deb@iki.fi>  Sat, 10 Jul 2004 21:29:26 +0300
+
+zoo (2.10-10) unstable; urgency=low
+
+  * Recompile to allow prelinking (closes: #231547).
+
+ -- Petr Cech <cech@debian.org>  Mon,  9 Feb 2004 12:02:32 +0100
+
+zoo (2.10-9) unstable; urgency=low
+
+  * Fix build with new glibc-2.2 (closes: #94865)
+
+ -- Petr Cech <cech@debian.org>  Sun, 22 Apr 2001 22:17:14 +0200
+
+zoo (2.10-8) unstable; urgency=low
+
+  * Added README.compilers.
+  * Standards-version: 3.2.1.
+  * Glibc-2.2 build.
+  * Fix long utibuf[2] to struct utimbuf.
+
+ -- Petr Cech <cech@debian.org>  Tue, 17 Oct 2000 15:07:50 +0200
+
+zoo (2.10-7) unstable; urgency=low
+
+  * Don't know how, but the copyright was gone
+  * Added documentation from source package
+
+ -- Petr Cech <cech@debian.org>  Sat, 16 May 1998 11:32:30 +0200
+
+zoo (2.10-6) frozen unstable; urgency=low
+
+  * Use debhelper.
+  * Added some includes and prototypes to have less warnings
+  * New maintainer.
+  * updated to 2.4.1
+
+ -- Petr CECH <Petr.Cech@st.mff.cuni.cz>  Fri,  8 May 1998 01:06:39 +0200
+
+zoo (2.10-5) unstable; urgency=low
+
+  * Orphaned the package.
+  * debian/control (Standards-Version): updated to 2.4.0.0 [#16772].
+  * debian/control (Section): changed to non-free/utils [fails #3 of DFSG].
+  * debian/control (Maintainer): set to debian-qa list.
+  * debian/rules: rewritten.
+
+ -- James Troup <jjtroup@comp.brad.ac.uk>  Wed,  4 Mar 1998 02:17:57 +0000
+
+zoo (2.10-4) unstable; urgency=low
+
+  * Rebuilt for libc6.
+
+ -- James Troup <jjtroup@comp.brad.ac.uk>  Wed, 25 Jun 1997 17:04:23 +0000
+
+zoo (2.10-3) unstable; urgency=low
+
+  * New maintainer.
+  * Updated package to standards version 2.1.1.2.
+  * Removed executables from source package.
+  * Added better linux support, fixes bug #3961 and #4904.
+
+ -- James Troup <jjtroup@comp.brad.ac.uk>  Wed, 22 Jan 1997 02:18:51 +0000
--- zoo-2.10.orig/debian/watch
+++ zoo-2.10/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/\.// \
+   http://www.ibiblio.org/pub/packages/ccic/software/unix/utils/zoo(.*)\.tar\.gz
--- zoo-2.10.orig/debian/control
+++ zoo-2.10/debian/control
@@ -0,0 +1,20 @@
+Source: zoo
+Section: utils
+Priority: optional
+Build-Depends: debhelper (>= 5.0.0), dpatch (>= 2.0.10)
+Maintainer: Jose Carlos Medeiros <debian@psabs.com.br>
+Uploaders: Ola Lundqvist <opal@debian.org>
+Standards-Version: 3.6.2
+
+Package: zoo
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: manipulate zoo archives
+ Zoo is used to create and maintain collections of files in compressed
+ form.  It uses a Lempel-Ziv compression algorithm that gives space
+ savings in the range of 20% to 80% depending on the type of file data.
+ Zoo can store and selectively extract multiple generations of the same
+ file.
+ .
+ This package exists for its historical value. If you are looking for
+ a compression tool for serious use, check tar and gzip.
--- zoo-2.10.orig/debian/rules
+++ zoo-2.10/debian/rules
@@ -0,0 +1,94 @@
+#!/usr/bin/make -f
+# debian/rules file - for zoo (2.1).
+# Based on sample debian.rules file - for GNU Hello (1.3).
+# Copyright 1994,1995 by Ian Jackson.
+# Copyright 1997,1998 by James Troup.
+# Copyright 1998,1999,2000 by Petr Èech.
+# Copyright 2005 by Jose Carlos N. Medeiros.
+# I hereby give you perpetual unlimited permission to copy,
+# modify and relicense this file, provided that you do not remove
+# my name from the file itself.  (I assert my moral right of
+# paternity under the Copyright, Designs and Patents Act 1988.)
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+#export DH_OPTIONS
+
+CFLAGS = -Wall
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL += -s
+endif
+
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+PACKAGE = zoo
+
+# Include dpatch stuff.
+include /usr/share/dpatch/dpatch.make
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp patch
+	dh_testdir
+
+	echo $(DEB_HOST_ARCH)
+ifeq ($(DEB_HOST_ARCH),amd64)
+	$(MAKE) OPTIM="$(CFLAGS)" linux64
+else
+	$(MAKE) OPTIM="$(CFLAGS)" linux
+endif
+	touch build-stamp
+
+clean: unpatch
+	dh_testdir
+	dh_testroot
+	-$(MAKE) -i clean
+	dh_clean build-stamp configure-stamp zoo fiz
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+	# Add here commands to install the package into debian/zoo.
+	install -m 755 -s zoo fiz debian/zoo/usr/bin
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs 
+	dh_installdocs
+	dh_installman fiz.1 zoo.1
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
--- zoo-2.10.orig/debian/copyright
+++ zoo-2.10/debian/copyright
@@ -0,0 +1,64 @@
+This is Debian GNU/Linux's prepackaged version of the zoo archiver.
+
+This package was put together by James Troup from the original 
+source obtained from: 
+  http://www.ibiblio.org/pub/packages/ccic/software/unix/utils/zoo210.tar.gz
+ 
+From May 1998 to July 2004 it was maintained by Petr Èech and
+currently it is maintained by Niklas Vainio <nvainio+deb@iki.fi>
+
+Copyright and license:
+
+Zoo was written by Rahul Dhesi. He has now released it into the public
+domain:
+
+
+Return-Path: <dhesi@rahul.net>
+Date: Sat, 19 Jun 2004 13:50:26 -0700 (PDT)
+From: dhesi@rahul.net
+To: Niklas Vainio <nvainio@iki.fi>
+Subject: Re: License of Zoo
+
+Hi, the last release of the zoo archive program was marked entirely
+public domain, with no restrictions.  I'm sure this statement will be
+found somewhere in the files in the sources.  If not, I hope this email
+will suffice:  everything in the zoo package is entirely public domain,
+with no restrictions whatsoever.
+
+Rahul
+
+
+On Sat, 19 Jun 2004, Niklas Vainio wrote:
+
+> Dear Rahul Dhesi,
+> 
+> The Zoo archiving program you wrote, is part of the Debian GNU/Linux system,
+> in its unofficial section called "non-free". I'm asking you to relax licence
+> conditions of Zoo a bit to make it free software and allow it to move into
+> the official Debian distribution.
+> 
+> Zoo licensing conditions have two clauses that make it non-free software.
+> Those clauses are the following:
+> 
+> "(b) do not create, whether deliberately or through negligence, any 
+> derivative work that violates the compatibility goals describe in the
+> reference manual for zoo 2.1,"
+> 	       
+> "(d) make the fully commented source code of the derivative work available
+> to me at no cost if I so request, and make no attempt to restrict the
+> distribution or use of this source code."
+> 
+> Of course this is more of historical interest than any actual need, but
+> would you please consider licensing Zoo under a free license?
+> 
+> Best regards,
+>     - Nikke, a Debian volunteer
+> 
+> -- 
+> Niklas Vainio <niklas.vainio@iki.fi>
+> 
+
+
+
+
+
--- zoo-2.10.orig/debian/dirs
+++ zoo-2.10/debian/dirs
@@ -0,0 +1 @@
+usr/bin
--- zoo-2.10.orig/debian/README.debian
+++ zoo-2.10/debian/README.debian
@@ -0,0 +1,11 @@
+The linux target I created was based on the bsd 4.3 target, with the
+following differences :-
+
+     Linux has strchr().
+     Linux signal handler returns void data type.
+     (Debian GNU/)Linux uses stdarg.h in preference to varags.h.
+     Linux has memmove().
+     (Debian GNU/)Linux uses ansi C compilers (required for stdarg.h).
+     Linux malloc() returns a void pointer.
+     Linux has vprintf().
+