Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 51817
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Default Assignee for Orphaned Packages <maintainer-needed@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Bardur Arantsson <bugs-gentoo.org@scientician.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
par2cmdline-0.4-wildcard-fix.patch par2cmdline-0.4-wildcard-fix.patch patch Bardur Arantsson 2004-05-23 05:51 0000 1.42 KB Details | Diff
par2cmdline-0.4-r1.ebuild par2cmdline-0.4-r1.ebuild text/plain Bardur Arantsson 2004-05-23 05:51 0000 942 bytes Details
par2cmdline-0.4-wildcard-fix.patch par2cmdline-0.4-wildcard-fix-2.patch patch Bardur Arantsson 2004-05-24 00:07 0000 1.84 KB Details | Diff
par2cmdline.shellexpandedwildcard.patch shell expanded wildcard patch for par2cmdline patch Michael Evans 2006-04-07 00:28 0000 888 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 51817 depends on: Show dependency tree
Bug 51817 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   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,

------- Comment #1 From Bardur Arantsson 2004-05-23 05:51:07 0000 -------
Created an attachment (id=31883) [details]
par2cmdline-0.4-wildcard-fix.patch

------- Comment #2 From Bardur Arantsson 2004-05-23 05:51:56 0000 -------
Created an attachment (id=31884) [details]
par2cmdline-0.4-r1.ebuild

------- Comment #3 From Robin Johnson 2004-05-23 18:34:13 0000 -------
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.

------- Comment #4 From Bardur Arantsson 2004-05-24 00:06:29 0000 -------
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.

------- Comment #5 From Bardur Arantsson 2004-05-24 00:07:08 0000 -------
Created an attachment (id=31931) [details]
par2cmdline-0.4-wildcard-fix-2.patch

------- Comment #6 From SpanKY 2005-08-13 15:25:25 0000 -------
fixed in cvs, thanks

------- Comment #7 From Michael Evans 2006-04-07 00:28:41 0000 -------
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.)

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug