Bug 8330

Summary: tar 1.13.16 doesn't always ignore failed read during incremental archive build
Product: [Retired] Red Hat Linux Reporter: Jonathan Kamens <jik>
Component: tarAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: gp
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-01-20 21:57:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jonathan Kamens 2000-01-10 13:40:10 UTC
Tar 1.13.16 doesn't always ignore a failed read when it encounters one
while building an incremental archive, when --ignore-failed-read is set.
Here's a patch (not fully tested, but it's pretty straightforward):

--- src/incremen.c.orig	Mon Jan 10 08:40:42 2000
+++ src/incremen.c	Mon Jan 10 08:41:54 2000
@@ -228,7 +228,10 @@

 	      if (deref_stat (dereference_option, name_buffer, &stat_data))
 		{
-		  stat_error (name_buffer);
+                  if (ignore_failed_read_option && (errno == ENOENT))
+                    stat_warn (name_buffer);
+                  else
+                    stat_error (name_buffer);
 		  continue;
 		}

Comment 1 Bernhard Rosenkraenzer 2000-01-11 14:26:59 UTC
Should be fixed in 1.3.17.

Comment 2 Jonathan Kamens 2000-01-13 14:26:59 UTC
I found another place where failed reads are not ignored and should be.  Here's
an updated patch which covers both cases.

--- tar-1.13.16/src/incremen.c	Fri Dec 10 14:41:30 1999
+++ tar-1.13.16.new/src/incremen.c	Thu Jan 13 09:12:40 2000
@@ -228,7 +228,10 @@

 	      if (deref_stat (dereference_option, name_buffer, &stat_data))
 		{
-		  stat_error (name_buffer);
+                  if (ignore_failed_read_option && (errno == ENOENT))
+                    stat_warn (name_buffer);
+                  else
+                    stat_error (name_buffer);
 		  continue;
 		}

--- tar-1.13.16/src/names.c	Wed Dec  8 18:14:28 1999
+++ tar-1.13.16.new/src/names.c	Thu Jan 13 09:28:09 2000
@@ -822,7 +822,10 @@

       if (deref_stat (dereference_option, name->name, &statbuf) != 0)
 	{
-	  stat_error (name->name);
+          if (ignore_failed_read_option && (errno == ENOENT))
+            stat_warn (name->name);
+          else
+            stat_error (name->name);
 	  continue;
 	}
       if (S_ISDIR (statbuf.st_mode))

Comment 3 Jonathan Kamens 2000-01-20 21:57:59 UTC
Neither the fix to incremen.c nor the fix to names.c appears in 1.13.17.

Comment 4 Bernhard Rosenkraenzer 2000-10-05 10:42:50 UTC
Thanks, fixed in 1.3.17-10