Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://amanda.svn.sourceforge.net/svnroot/amanda/amanda/trunk@27 a8d146d6-cc15-0410-8900-af154a0219e0
- Loading branch information
Jean-Louis Martineau
committed
Sep 11, 2006
1 parent
cf0e0be
commit a9ddb76
Showing
3 changed files
with
321 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
Index: regex2.h | ||
=================================================================== | ||
RCS file: /homes/amcore/cvsroot/amanda-2/regex-src/regex2.h,v | ||
retrieving revision 1.2 | ||
retrieving revision 1.4 | ||
diff -u -r1.2 -r1.4 | ||
--- regex2.h 1997/09/30 06:28:57 1.2 | ||
+++ regex2.h 1997/11/07 20:43:30 1.4 | ||
@@ -44,28 +44,40 @@ | ||
#define OP(n) ((n)&OPRMASK) | ||
#define OPND(n) ((n)&OPDMASK) | ||
#define SOP(op, opnd) ((op)|(opnd)) | ||
+ | ||
+#ifndef UNSIGNEDLONG1 | ||
+#ifndef NO_UL_CNSTS | ||
+#define UNSIGNEDLONG1 1ul | ||
+#else | ||
+#define UNSIGNEDLONG1 ((unsigned long)1) | ||
+#endif | ||
+#endif | ||
+ | ||
+#define MAKE_UNSIGNED_LONG(num) (UNSIGNEDLONG1*num) | ||
+#define SHIFTED_UL(num) (MAKE_UNSIGNED_LONG(num) << OPSHIFT) | ||
+ | ||
/* operators meaning operand */ | ||
/* (back, fwd are offsets) */ | ||
-#define OEND (1ul<<OPSHIFT) /* endmarker - */ | ||
-#define OCHAR (2ul<<OPSHIFT) /* character unsigned char */ | ||
-#define OBOL (3ul<<OPSHIFT) /* left anchor - */ | ||
-#define OEOL (4ul<<OPSHIFT) /* right anchor - */ | ||
-#define OANY (5ul<<OPSHIFT) /* . - */ | ||
-#define OANYOF (6ul<<OPSHIFT) /* [...] set number */ | ||
-#define OBACK_ (7ul<<OPSHIFT) /* begin \d paren number */ | ||
-#define O_BACK (8ul<<OPSHIFT) /* end \d paren number */ | ||
-#define OPLUS_ (9ul<<OPSHIFT) /* + prefix fwd to suffix */ | ||
-#define O_PLUS (10ul<<OPSHIFT) /* + suffix back to prefix */ | ||
-#define OQUEST_ (11ul<<OPSHIFT) /* ? prefix fwd to suffix */ | ||
-#define O_QUEST (12ul<<OPSHIFT) /* ? suffix back to prefix */ | ||
-#define OLPAREN (13ul<<OPSHIFT) /* ( fwd to ) */ | ||
-#define ORPAREN (14ul<<OPSHIFT) /* ) back to ( */ | ||
-#define OCH_ (15ul<<OPSHIFT) /* begin choice fwd to OOR2 */ | ||
-#define OOR1 (16ul<<OPSHIFT) /* | pt. 1 back to OOR1 or OCH_ */ | ||
-#define OOR2 (17ul<<OPSHIFT) /* | pt. 2 fwd to OOR2 or O_CH */ | ||
-#define O_CH (18ul<<OPSHIFT) /* end choice back to OOR1 */ | ||
-#define OBOW (19ul<<OPSHIFT) /* begin word - */ | ||
-#define OEOW (20ul<<OPSHIFT) /* end word - */ | ||
+#define OEND (SHIFTED_UL(1)) /* endmarker - */ | ||
+#define OCHAR (SHIFTED_UL(2)) /* character unsigned char */ | ||
+#define OBOL (SHIFTED_UL(3)) /* left anchor - */ | ||
+#define OEOL (SHIFTED_UL(4)) /* right anchor - */ | ||
+#define OANY (SHIFTED_UL(5)) /* . - */ | ||
+#define OANYOF (SHIFTED_UL(6)) /* [...] set number */ | ||
+#define OBACK_ (SHIFTED_UL(7)) /* begin \d paren number */ | ||
+#define O_BACK (SHIFTED_UL(8)) /* end \d paren number */ | ||
+#define OPLUS_ (SHIFTED_UL(9)) /* + prefix fwd to suffix */ | ||
+#define O_PLUS (SHIFTED_UL(10)) /* + suffix back to prefix */ | ||
+#define OQUEST_ (SHIFTED_UL(11)) /* ? prefix fwd to suffix */ | ||
+#define O_QUEST (SHIFTED_UL(12)) /* ? suffix back to prefix */ | ||
+#define OLPAREN (SHIFTED_UL(13)) /* ( fwd to ) */ | ||
+#define ORPAREN (SHIFTED_UL(14)) /* ) back to ( */ | ||
+#define OCH_ (SHIFTED_UL(15)) /* begin choice fwd to OOR2 */ | ||
+#define OOR1 (SHIFTED_UL(16)) /* | pt. 1 back to OOR1 or OCH_ */ | ||
+#define OOR2 (SHIFTED_UL(17)) /* | pt. 2 fwd to OOR2 or O_CH */ | ||
+#define O_CH (SHIFTED_UL(18)) /* end choice back to OOR1 */ | ||
+#define OBOW (SHIFTED_UL(19)) /* begin word - */ | ||
+#define OEOW (SHIFTED_UL(20)) /* end word - */ | ||
|
||
/* | ||
* Structure for [] character-set representation. Character sets are | ||
Index: regexec.c | ||
=================================================================== | ||
RCS file: /homes/amcore/cvsroot/amanda-2/regex-src/regexec.c,v | ||
retrieving revision 1.2 | ||
retrieving revision 1.4 | ||
diff -u -r1.2 -r1.4 | ||
--- regexec.c 1997/09/30 06:28:59 1.2 | ||
+++ regexec.c 1997/11/07 20:43:32 1.4 | ||
@@ -22,9 +22,9 @@ | ||
#define states long | ||
#define states1 states /* for later use in regexec() decision */ | ||
#define CLEAR(v) ((v) = 0) | ||
-#define SET0(v, n) ((v) &= ~(1ul << (n))) | ||
-#define SET1(v, n) ((v) |= 1ul << (n)) | ||
-#define ISSET(v, n) ((v) & (1ul << (n))) | ||
+#define SET0(v, n) ((v) &= ~(MAKE_UNSIGNED_LONG(1) << (n))) | ||
+#define SET1(v, n) ((v) |= (MAKE_UNSIGNED_LONG(1)) << (n)) | ||
+#define ISSET(v, n) ((v) & ((MAKE_UNSIGNED_LONG(1)) << (n))) | ||
#define ASSIGN(d, s) ((d) = (s)) | ||
#define EQ(a, b) ((a) == (b)) | ||
#define STATEVARS int dummy /* dummy version */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
This patch fixes Samba 2.0.0 up to 2.0.3, so that it does not overflow | ||
on filesystems larger than 2GB. The problem is fixed in newer | ||
releases of Samba. | ||
|
||
Index: client/client.c | ||
--- client/client.c 1999/01/27 19:37:27 1.125 | ||
+++ client/client.c 1999/03/30 10:25:18 1.128 | ||
@@ -101,7 +101,7 @@ | ||
int put_total_time_ms = 0; | ||
|
||
/* totals globals */ | ||
-int dir_total = 0; | ||
+static double dir_total; | ||
|
||
#define USENMB | ||
|
||
@@ -430,7 +430,7 @@ | ||
|
||
do_dskattr(); | ||
|
||
- DEBUG(3, ("Total bytes listed: %d\n", dir_total)); | ||
+ DEBUG(3, ("Total bytes listed: %.0f\n", dir_total)); | ||
} | ||
|
||
|
||
@@ -463,7 +463,7 @@ | ||
|
||
do_dskattr(); | ||
|
||
- DEBUG(0, ("Total number of bytes: %d\n", dir_total)); | ||
+ DEBUG(0, ("Total number of bytes: %.0f\n", dir_total)); | ||
} | ||
|
||
|
||
Index: client/clitar.c | ||
--- client/clitar.c 1999/02/03 16:30:54 1.67 | ||
+++ client/clitar.c 1999/03/30 10:41:07 1.70 | ||
@@ -85,7 +85,8 @@ | ||
#endif | ||
|
||
static char *tarbuf, *buffer_p; | ||
-static int tp, ntarf, tbufsiz, ttarf; | ||
+static int tp, ntarf, tbufsiz; | ||
+static double ttarf; | ||
/* Incremental mode */ | ||
BOOL tar_inc=False; | ||
/* Reset archive bit */ | ||
@@ -1486,7 +1487,7 @@ | ||
free(tarbuf); | ||
|
||
DEBUG(0, ("tar: dumped %d tar files\n", ntarf)); | ||
- DEBUG(0, ("Total bytes written: %d\n", ttarf)); | ||
+ DEBUG(0, ("Total bytes written: %.0f\n", (double)ttarf)); | ||
break; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
The first hunk in this file was submitted by Craig Wiegert | ||
<wiegert@quintessence.uchicago.edu>. It fixed a problem that causes | ||
GNUTAR to issue error messages like the following for sparse files: | ||
|
||
> /bin/tar: Read error at byte 0, reading 512 bytes, in file ./var/log/lastlog: Bad file number | ||
|
||
The others fix an estimate problem in GNUTAR on SunOS 4.1.3, HP/UX and | ||
other systems whose C libraries do not support "%lld" in printf format | ||
strings for printing long long integers. | ||
|
||
Patch follows. | ||
|
||
--- tar-1.12/src/create.c Mon Dec 15 17:26:47 1997 | ||
+++ tar-1.12/src/create.c Mon Dec 15 17:50:48 1997 | ||
@@ -1048,7 +1048,7 @@ | ||
} | ||
if (save_typeflag == GNUTYPE_SPARSE) | ||
{ | ||
- if (finish_sparse_file (f, &sizeleft, current_stat.st_size, p)) | ||
+ if (f < 0 || finish_sparse_file (f, &sizeleft, current_stat.st_size, p)) | ||
goto padit; | ||
} | ||
else | ||
--- tar-1.12/lib/Makefile.am Wed Apr 16 16:30:04 1997 | ||
+++ tar-1.12/lib/Makefile.am Mon Nov 17 06:45:43 1997 | ||
@@ -37,6 +37,9 @@ | ||
libtar_a_LIBADD = @ALLOCA@ @LIBOBJS@ | ||
libtar_a_DEPENDENCIES = $(libtar_a_LIBADD) | ||
|
||
+$(srcdir)/getdate.h: | ||
+ touch $@ | ||
+ | ||
# Say $(srcdir), so GNU make does not report an ambiguity with the .y.c rule. | ||
$(srcdir)/getdate.c: getdate.y | ||
@echo Expect 13 shift/reduce conflicts... | ||
--- tar-1.12/src/arith.h Wed Apr 16 18:02:57 1997 | ||
+++ tar-1.12/src/arith.h Mon Nov 17 05:47:33 1997 | ||
@@ -37,10 +37,10 @@ | ||
|
||
#if BITS_PER_BYTE * SIZEOF_UNSIGNED_LONG >= BITS_PER_TARLONG | ||
# define SUPERDIGIT 0 | ||
-# define TARLONG_FORMAT "%uld" | ||
+# define TARLONG_FORMAT "%lu" | ||
typedef unsigned long tarlong; | ||
#else | ||
-# if BITS_PER_BYTE * SIZEOF_LONG_LONG >= BITS_PER_TARLONG + 1 | ||
+# if PRINTF_LONG_LONG_WORKS && BITS_PER_BYTE * SIZEOF_LONG_LONG >= BITS_PER_TARLONG + 1 | ||
# define SUPERDIGIT 0 | ||
# define TARLONG_FORMAT "%lld" | ||
typedef long long tarlong; | ||
@@ -48,12 +48,12 @@ | ||
# if BITS_PER_BYTE * SIZEOF_UNSIGNED_LONG >= 64 | ||
# define SUPERDIGIT 1000000000L | ||
# define BITS_PER_SUPERDIGIT 29 | ||
-# define TARLONG_FORMAT "%09uld" | ||
+# define TARLONG_FORMAT "%09lu" | ||
# else | ||
# if BITS_PER_BYTE * SIZEOF_UNSIGNED_LONG >= 32 | ||
# define SUPERDIGIT 10000L | ||
# define BITS_PER_SUPERDIGIT 14 | ||
-# define TARLONG_FORMAT "%04uld" | ||
+# define TARLONG_FORMAT "%04lu" | ||
# endif | ||
# endif | ||
# endif | ||
--- tar-1.12/src/arith.c Wed Apr 23 23:25:57 1997 | ||
+++ tar-1.12/src/arith.c Mon Nov 17 08:11:11 1997 | ||
@@ -96,7 +96,7 @@ | ||
void | ||
add_to_tarlong_helper (unsigned long *accumulator, int value) | ||
{ | ||
- int counter; | ||
+ int counter, newvalue; | ||
|
||
if (value < 0) | ||
for (counter = 0; counter < LONGS_PER_TARLONG; counter++) | ||
@@ -106,8 +106,15 @@ | ||
accumulator[counter] += value; | ||
return; | ||
} | ||
- accumulator[counter] += value + SUPERDIGIT; | ||
- value = -1; | ||
+ newvalue = - ((-value-1) / SUPERDIGIT) -1; | ||
+ value = - ((-value) % SUPERDIGIT); | ||
+ accumulator[counter] += SUPERDIGIT + value; | ||
+ if (accumulator[counter] >= SUPERDIGIT) | ||
+ { | ||
+ accumulator[counter] -= SUPERDIGIT; | ||
+ ++newvalue; | ||
+ } | ||
+ value = newvalue; | ||
} | ||
else | ||
for (counter = 0; counter < LONGS_PER_TARLONG; counter++) | ||
@@ -117,8 +124,15 @@ | ||
accumulator[counter] += value; | ||
return; | ||
} | ||
- accumulator[counter] += value - SUPERDIGIT; | ||
- value = 1; | ||
+ newvalue = value / SUPERDIGIT; | ||
+ value = value % SUPERDIGIT; | ||
+ accumulator[counter] += value; | ||
+ if (accumulator[counter] >= SUPERDIGIT) | ||
+ { | ||
+ accumulator[counter] -= SUPERDIGIT; | ||
+ ++newvalue; | ||
+ } | ||
+ value = newvalue; | ||
} | ||
FATAL_ERROR ((0, 0, _("Arithmetic overflow"))); | ||
} | ||
@@ -155,7 +169,7 @@ | ||
while (counter > 0 && accumulator[counter] == 0) | ||
counter--; | ||
|
||
- fprintf (file, "%uld", accumulator[counter]); | ||
+ fprintf (file, "%lu", accumulator[counter]); | ||
while (counter > 0) | ||
fprintf (file, TARLONG_FORMAT, accumulator[--counter]); | ||
} | ||
--- tar-1.12/configure.in Fri Apr 25 17:02:46 1997 | ||
+++ tar-1.12/configure.in Mon Nov 17 06:17:49 1997 | ||
@@ -26,6 +26,35 @@ | ||
AC_CHECK_SIZEOF(unsigned long, 4) | ||
AC_CHECK_SIZEOF(long long, 0) | ||
|
||
+# SunOS 4.1.3's printf treats %lld as %ld | ||
+AC_CACHE_CHECK([whether printf understands %lld], | ||
+ tar_cv_printf_long_long_works, | ||
+ AC_TRY_RUN([[ | ||
+#include <stdio.h> | ||
+main() { | ||
+ long long foo = -1; | ||
+ char buf[1024]; | ||
+ while(foo) { | ||
+ long long bar = 0; | ||
+ sprintf(buf, "%lld", foo); | ||
+ sscanf(buf, "%lld", &bar); | ||
+ if (foo != bar) | ||
+ return 1; | ||
+ foo <<= 1; | ||
+ } | ||
+ return 0; | ||
+} | ||
+ ]], | ||
+ tar_cv_printf_long_long_works=yes, | ||
+ tar_cv_printf_long_long_works=no, | ||
+ if test x"$tar_cv_printf_long_long_works" = x; then | ||
+ tar_cv_printf_long_long_works=cross | ||
+ fi) | ||
+) | ||
+if test x"$tar_cv_printf_long_long_works" = x"yes"; then | ||
+ AC_DEFINE(PRINTF_LONG_LONG_WORKS) | ||
+fi | ||
+ | ||
AC_CHECK_HEADERS(fcntl.h limits.h linux/fd.h memory.h net/errno.h poll.h \ | ||
sgtty.h string.h stropts.h \ | ||
sys/buf.h sys/device.h sys/gentape.h sys/inet.h sys/io/trioctl.h sys/ioccom.h \ | ||
--- tar-1.12/acconfig.h Thu Apr 10 11:37:02 1997 | ||
+++ tar-1.12/acconfig.h Mon Nov 17 05:53:38 1997 | ||
@@ -86,3 +86,6 @@ | ||
|
||
/* Define to 1 if GNU regex should be used instead of GNU rx. */ | ||
#undef WITH_REGEX | ||
+ | ||
+/* Define to 1 if printf() supports "%lld" */ | ||
+#undef PRINTF_LONG_LONG_WORKS | ||
--- tar-1.12/configure | ||
+++ tar-1.12/configure | ||
@@ -1,2 +1,4 @@ | ||
#! /bin/sh | ||
+echo You must run autoheader and autoconf after installing this patch | ||
+exit 1 | ||
|