Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70277 - zdiff bug in gzip-1.3.5-r2
Summary: zdiff bug in gzip-1.3.5-r2
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-06 09:48 UTC by Michael Moen
Modified: 2005-01-06 18:39 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Moen 2004-11-06 09:48:54 UTC
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
Comment 1 solar (RETIRED) gentoo-dev 2004-11-17 13:34:09 UTC
gzip-r4 in the tree. No patch for this. Remains problem (security bug?)
Comment 2 Florian Schilhabel (RETIRED) gentoo-dev 2004-11-18 06:02:12 UTC
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 "$2" > $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
Comment 3 SpanKY gentoo-dev 2004-12-12 20:33:18 UTC
fixed in 1.3.5-r4
Comment 4 Michael Moen 2004-12-15 22:46:32 UTC
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't have a working version of gzip.
Comment 5 SpanKY gentoo-dev 2005-01-04 11:28:15 UTC
fixed in gzip-1.3.5-r5
Comment 6 Michael Moen 2005-01-06 18:39:43 UTC
Confirmed fixed in gzip-1.3.5-r5