4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
40 #include <sys/types.h>
47 #define WARNING_EXIT 1
51 #define EXCLUDE_SKIP 1
52 #define EXCLUDE_PRUNE 2
57 #define CHECK_KEYWORD(s) (strcmp(s, "CHECK") == 0)
58 #define IGNORE_KEYWORD(s) (strcmp(s, "IGNORE") == 0)
60 #define ALL_KEYWORD "all"
61 #define CONTENTS_KEYWORD "contents"
62 #define TYPE_KEYWORD "type"
63 #define SIZE_KEYWORD "size"
64 #define MODE_KEYWORD "mode"
65 #define ACL_KEYWORD "acl"
66 #define UID_KEYWORD "uid"
67 #define GID_KEYWORD "gid"
68 #define MTIME_KEYWORD "mtime"
69 #define LNMTIME_KEYWORD "lnmtime"
70 #define DIRMTIME_KEYWORD "dirmtime"
71 #define DEST_KEYWORD "dest"
72 #define DEVNODE_KEYWORD "devnode"
73 #define ADD_KEYWORD "add"
74 #define DELETE_KEYWORD "delete"
76 #define MANIFEST_VER "! Version 1.0\n"
77 #define FORMAT_STR "# Format:\n\
78 #fname D size mode acl dirmtime uid gid\n\
79 #fname P size mode acl mtime uid gid\n\
80 #fname S size mode acl mtime uid gid\n\
81 #fname F size mode acl mtime uid gid contents\n\
82 #fname L size mode acl lnmtime uid gid dest\n\
83 #fname B size mode acl mtime uid gid devnode\n\
84 #fname C size mode acl mtime uid gid devnode\n"
87 * size of buffer - used in several places
89 #define BUF_SIZE 65536
92 * size of ACL buffer - used in several places
97 * size of MISC buffer - used in several places
102 * size of TYPE buffer - used in several places
106 struct tree_modifier
{
110 struct tree_modifier
*next
;
113 struct attr_keyword
{
119 #define ATTR_ALL ((uint_t)~0)
120 #define ATTR_CONTENTS 0x0001
121 #define ATTR_TYPE 0x0002
122 #define ATTR_SIZE 0x0004
123 #define ATTR_MODE 0x0008
124 #define ATTR_UID 0x0010
125 #define ATTR_GID 0x0020
126 #define ATTR_ACL 0x0040
127 #define ATTR_DEST 0x0080
128 #define ATTR_DEVNODE 0x0100
129 #define ATTR_MTIME 0x0200
130 #define ATTR_LNMTIME 0x0400
131 #define ATTR_DIRMTIME 0x0800
132 #define ATTR_ADD 0x1000
133 #define ATTR_DELETE 0x2000
136 char subtree
[PATH_MAX
];
138 struct tree_modifier
*modifiers
;
143 struct dir_component
{
144 char dirname
[PATH_MAX
];
145 struct dir_component
*next
;
149 struct attr_keyword
*attr_keylookup(char *);
151 int bart_create(int, char **);
152 int bart_compare(int, char **);
153 struct rule
*check_rules(const char *, char);
154 int exclude_fname(const char *, char, struct rule
*);
155 struct rule
*get_first_subtree(void);
156 struct rule
*get_next_subtree(struct rule
*);
157 void process_glob_ignores(char *, uint_t
*);
158 void *safe_calloc(size_t);
159 char *safe_strdup(char *);
160 int read_rules(FILE *, char *, uint_t
, int);
161 int read_line(FILE *, char *, int, int, char **, char *);