Re: Bug#514936: cpio does not use error codes on exit

View: New views
13 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: Bug#514936: cpio does not use error codes on exit

by Clint Adams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sergey,

On Wed, Feb 11, 2009 at 04:50:55PM -0800, Kees Cook wrote:

> It seems that cpio does not actually use the error codes it sets while
> running, and always exits with 0.  This will break anything that expects
> cpio to fail if it encounter problems (like, say, mkinitramfs).
>
> All the error handling code is in paxlib, which includes the "pax_exit()"
> function.  src/main.c's main should call pax_exit, not "exit (0)" like it
> currently does.
>
> Example:
>
> $ cd /tmp/busticated
> $ ls -lR
> .:
> total 4
> drwxr-xr-x 2 kees kees 4096 Feb 12 00:27 sbin
>
> ./sbin:
> total 0
> lrwxrwxrwx 1 kees kees 20 Feb 12 00:27 no-such-binary -> /sbin/no-such-binary
>
> What current happens with failures:
>
> $ find . | cpio -L -o > /tmp/archive.cpio
> cpio: ./sbin/no-such-binary: No such file or directory
> 1 block
> $ echo $?
> 0
>
> I would expect this instead:
>
> $ find . | cpio -L -o > /tmp/archive.cpio
> cpio: ./sbin/no-such-binary: No such file or directory
> 1 block
> $ echo $?
> 2
>
>
> Attached trivial patch changes the behavior...

[...]

> diff -u cpio-2.9/src/main.c cpio-2.9/src/main.c
> --- cpio-2.9/src/main.c
> +++ cpio-2.9/src/main.c
> @@ -801,3 +801,3 @@
>  
> -  exit (0);
> +  pax_exit ();
>  }



_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Re: Re: Bug#514936: cpio does not use error codes on exit

by Sergey Poznyakoff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Clint,

Thanks for reminding me. I'll apply this patch.

Regards,
Sergey


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Bug-cpio lost timestamp and lost owner in 2.9

by Bernd Kloss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Will this bug be fixed in debian-packages?

http://lists.gnu.org/archive/html/bug-cpio/2008-08/msg00002.html

Thank you

Bernd


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Re: Bug-cpio lost timestamp and lost owner in 2.9

by Sergey Poznyakoff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bernd Kloss <b_kloss@...> ha escrit:

> Will this bug be fixed in debian-packages?

I don't know. Please, ask Debian maintainer.

Regards,
Sergey


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Re: Bug-cpio lost timestamp and lost owner in 2.9

by Clint Adams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Feb 14, 2009 at 10:32:13PM +0200, Sergey Poznyakoff wrote:
> Bernd Kloss <b_kloss@...> ha escrit:
>
> > Will this bug be fixed in debian-packages?
>
> I don't know. Please, ask Debian maintainer.

Sorry, which Debian bug # is this?


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Re: Bug-cpio lost timestamp and lost owner in 2.9

by Bernd Kloss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Samstag, 14. Februar 2009 schrieben Sie:
> Bernd Kloss <b_kloss@...> ha escrit:
> > Will this bug be fixed in debian-packages?
>
> I don't know. Please, ask Debian maintainer.
>
> Regards,
> Sergey


Please excuse, but I don't know the procedures.

This bug exists in CPIO 2.9 delivered with Debian Lenny. I thought reporting
this bug against the CPIO maintainers would cause fixing the bug.

Are there newer versions of CPIO without this bug, so I could install that
from rpm?

Thank you
Bernd

