From: Timo Myyrä Subject: Re: fix error in zipnote of archivers/zip To: Theo Buehler Cc: Timo Myyrä , ports@openbsd.org Date: Thu, 03 Oct 2024 20:13:45 +0300 On Thu, Oct 03 2024, Theo Buehler wrote: > On Mon, Sep 23, 2024 at 09:09:30PM +0300, Timo Myyrä wrote: >> Hi, >> >> zipnote command currently fails: >> >> $ zipnote test.zip > test.tmp >> $ zipnote -w test.zip < test.tmp >> zipnote error: Bad file descriptor >> zipnote error: Temporary file failure (zi5N73U4) >> $ >> >> Patch this by back-porting fix from zip 3.1b seems to fix it. > > The patch looks correct to me. Where exactly did you get that from? I'm > not smart enough to navigate sourceforge. > > I'd like the patch to include a link to the source. > Good luck with that, I tried to find some version control access but did not find any. My zipnote debugging lead to https://www.linuxquestions.org/questions/linux-software-2/problems-with-zipnote-writing-to-files-4175502552/ which claims the zip31b patch. Verified that the zip31c archive has the fix in it but no direct link to bug or any version control. Timo >> >> Timo >> >> diff /usr/ports >> commit - 8fa0c6f48793582a907ff1930b5f32099b9038bc >> path + /usr/ports >> blob - c42012c631f1fa4a9a5877d0a51994bf078beee2 >> file + archivers/zip/Makefile >> --- archivers/zip/Makefile >> +++ archivers/zip/Makefile >> @@ -1,7 +1,7 @@ >> COMMENT= create/update ZIP files compatible with PKZip(tm) >> >> VERSION= 3.0 >> -REVISION= 2 >> +REVISION= 3 >> DISTNAME= zip${VERSION:S/.//} >> PKGNAME= zip-${VERSION} >> >> blob - /dev/null >> file + archivers/zip/patches/patch-zipnote_c (mode 644) >> --- /dev/null >> +++ archivers/zip/patches/patch-zipnote_c >> @@ -0,0 +1,12 @@ >> +Index: zipnote.c >> +--- zipnote.c.orig >> ++++ zipnote.c >> +@@ -661,7 +661,7 @@ char **argv; /* command line tokens */ >> + if ((r = zipcopy(z)) != ZE_OK) >> + ziperr(r, "was copying an entry"); >> + } >> +- fclose(x); >> ++ fclose(in_file); >> + >> + /* Write central directory and end of central directory with new comments */ >> + if ((c = zftello(y)) == (zoff_t)-1) /* get start of central */ >> >>