diff options
author | obache <obache@pkgsrc.org> | 2007-01-05 13:20:54 +0000 |
---|---|---|
committer | obache <obache@pkgsrc.org> | 2007-01-05 13:20:54 +0000 |
commit | e77b4c1f3f01157110a79ce0dfe8603caa895937 (patch) | |
tree | 4d39315fe70b1638c4e7f1fa6cbe81e5e249a262 /sysutils | |
parent | a105f1ecc1badc98bf868f3a03d7c979961a9f95 (diff) | |
download | pkgsrc-e77b4c1f3f01157110a79ce0dfe8603caa895937.tar.gz |
Prevent amverify from looping forever. Patch provided by Jean-Louis
Martineau on amanda-users:
http://groups.yahoo.com/group/amanda-users/message/55099
Pointed out by Jukka Salmi in PR 35361.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/amanda-server/Makefile | 4 | ||||
-rw-r--r-- | sysutils/amanda-server/distinfo | 4 | ||||
-rw-r--r-- | sysutils/amanda-server/patches/patch-an | 78 | ||||
-rw-r--r-- | sysutils/amanda-server/patches/patch-ao | 26 |
4 files changed, 109 insertions, 3 deletions
diff --git a/sysutils/amanda-server/Makefile b/sysutils/amanda-server/Makefile index 4d787a970ed..b70f406233a 100644 --- a/sysutils/amanda-server/Makefile +++ b/sysutils/amanda-server/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.38 2006/05/26 13:19:38 joerg Exp $ +# $NetBSD: Makefile,v 1.39 2007/01/05 13:20:54 obache Exp $ PKGNAME= amanda-server-${VERS} -PKGREVISION= 4 +PKGREVISION= 5 SVR4_PKGNAME= amase COMMENT= Server part of Amanda, a network backup system diff --git a/sysutils/amanda-server/distinfo b/sysutils/amanda-server/distinfo index 817b24d2d96..eadb2899859 100644 --- a/sysutils/amanda-server/distinfo +++ b/sysutils/amanda-server/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.9 2006/01/22 04:36:55 joerg Exp $ +$NetBSD: distinfo,v 1.10 2007/01/05 13:20:54 obache Exp $ SHA1 (amanda-2.4.4p4.tar.gz) = e44b40ea0f8e51336716ab455b27c69f4616d7f6 RMD160 (amanda-2.4.4p4.tar.gz) = d145a5ebb0df340af6aee0e8a15da6b54dfb3051 @@ -16,3 +16,5 @@ SHA1 (patch-aj) = f7c33a543a015e282ba9836ffa2c5c501a2bddcb SHA1 (patch-ak) = 9555f098dc705a7af9004e6fd3d4d259705a9935 SHA1 (patch-al) = dfd85511e2441be2f4a7428ee964310f3fd5374c SHA1 (patch-am) = 4949524ff94afa54c0c5ad7cd4bb673c51f73815 +SHA1 (patch-an) = a7a6d2777e94d06eba8bf51857b95043a65be6e4 +SHA1 (patch-ao) = 553a724fbe3422397ea9473c7d59b1139eca224f diff --git a/sysutils/amanda-server/patches/patch-an b/sysutils/amanda-server/patches/patch-an new file mode 100644 index 00000000000..74e414ed008 --- /dev/null +++ b/sysutils/amanda-server/patches/patch-an @@ -0,0 +1,78 @@ +$NetBSD: patch-an,v 1.1 2007/01/05 13:20:54 obache Exp $ + +Prevent amverify from looping forever. Patch provided by Jean-Louis +Martineau on amanda-users: +http://groups.yahoo.com/group/amanda-users/message/55099 + +--- restore-src/amrestore.c.orig 2003-02-10 15:22:11.000000000 +0000 ++++ restore-src/amrestore.c +@@ -482,6 +482,7 @@ char **argv; + char *e; + char *err; + char *label = NULL; ++ int count_error; + + for(fd = 3; fd < FD_SETSIZE; fd++) { + /* +@@ -667,25 +668,29 @@ char **argv; + get_pname()); + } + +- while(file.type == F_TAPESTART || file.type == F_DUMPFILE) { +- amfree(filename); +- filename = make_filename(&file); ++ count_error=0; ++ while(count_error < 10) { ++ if(file.type == F_TAPEEND) break; + found_match = 0; +- for(me = match_list; me; me = me->next) { +- if(disk_match(&file,me->datestamp,me->hostname,me->diskname) != 0) { +- found_match = 1; +- break; ++ if(file.type == F_DUMPFILE) { ++ amfree(filename); ++ filename = make_filename(&file); ++ for(me = match_list; me; me = me->next) { ++ if(disk_match(&file,me->datestamp,me->hostname,me->diskname) != 0) { ++ found_match = 1; ++ break; ++ } ++ } ++ fprintf(stderr, "%s: %3d: %s ", ++ get_pname(), ++ file_number, ++ found_match ? "restoring" : "skipping"); ++ if(file.type != F_DUMPFILE) { ++ print_header(stderr, &file); ++ } else { ++ fprintf(stderr, "%s\n", filename); + } + } +- fprintf(stderr, "%s: %3d: %s ", +- get_pname(), +- file_number, +- found_match ? "restoring" : "skipping"); +- if(file.type != F_DUMPFILE) { +- print_header(stderr, &file); +- } else { +- fprintf(stderr, "%s\n", filename); +- } + if(found_match) { + restore(&file, filename, isafile); + if(compress_pid > 0) { +@@ -718,6 +723,7 @@ char **argv; + if((tapedev = tape_open(tapename, 0)) < 0) { + error("could not open %s: %s", tapename, strerror(errno)); + } ++ count_error++; + } else { + /* + * If the last read got something (even an error), we can +@@ -726,6 +732,7 @@ char **argv; + if(tapefd_fsf(tapedev, 1) < 0) { + error("could not fsf %s: %s", tapename, strerror(errno)); + } ++ count_error=0; + } + file_number++; + read_file_header(&file, isafile); diff --git a/sysutils/amanda-server/patches/patch-ao b/sysutils/amanda-server/patches/patch-ao new file mode 100644 index 00000000000..490261c47f1 --- /dev/null +++ b/sysutils/amanda-server/patches/patch-ao @@ -0,0 +1,26 @@ +$NetBSD: patch-ao,v 1.1 2007/01/05 13:20:54 obache Exp $ + +Prevent amverify from looping forever. Patch provided by Jean-Louis +Martineau on amanda-users: +http://groups.yahoo.com/group/amanda-users/message/55099 + +--- server-src/amverify.sh.in.orig 2004-10-04 11:47:06.000000000 +0000 ++++ server-src/amverify.sh.in +@@ -428,6 +428,7 @@ while [ $SLOT -lt $SLOTS ]; do + FILE=`grep restoring $TEMP/amrestore.out \ + | sed 's/^.*restoring //'` + EOF=`grep "reached end of tape" $TEMP/amrestore.out` ++ EOI=`grep "reached end of information" $TEMP/amrestore.out` + # amrestore: 0: restoring sundae._mnt_sol1_usr.19961127.1 + if [ X"$FILE" != X"" -a X"$RESULT" = X"0" ]; then + report "Checked $FILE" +@@ -436,6 +437,9 @@ while [ $SLOT -lt $SLOTS ]; do + elif [ -n "$EOF" ]; then + report "End-of-Tape detected." + break ++ elif [ -n "$EOI" ]; then ++ report "End-of-Information detected." ++ break + else + report "** Error detected ($FILE)" + echo "$VOLUME ($FILE):" >>$DEFECTS |