summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn.Zolnowsky@Sun.COM <none@none>2010-05-10 11:04:39 -0700
committerJohn.Zolnowsky@Sun.COM <none@none>2010-05-10 11:04:39 -0700
commitc690e8405e15b1fe6f49347caf4294a3b199f2f3 (patch)
tree907a094937b575094d8a9e3be747b2258fcf5a0b
parent44a1e32bde5a1d90bb3fa4cdd6d367951a6ed82d (diff)
downloadillumos-gate-c690e8405e15b1fe6f49347caf4294a3b199f2f3.tar.gz
6933243 Systemwide bart(1M) manifests do not include data for all files & dirs on systems with zones running
-rw-r--r--usr/src/cmd/bart/create.c31
-rw-r--r--usr/src/cmd/bart/msgs.h14
2 files changed, 25 insertions, 20 deletions
diff --git a/usr/src/cmd/bart/create.c b/usr/src/cmd/bart/create.c
index 5a7d692420..da9b10b1fb 100644
--- a/usr/src/cmd/bart/create.c
+++ b/usr/src/cmd/bart/create.c
@@ -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 @@ create_manifest_rule(char *reloc_root, FILE *rule_fp)
}
/*
- * 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 @@ walker(const char *name, const struct stat64 *sp, int type, struct FTW *ftwx)
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 */
diff --git a/usr/src/cmd/bart/msgs.h b/usr/src/cmd/bart/msgs.h
index a347ac856a..3e31605e1f 100644
--- a/usr/src/cmd/bart/msgs.h
+++ b/usr/src/cmd/bart/msgs.h
@@ -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 \