Bug 51817 - app-arch/par2cmdline v0.4: wildcard expansion fix
|
Bug#:
51817
|
Product: Gentoo Linux
|
Version: unspecified
|
Platform: All
|
|
OS/Version: All
|
Status: RESOLVED
|
Severity: normal
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: maintainer-needed@gentoo.org
|
Reported By: bugs-gentoo.org@scientician.net
|
|
Component: Ebuilds
|
|
|
URL:
|
|
Summary: app-arch/par2cmdline v0.4: wildcard expansion fix
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2004-05-23 05:50 0000
|
Hi,
Version 0.4 of par2cmdline contains a bug whereby wildcard expansion on UNIX systems results in directories (and other non-regular files like sockets, character devices, etc.) being added to the file list. The par2 executable subsequently fails because it cannot handle such cases.
The attached patch fixes this issue. The patch has been submitted to the SourceForge bug tracking system for inclusion into the next version, but it is unclear when/if this will happen (there does not seem to have been too much recent activity on the part of the developer, so it may take a while...), so I think it might be good to put the patch into portage.
I've also attached a revised ebuild; the only change is the addition of the src_unpack() function.
Cheers,
Bardur: could you please email the upstream author about your patch?
I'm not certain what the correct behavior should be.
My gut feeling is that it should throw an error or warning rather than siliently work around it.
Well, the was a similar bug in the Win32 version which is detailed here:
http://sourceforge.net/tracker/index.php?func=detail&aid=892377&group_id=30568&atid=399698
See also this bug report (which is mine):
https://sourceforge.net/tracker/index.php?func=detail&aid=958902&group_id=30568&atid=399698
In the last comment on the Win32-related bug (which was filed against 0.3), the developer suggests that he will change the behavior such that it will ignore directories specified on the command line. I haven't checked to see if he has actually changed this yet (and if so, whether it is _silently_ ignored or not).
The trouble with the current behavior is that there is no workaround. This makes it impossible to add more files than can fit on a command-line. With 'find' and 'xargs' it is possible to add a number of files up to the command line length limit, but IIRC xargs cannot be told to die if it needs to use more than 1 command line; so in this case you get even more dangerous silent errors because some *files* will just be missing from the .par2 'archive'.
Another annoying problem is that it is impossible to use wildcards like '*' in directories which contain subdirectories.
Btw, I don't think silently ignoring specials/directories is as dangerous as you might think, since the par2 executable explicitly shows each file added to the 'archive'. There is also the fact that adding anything but regular files to archives doesn't make sense, and since the wildcards were never recursive to begin with I felt that silently ignoring directories/specials would be fine.
But in any case, I've added code which emits warnings whenever a directory/special is omitted and uploaded the new patch.
Created an attachment (id=84110) [details]
shell expanded wildcard patch for par2cmdline
This is Still a bug... I just figured out what's missing my self, and this is
my shot at the patch...
the par2cmdline-0.4-r1.ebuild is the one I'm currently using...
This patch fixes the case of the wildcards being expanded by the shell, instead
of par2. The previous patches seem to work inside of par2 if you manage to
pass it * instead of \* or '*'. (Which is the best I could do when trying to
pass par2 all it's arguments inside of a single argument to a shellscript.)