bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] error handling and exit code (patch for tar-1.20/1.21)


From: Solar Designer
Subject: [Bug-tar] error handling and exit code (patch for tar-1.20/1.21)
Date: Sun, 1 Mar 2009 02:58:20 +0300
User-agent: Mutt/1.4.2.3i

Sergey and all,

I'd like to submit upstream a patch from Openwall GNU/*/Linux that we
came up with in Nov-Dec 2008, and which we've extensively tested since
then (in production, doing nightly incremental backups of a network of
servers).  The patch is against GNU tar 1.20, and that's what it's been
tested with, but it applies to 1.21 as well (no rejects, no fuzz) and is
still fully relevant (as far as I can see).  I've attached it to this
message, and you can also find it (as well as other stuff) in our CVS
repository:

http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/tar/

Basically, the problem with tar, without this patch, was that its exit
code would not let us distinguish serious errors from benign ones (the
latter occur every night since the systems being backed up are live).

tar would often exit with TAREXIT_FAILURE rather than TAREXIT_DIFFERS
even on unimportant errors, such as a file in a deep directory
disappearing from under the running tar.  Clearly, this would force us
to ignore tar's exit code, yet we wanted to be informed of serious
errors (such as media I/O errors).

Presumably, everyone else who does incremental backups is ignoring tar's
exit code, and that's not great.

The patch also fixes an instance of "the opposite" problem - where tar
would potentially change its exit_status from TAREXIT_FAILURE (based on
a previous error) to TAREXIT_DIFFERS (forgetting that it had already run
into a more serious error).

Please have a look, comment, and consider for inclusion.

This effort was supported by CivicActions - http://civicactions.com -
and it took us quite some time to identify all those cases where tar
would return "the wrong" exit code.

Thanks,

Alexander Peslyak <solar at openwall.com>
GPG key ID: 5B341F15  fp: B3FB 63F4 D7A3 BCCC 6F6E  FC55 A2FC 027C 5B34 1F15
http://www.openwall.com - bringing security into open computing environments

Attachment: tar-1.20-owl-error-handling.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]