On Mon, 11 Feb 2008, Michal Marek wrote:

Hi,

rpm sometimes doesn't work well with xargs:

$ touch /tmp/a
$ perl -e 'print "/tmp/a "x100000 . "/bin/sh";' | xargs rpm -qf  | tail
xargs: rpm: exited with status 255; aborting
file /tmp/a is not owned by any package
file /tmp/a is not owned by any package
file /tmp/a is not owned by any package
file /tmp/a is not owned by any package
file /tmp/a is not owned by any package
file /tmp/a is not owned by any package
file /tmp/a is not owned by any package
file /tmp/a is not owned by any package
file /tmp/a is not owned by any package
file /tmp/a is not owned by any package

From xargs(1):
 If any invocation of the command exits with a status of 255, xargs will
 stop  immediately  without reading any further input.  An error message
 is issued on stderr when this happens.
.

Given that the actual value of the exit status can't be relied upon by
scripts anyway, limiting it to 254 shouldn't break anything. Patch attached.

It'll break if somebody is abusing 255 return code as "everything got installed" with number of args >= 255, but like you said it's totally unreliable anyway...

Applied, thanks.

        - Panu -
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to