<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>70277</bug_id>
          
          <creation_ts>2004-11-06 09:48 0000</creation_ts>
          <short_desc>zdiff bug in gzip-1.3.5-r2</short_desc>
          <delta_ts>2005-01-06 18:39:43 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mi-gentoo@moensolutions.com</reporter>
          <assigned_to>base-system@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>mi-gentoo@moensolutions.com</who>
            <bug_when>2004-11-06 09:48:54 0000</bug_when>
            <thetext>When trying to use zdiff on 2 gzipped files (works fine when only one file is gzipped) you get the following error:

/bin/zdiff: line 54: /tmp/gzcuA0AB: cannot overwrite existing file

Possibly related to bug #68405

uname -a
Linux xxxx 2.4.25_pre7-gss-r2 #2 SMP Tue Mar 2 06:45:59 PST 2004 i686 AMD Athlon(tm) MP 2400+ AuthenticAMD GNU/Linux</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2004-11-17 13:34:09 0000</bug_when>
            <thetext>gzip-r4 in the tree. No patch for this. Remains problem (security bug?)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ruth@gentoo.org</who>
            <bug_when>2004-11-18 06:02:12 0000</bug_when>
            <thetext>hi,
i guess, the problem is here:
line 37:
tmp=`tempfile -d /tmp -p gz` || {
...
this actually _creates_ a temporary file...
and this behaviour of tempfile is the reason, why
line 53:
gzip -cdfq &quot;$2&quot; &gt; $tmp || exit
(correctly) refuses to extract to an existing file...

solution:

one could unlink the tempfile after creating it with tempfile
note, that this solution would introduce (theoretically) a race condition...
(an attacker knows the tempfilename after unlinking and _before_ actually writing to that file)
as gzip refuses to extract, if the file already exists, i guess this would be a 
good solution anyways...

further comments?

best regards
florian
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2004-12-12 20:33:18 0000</bug_when>
            <thetext>fixed in 1.3.5-r4</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mi-gentoo@moensolutions.com</who>
            <bug_when>2004-12-15 22:46:32 0000</bug_when>
            <thetext>Still does not work when comparing 2 gzipped files.

zdiff mysql-2004-11-13-170003.sql.gz mysql-2004-12-08-140005.sql.gz
/bin/zdiff: line 51: /tmp/mysql2004-12-08-140005.sql.gz.52jbkt: cannot overwrite existing file

And now that gzip-1.3.5-r1 has been removed from the tree I don&apos;t have a working version of gzip.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2005-01-04 11:28:15 0000</bug_when>
            <thetext>fixed in gzip-1.3.5-r5</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mi-gentoo@moensolutions.com</who>
            <bug_when>2005-01-06 18:39:43 0000</bug_when>
            <thetext>Confirmed fixed in gzip-1.3.5-r5</thetext>
          </long_desc>
      
    </bug>

</bugzilla>