6933243 Systemwide bart(1M) manifests do not include data for all files & dirs on systems with zones running
authorJohn.Zolnowsky@Sun.COM
Mon, 10 May 2010 11:04:39 -0700
changeset 12369 c277f6e4bc5b
parent 12368 679b134e4515
child 12370 56f486793f46
6933243 Systemwide bart(1M) manifests do not include data for all files & dirs on systems with zones running
usr/src/cmd/bart/create.c
usr/src/cmd/bart/msgs.h
--- a/usr/src/cmd/bart/create.c	Mon May 10 08:19:18 2010 -0700
+++ b/usr/src/cmd/bart/create.c	Mon May 10 11:04:39 2010 -0700
@@ -19,8 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 #include <signal.h>
@@ -257,11 +256,12 @@
 		}
 
 		/*
-		 * Walk the subtree and invoke the callback function
-		 * walker()
+		 * Walk the subtree and invoke the callback function walker()
+		 * Use FTW_ANYERR to get FTW_NS and FTW_DNR entries *and*
+		 * to continue past those errors.
 		 */
 		subtree_root = root;
-		(void) nftw64(root->subtree, &walker, 20, FTW_PHYS);
+		(void) nftw64(root->subtree, &walker, 20, FTW_PHYS|FTW_ANYERR);
 
 		/*
 		 * Ugly but necessary:
@@ -357,21 +357,28 @@
 				compute_chksum = 0;
 		}
 		break;
-	case FTW_SL:	/* symbolic link	*/
-	case FTW_DP:	/* end of directory	*/
-	case FTW_DNR:	/* unreadable directory	*/
-	case FTW_NS:	/* unstatable file	*/
+	case FTW_SL:	/* symbolic link, FTW_PHYS	*/
+	case FTW_SLN:	/* symbolic link, ~FTW_PHYS	*/
 		break;
-	case FTW_D:	/* enter directory 		*/
+	case FTW_DP:	/* end of directory, FTW_DEPTH	*/
+	case FTW_D:	/* enter directory, ~FTW_DEPTH	*/
 		dir_flag = B_TRUE;
 		ret = statvfs64(name, &path_vfs);
 		if (ret < 0)
 			eval_err = WARNING_EXIT;
 		break;
+	case FTW_NS:	/* unstatable file	*/
+		(void) fprintf(stderr, UNKNOWN_FILE, name);
+		eval_err = WARNING_EXIT;
+		return (0);
+	case FTW_DNR:	/* unreadable directory	*/
+		(void) fprintf(stderr, CANTLIST_DIR, name);
+		eval_err = WARNING_EXIT;
+		return (0);
 	default:
-		(void) fprintf(stderr, INVALID_FILE, name);
+		(void) fprintf(stderr, INTERNAL_ERR, name);
 		eval_err = WARNING_EXIT;
-		break;
+		return (0);
 	}
 
 	/* This is the function which really processes the file */
--- a/usr/src/cmd/bart/msgs.h	Mon May 10 08:19:18 2010 -0700
+++ b/usr/src/cmd/bart/msgs.h	Mon May 10 11:04:39 2010 -0700
@@ -2,9 +2,8 @@
  * CDDL HEADER START
  *
  * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
  *
  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  * or http://www.opensolaris.org/os/licensing.
@@ -20,22 +19,21 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 #ifndef	_MSGS_H
 #define	_MSGS_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #ifdef	__cplusplus
 extern "C" {
 #endif
 
 #define	SYNTAX_ERR	gettext("ERROR: Ignoring rules syntax error: %s\n")
 #define	SYNTAX_ABORT	gettext("ABORTING: Syntax error(s) in the rules file\n")
-#define	INVALID_FILE	gettext("WARNING: Ignoring invalid file: %s\n")
+#define	UNKNOWN_FILE	gettext("WARNING: unknown directory entry: %s\n")
+#define	CANTLIST_DIR	gettext("WARNING: cannot list directory: %s\n")
+#define	INTERNAL_ERR	gettext("WARNING: internal error at %s\n")
 #define	INVALID_SUBTREE	gettext("WARNING: Ignoring invalid subtree: %s\n")
 #define	RULES_ERR	gettext("ERROR: -r option requires a filename\n")
 #define	INPUT_ERR \