[Rpm-maint] [patch] don't exit with status 255

Michal Marek mmarek at suse.cz
Mon Feb 11 16:03:22 UTC 2008


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.

Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: exit-status.patch
Type: text/x-patch
Size: 416 bytes
Desc: not available
Url : http://lists.rpm.org/pipermail/rpm-maint/attachments/20080211/262bf695/attachment-0001.bin 


More information about the Rpm-maint mailing list