Bug #2730
closedtar misbehaves if compress utility missing
100%
Description
tar doesn't deal well with the situation where bzip2 or gzip (and in the future xz) are missing.
IMO, we should deal with that exec failing better, but that might be hard to do. The most likely failure mode is the utility is absent or doesn't have the right mode bits, so if we just stat() before we fork() and exec(), that would go very far in covering the most likely error cases.
This is important as these utilities cross consolidation and packaging boundaries, and some distros might elect not to install them.
More detail from Milan:
$ LC_ALL=C tar tf t.tar.xz
tar: Could not exec /usr/bin/xzcat: No such file or directory
tar: blocksize = 0
$ LC_ALL=C tar cvJf t.tar.xz nscd
Compressing 't.tar.xz' with '/usr/bin/xz'...
tar: Could not exec /usr/bin/xz: No such file or directory
a nscd 0K
a nscd/getprinter.c 2K
a nscd/gethost.c 3K
a nscd/cache.o 31K
This ends in empty file, ending in the middle of work.
Returns error 141.
The same as in case of gzip/bzip2 missing. No change in behavior.
Probably it could be improved but nobody cared yet.
Files
Updated by Milan Jurik about 10 years ago
- Status changed from New to In Progress
- Assignee set to Milan Jurik
stat() is the necessary first step. The other would be better monitoring of return values from compress tools. The third is better error reporting.
Updated by Milan Jurik almost 10 years ago
- File verify_tar.diff verify_tar.diff added
- Status changed from In Progress to Pending RTI
- % Done changed from 0 to 100
Basics implemented. More precise detection of return values and handling of temporary tarfiles during update need some additional steps and small redesign.
Updated by Garrett D'Amore almost 10 years ago
- Status changed from Pending RTI to Resolved
Resolved in:
changeset: 13710:3cee4ba952f0
tag: tip
user: Milan Jurik <milan.jurik@xylab.cz>
date: Tue Jun 05 10:09:55 2012 -0700
description:
2730 tar misbehaves if compress utility missing
2731 add -a --auto feature to tar for gtar comptability
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Garrett D'Amore <garrett@damore.org>