> > The following problems occurred:
> >
> > For /tmp and /var/tmp the sticky bit is not being copied.
> >
> > All the homes belong to root:root with 755 instead of user:users.
>
> Hi, several months ago I ran into this too. (And it's known before
> that.) To work around, omit "-depth" in your find command; this loses
> timestamps of directories but sets bits right (if directories are
> created new during unpacking).
>
> (For reference,
> http://lists.gnu.org/archive/html/bug-cpio/2008-04/threads.html#00000


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Re: Bug-cpio lost timestamp and lost owner in 2.9

by Sergey Poznyakoff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bernd Kloss <b_kloss@...> ha escrit:

> Please excuse, but I don't know the procedures.

Neither do I. I am maintainer of GNU cpio and am not in any way related
or connected to Debian.

> This bug exists in CPIO 2.9 delivered with Debian Lenny. I thought reporting
> this bug against the CPIO maintainers would cause fixing the bug.

Yes, it does. But whether and when it will make it further into
particular distributions (such as Debian, Slackware, etc.) does
not depend on me. It depends only on people that package these
distributions.

> Are there newer versions of CPIO without this bug, so I could install that
> from rpm?

This bug has been fixed in the cpio repository. No official versions
have been released since then. I plan to release next version by the
end of this month. It will be available, as usual, from
ftp://ftp.gnu.org/gnu/cpio. If you wish, I can prepare a test tarball
for you.

Regards,
Sergey


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Re: Bug-cpio lost timestamp and lost owner in 2.9

by Clint Adams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Feb 14, 2009 at 11:37:51PM +0200, Sergey Poznyakoff wrote:
> This bug has been fixed in the cpio repository. No official versions
> have been released since then. I plan to release next version by the
> end of this month. It will be available, as usual, from
> ftp://ftp.gnu.org/gnu/cpio. If you wish, I can prepare a test tarball
> for you.

I have the following four patches which are still applicable to 2.9.90:

1) missing space in cpio.texi (fixed in CVS)
2) Robert Millan's patch to set O_BINARY where available
3) pack old_cpio_header and old_ascii_header structs to avoid breakage
   on old ARM ABI.
4) pax exit code stuff (fixed in git)

Do I recall correctly that #2 was to be fixed upstream a different way
or did I make that up?


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Re: Bug-cpio lost timestamp and lost owner in 2.9

by Mike Frysinger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Saturday 14 February 2009 21:42:48 Clint Adams wrote:
> 3) pack old_cpio_header and old_ascii_header structs to avoid breakage
>    on old ARM ABI.

while it shows up with ARM OABI, it's a general bug that can show up on other
systems as well.  if you're overlaying a random struct straight onto a file,
then it needs to be packed or the reading has to be done manually (i.e. copy
it one member at a time).
-mike


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

signature.asc (852 bytes) Download Attachment

Re: Bug-cpio lost timestamp and lost owner in 2.9

by Robert Millan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Feb 15, 2009 at 02:42:48AM +0000, Clint Adams wrote:

> On Sat, Feb 14, 2009 at 11:37:51PM +0200, Sergey Poznyakoff wrote:
> > This bug has been fixed in the cpio repository. No official versions
> > have been released since then. I plan to release next version by the
> > end of this month. It will be available, as usual, from
> > ftp://ftp.gnu.org/gnu/cpio. If you wish, I can prepare a test tarball
> > for you.
>
> I have the following four patches which are still applicable to 2.9.90:
>
> 1) missing space in cpio.texi (fixed in CVS)
> 2) Robert Millan's patch to set O_BINARY where available
> 3) pack old_cpio_header and old_ascii_header structs to avoid breakage
>    on old ARM ABI.
> 4) pax exit code stuff (fixed in git)
>
> Do I recall correctly that #2 was to be fixed upstream a different way
> or did I make that up?

Hi Clint,

I reviewed my mail archives.  Sergey said a patch was being fixed in a
different way, but it was not this one (it was the patch that introduced
initial mingw32 support).

The O_BINARY one was sent in early 2008:

  http://lists.gnu.org/archive/html/bug-cpio/2008-02/msg00000.html

--
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Re: Bug-cpio lost timestamp and lost owner in 2.9

by Clint Adams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Feb 14, 2009 at 11:37:51PM +0200, Sergey Poznyakoff wrote:
> have been released since then. I plan to release next version by the
> end of this month. It will be available, as usual, from

Is there a new estimate for this?



Re: Bug-cpio lost timestamp and lost owner in 2.9

by Clint Adams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Mar 26, 2009 at 06:01:25PM +0000, Clint Adams wrote:
> On Sat, Feb 14, 2009 at 11:37:51PM +0200, Sergey Poznyakoff wrote:
> > have been released since then. I plan to release next version by the
> > end of this month. It will be available, as usual, from
>
> Is there a new estimate for this?

Sergey?



Re: Bug-cpio lost timestamp and lost owner in 2.9

by Sergey Poznyakoff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Clint,

My apologies, I got terribly behind the schedule. I'm working on
the new release and expect to make it ready next week. This time
for sure :)

Regards,
Sergey