changeset 4301:641e8bb76038

6500984 *cpio* issue with directory creation
author js198686
date Wed, 23 May 2007 13:18:51 -0700
parents d74de773d6e6
children 8e8bdcde8406
files usr/src/cmd/cpio/cpio.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/cpio/cpio.c	Wed May 23 08:51:42 2007 -0700
+++ b/usr/src/cmd/cpio/cpio.c	Wed May 23 13:18:51 2007 -0700
@@ -5300,7 +5300,15 @@
 		} else { /* directory must be specified */
 			if (largc != 1)
 				Error_cnt++;
-			else if (access(*largv, 2) < 0)
+			else if (access(*largv, 2) < 0 && (errno != EACCES))
+				/*
+				 * EACCES is ignored here as it may occur
+				 * when any directory component of the path
+				 * does not have write permission, even though
+				 * the destination subdirectory has write
+				 * access. Writing to a read only directory
+				 * is handled later, as in "copy in" mode.
+				 */
 				msg(ERRN,
 				    "Error during access() of \"%s\"", *largv);
 		}