xref: /titanic_50/usr/src/cmd/filesync/database.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1996 Sun Microsystems, Inc.  All Rights Reserved
24*7c478bd9Sstevel@tonic-gate  *
25*7c478bd9Sstevel@tonic-gate  * module:
26*7c478bd9Sstevel@tonic-gate  *	database.h
27*7c478bd9Sstevel@tonic-gate  *
28*7c478bd9Sstevel@tonic-gate  * purpose:
29*7c478bd9Sstevel@tonic-gate  *	definition of the baseline and rules data structures
30*7c478bd9Sstevel@tonic-gate  */
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #ifndef	_DATABASE_H
33*7c478bd9Sstevel@tonic-gate #define	_DATABASE_H
34*7c478bd9Sstevel@tonic-gate 
35*7c478bd9Sstevel@tonic-gate #pragma ident	"%W%	%E% SMI"
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
38*7c478bd9Sstevel@tonic-gate extern "C" {
39*7c478bd9Sstevel@tonic-gate #endif
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate #include <sys/stat.h>
42*7c478bd9Sstevel@tonic-gate #include <sys/acl.h>
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate #define	ACL_UID_BUG	1	/* acl:SETACL sets owner to be caller	*/
45*7c478bd9Sstevel@tonic-gate 
46*7c478bd9Sstevel@tonic-gate /*
47*7c478bd9Sstevel@tonic-gate  * flag bits describing what we know about an individual file, or in
48*7c478bd9Sstevel@tonic-gate  * some cases an entire base pair.  These flags are found in the
49*7c478bd9Sstevel@tonic-gate  * base and file stuctures.
50*7c478bd9Sstevel@tonic-gate  */
51*7c478bd9Sstevel@tonic-gate typedef int fflags_t;			/* type for file flags		*/
52*7c478bd9Sstevel@tonic-gate 
53*7c478bd9Sstevel@tonic-gate #define	F_NEW		0x01		/* newly allocated		*/
54*7c478bd9Sstevel@tonic-gate #define	F_IN_BASELINE	0x02		/* file found in baseline	*/
55*7c478bd9Sstevel@tonic-gate #define	F_IN_SOURCE	0x04		/* file found in source tree	*/
56*7c478bd9Sstevel@tonic-gate #define	F_IN_DEST	0x08		/* file found in dest tree	*/
57*7c478bd9Sstevel@tonic-gate #define	F_EVALUATE	0x10		/* include in analysis		*/
58*7c478bd9Sstevel@tonic-gate #define	F_SPARSE	0x20		/* don't walk this directory	*/
59*7c478bd9Sstevel@tonic-gate #define	F_REMOVE	0x40		/* remove from baseline		*/
60*7c478bd9Sstevel@tonic-gate #define	F_CONFLICT	0x80		/* unresolvable conflict	*/
61*7c478bd9Sstevel@tonic-gate #define	F_LISTED	0x100		/* file came from LIST		*/
62*7c478bd9Sstevel@tonic-gate #define	F_STAT_ERROR	0x200		/* unable to stat file		*/
63*7c478bd9Sstevel@tonic-gate 
64*7c478bd9Sstevel@tonic-gate #define	F_WHEREFOUND	(F_IN_BASELINE|F_IN_SOURCE|F_IN_DEST)
65*7c478bd9Sstevel@tonic-gate 
66*7c478bd9Sstevel@tonic-gate /*
67*7c478bd9Sstevel@tonic-gate  * a base is a pair of directories to be kept in sync
68*7c478bd9Sstevel@tonic-gate  * 	all rules and baseline data is stored beneath some base
69*7c478bd9Sstevel@tonic-gate  */
70*7c478bd9Sstevel@tonic-gate struct base {
71*7c478bd9Sstevel@tonic-gate 	struct base *b_next;		/* pointer to next base		*/
72*7c478bd9Sstevel@tonic-gate 	fflags_t   b_flags;		/* what I know about this base	*/
73*7c478bd9Sstevel@tonic-gate 	int   b_ident;			/* base sequence # (DBG)	*/
74*7c478bd9Sstevel@tonic-gate 	char *b_src_spec;		/* spec name of source dir	*/
75*7c478bd9Sstevel@tonic-gate 	char *b_dst_spec;		/* spec name of dest dir	*/
76*7c478bd9Sstevel@tonic-gate 	char *b_src_name;		/* expanded name of source dir	*/
77*7c478bd9Sstevel@tonic-gate 	char *b_dst_name;		/* expanded name of dest dir	*/
78*7c478bd9Sstevel@tonic-gate 
79*7c478bd9Sstevel@tonic-gate 	struct rule *b_includes;	/* chain of include rules	*/
80*7c478bd9Sstevel@tonic-gate 	struct rule *b_excludes;	/* chain of exclude rules	*/
81*7c478bd9Sstevel@tonic-gate 	struct rule *b_restrictions;	/* chain of restrictions	*/
82*7c478bd9Sstevel@tonic-gate 
83*7c478bd9Sstevel@tonic-gate 	struct file *b_files;		/* chain of files		*/
84*7c478bd9Sstevel@tonic-gate 
85*7c478bd9Sstevel@tonic-gate 	/* statistics for wrap-up summary				*/
86*7c478bd9Sstevel@tonic-gate 	int b_totfiles;			/* total files found in tree	*/
87*7c478bd9Sstevel@tonic-gate 	int b_src_copies;		/* files copied to source	*/
88*7c478bd9Sstevel@tonic-gate 	int b_src_deletes;		/* files deleted from source	*/
89*7c478bd9Sstevel@tonic-gate 	int b_src_misc;			/* ownership changes on source	*/
90*7c478bd9Sstevel@tonic-gate 	int b_dst_copies;		/* files copied to dest		*/
91*7c478bd9Sstevel@tonic-gate 	int b_dst_deletes;		/* files deleted from dest	*/
92*7c478bd9Sstevel@tonic-gate 	int b_dst_misc;			/* ownership changes on source	*/
93*7c478bd9Sstevel@tonic-gate 	int b_unresolved;		/* unresolved conflicts		*/
94*7c478bd9Sstevel@tonic-gate };
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate /*
97*7c478bd9Sstevel@tonic-gate  * flag bits describing what we know about a particular rule.
98*7c478bd9Sstevel@tonic-gate  * These flags are found in the rule structure
99*7c478bd9Sstevel@tonic-gate  */
100*7c478bd9Sstevel@tonic-gate typedef	int rflags_t;			/* type for rule flags		*/
101*7c478bd9Sstevel@tonic-gate 
102*7c478bd9Sstevel@tonic-gate #define	R_NEW		0x01		/* newly added rule (=OPT_NEW)	*/
103*7c478bd9Sstevel@tonic-gate #define	R_PROGRAM	0x02		/* program (vs literal names)	*/
104*7c478bd9Sstevel@tonic-gate #define	R_IGNORE	0x04		/* IGNORE (vs INCLUDE)		*/
105*7c478bd9Sstevel@tonic-gate #define	R_RESTRICT	0x08		/* restriction (-r argument)	*/
106*7c478bd9Sstevel@tonic-gate #define	R_WILD		0x10		/* name involves wild cards	*/
107*7c478bd9Sstevel@tonic-gate #define	R_BOGUS		0x20		/* fabricated rule		*/
108*7c478bd9Sstevel@tonic-gate 
109*7c478bd9Sstevel@tonic-gate /*
110*7c478bd9Sstevel@tonic-gate  * a rule describes files to be included or excluded
111*7c478bd9Sstevel@tonic-gate  *	they are stored under bases
112*7c478bd9Sstevel@tonic-gate  */
113*7c478bd9Sstevel@tonic-gate struct rule {
114*7c478bd9Sstevel@tonic-gate 	struct rule *r_next;		/* pointer to next rule in base	*/
115*7c478bd9Sstevel@tonic-gate 	rflags_t r_flags;		/* flags associated with rule	*/
116*7c478bd9Sstevel@tonic-gate 	char   *r_file;			/* file for this rule		*/
117*7c478bd9Sstevel@tonic-gate };
118*7c478bd9Sstevel@tonic-gate 
119*7c478bd9Sstevel@tonic-gate 
120*7c478bd9Sstevel@tonic-gate /*
121*7c478bd9Sstevel@tonic-gate  * this is the information we keep track of for a file
122*7c478bd9Sstevel@tonic-gate  */
123*7c478bd9Sstevel@tonic-gate struct fileinfo {
124*7c478bd9Sstevel@tonic-gate 	ino_t	f_ino;			/* inode number of this file	*/
125*7c478bd9Sstevel@tonic-gate 	long	f_d_maj;		/* maj dev on which it lives	*/
126*7c478bd9Sstevel@tonic-gate 	long	f_d_min;		/* minj dev on which it lives	*/
127*7c478bd9Sstevel@tonic-gate 
128*7c478bd9Sstevel@tonic-gate 	int 	f_type;			/* file/dir/special ...		*/
129*7c478bd9Sstevel@tonic-gate 	int	f_mode;			/* protection			*/
130*7c478bd9Sstevel@tonic-gate 	int	f_nlink;		/* number of links to file	*/
131*7c478bd9Sstevel@tonic-gate 
132*7c478bd9Sstevel@tonic-gate 	uid_t	f_uid;			/* owning UID			*/
133*7c478bd9Sstevel@tonic-gate 	gid_t	f_gid;			/* owning GID			*/
134*7c478bd9Sstevel@tonic-gate 
135*7c478bd9Sstevel@tonic-gate 	off_t	f_size;			/* length in bytes		*/
136*7c478bd9Sstevel@tonic-gate 	long	f_modtime;		/* last modification time	*/
137*7c478bd9Sstevel@tonic-gate 	long	f_modns;		/* low order bits of modtime	*/
138*7c478bd9Sstevel@tonic-gate 
139*7c478bd9Sstevel@tonic-gate 	long	f_rd_maj;		/* major dev for specials	*/
140*7c478bd9Sstevel@tonic-gate 	long	f_rd_min;		/* minor dev for specials	*/
141*7c478bd9Sstevel@tonic-gate 
142*7c478bd9Sstevel@tonic-gate 	int	f_numacls;		/* number of entries in acls	*/
143*7c478bd9Sstevel@tonic-gate 	aclent_t *f_acls;		/* acl list (if any)		*/
144*7c478bd9Sstevel@tonic-gate };
145*7c478bd9Sstevel@tonic-gate 
146*7c478bd9Sstevel@tonic-gate /*
147*7c478bd9Sstevel@tonic-gate  * flag bits describing the differences we have detected between a file
148*7c478bd9Sstevel@tonic-gate  * and the last time it was in sync (based on the baseline).
149*7c478bd9Sstevel@tonic-gate  * These flags are used in the srcdiffs and dstdiffs fields of the
150*7c478bd9Sstevel@tonic-gate  * file structure
151*7c478bd9Sstevel@tonic-gate  */
152*7c478bd9Sstevel@tonic-gate typedef int diffmask_t;			/* type for difference masks	*/
153*7c478bd9Sstevel@tonic-gate 
154*7c478bd9Sstevel@tonic-gate #define	D_CREATE	0x01		/* file has been created	*/
155*7c478bd9Sstevel@tonic-gate #define	D_DELETE	0x02		/* file has been deleted	*/
156*7c478bd9Sstevel@tonic-gate #define	D_MTIME		0x04		/* file has been modified	*/
157*7c478bd9Sstevel@tonic-gate #define	D_SIZE		0x08		/* file has changed size	*/
158*7c478bd9Sstevel@tonic-gate #define	D_UID		0x10		/* file has changed user id	*/
159*7c478bd9Sstevel@tonic-gate #define	D_GID		0x20		/* file has changed group id	*/
160*7c478bd9Sstevel@tonic-gate #define	D_PROT		0x40		/* file has changed protection	*/
161*7c478bd9Sstevel@tonic-gate #define	D_LINKS		0x80		/* file has changed link count	*/
162*7c478bd9Sstevel@tonic-gate #define	D_TYPE		0x100		/* file has changed type	*/
163*7c478bd9Sstevel@tonic-gate #define	D_FACLS		0x200		/* file has changed facls	*/
164*7c478bd9Sstevel@tonic-gate #define	D_RENAME_TO	0x400		/* file came from a rename	*/
165*7c478bd9Sstevel@tonic-gate #define	D_RENAME_FROM	0x800		/* file has been renamed	*/
166*7c478bd9Sstevel@tonic-gate 
167*7c478bd9Sstevel@tonic-gate /*
168*7c478bd9Sstevel@tonic-gate  * these masks are used to determine how important potential changes are.
169*7c478bd9Sstevel@tonic-gate  *
170*7c478bd9Sstevel@tonic-gate  *	D_CONTENTS	there may be changes to the file's contents
171*7c478bd9Sstevel@tonic-gate  *	D_ADMIN		there may be changes to the ownership and protection
172*7c478bd9Sstevel@tonic-gate  *	D_IMPORTANT	there may be changes that should block a deletion
173*7c478bd9Sstevel@tonic-gate  *
174*7c478bd9Sstevel@tonic-gate  * Note:
175*7c478bd9Sstevel@tonic-gate  *	I am torn on whether or not to include modtime in D_IMPORTANT.
176*7c478bd9Sstevel@tonic-gate  *	Experience suggests that deleting one of many links affects the
177*7c478bd9Sstevel@tonic-gate  *	file modification time.
178*7c478bd9Sstevel@tonic-gate  */
179*7c478bd9Sstevel@tonic-gate #define	D_ADMIN		(D_UID|D_GID|D_PROT|D_FACLS)
180*7c478bd9Sstevel@tonic-gate #define	D_CONTENTS	(D_SIZE|D_TYPE|D_CREATE|D_MTIME)
181*7c478bd9Sstevel@tonic-gate #define	D_IMPORTANT	(D_SIZE|D_TYPE|D_CREATE|D_MTIME|D_ADMIN)
182*7c478bd9Sstevel@tonic-gate 
183*7c478bd9Sstevel@tonic-gate /*
184*7c478bd9Sstevel@tonic-gate  * a file is an instance that follows (under a base) from a rule
185*7c478bd9Sstevel@tonic-gate  * (for that base).  A file structure may exist because of any
186*7c478bd9Sstevel@tonic-gate  * combination of a file under the source, destination, in a
187*7c478bd9Sstevel@tonic-gate  * baseline for historical reasons, or merely because a rule
188*7c478bd9Sstevel@tonic-gate  * calls it out (whether it exists or not).
189*7c478bd9Sstevel@tonic-gate  */
190*7c478bd9Sstevel@tonic-gate struct file {
191*7c478bd9Sstevel@tonic-gate 	struct file *f_next;		/* pointer to next file in base	*/
192*7c478bd9Sstevel@tonic-gate 	struct file *f_files;		/* pointer to files in subdir	*/
193*7c478bd9Sstevel@tonic-gate 	struct base *f_base;		/* pointer to owning base	*/
194*7c478bd9Sstevel@tonic-gate 	fflags_t f_flags;		/* flags associated with file	*/
195*7c478bd9Sstevel@tonic-gate 	int	f_depth;		/* directory depth for file	*/
196*7c478bd9Sstevel@tonic-gate 	char   *f_name;			/* name of this file		*/
197*7c478bd9Sstevel@tonic-gate 
198*7c478bd9Sstevel@tonic-gate 	/*
199*7c478bd9Sstevel@tonic-gate 	 * these fields capture information, gleaned from the baseline
200*7c478bd9Sstevel@tonic-gate 	 * that is side-specific, and should not be expected to be in
201*7c478bd9Sstevel@tonic-gate 	 * agreement between the two sides.  As a result, this info can
202*7c478bd9Sstevel@tonic-gate 	 * not be properly captured in f_info[OPT_BASE] and needs to
203*7c478bd9Sstevel@tonic-gate 	 * be kept somewhere else.
204*7c478bd9Sstevel@tonic-gate 	 */
205*7c478bd9Sstevel@tonic-gate 	long	f_s_modtime;		/* baseline source mod time	*/
206*7c478bd9Sstevel@tonic-gate 	ino_t	f_s_inum;		/* baseline source inode #	*/
207*7c478bd9Sstevel@tonic-gate 	long	f_s_nlink;		/* baseline source link count	*/
208*7c478bd9Sstevel@tonic-gate 	long	f_s_maj;		/* baseline source dev maj	*/
209*7c478bd9Sstevel@tonic-gate 	long	f_s_min;		/* baseline source dev min	*/
210*7c478bd9Sstevel@tonic-gate 	long	f_d_modtime;		/* baseline target mod time	*/
211*7c478bd9Sstevel@tonic-gate 	ino_t	f_d_inum;		/* baseline target inode #	*/
212*7c478bd9Sstevel@tonic-gate 	long	f_d_nlink;		/* baseline target link count	*/
213*7c478bd9Sstevel@tonic-gate 	long	f_d_maj;		/* baseline target dev maj	*/
214*7c478bd9Sstevel@tonic-gate 	long	f_d_min;		/* baseline target dev min	*/
215*7c478bd9Sstevel@tonic-gate 
216*7c478bd9Sstevel@tonic-gate 	/* stat information from baseline file and evaluation		*/
217*7c478bd9Sstevel@tonic-gate 	struct fileinfo f_info[3];	/* baseline, source, dest	*/
218*7c478bd9Sstevel@tonic-gate 
219*7c478bd9Sstevel@tonic-gate 	/* summary of changes discovered in analysis			*/
220*7c478bd9Sstevel@tonic-gate 	diffmask_t f_srcdiffs;		/* changes on source side	*/
221*7c478bd9Sstevel@tonic-gate 	diffmask_t f_dstdiffs;		/* changes on dest side		*/
222*7c478bd9Sstevel@tonic-gate 
223*7c478bd9Sstevel@tonic-gate 	/* this field is only valid for a renamed file			*/
224*7c478bd9Sstevel@tonic-gate 	struct file * f_previous;	/* node for previous filename	*/
225*7c478bd9Sstevel@tonic-gate 
226*7c478bd9Sstevel@tonic-gate 	/*
227*7c478bd9Sstevel@tonic-gate 	 * these fields are only valid for a file that has been added
228*7c478bd9Sstevel@tonic-gate 	 * to the reconciliation list
229*7c478bd9Sstevel@tonic-gate 	 */
230*7c478bd9Sstevel@tonic-gate 	struct file *f_rnext;		/* reconciliation chain ptr	*/
231*7c478bd9Sstevel@tonic-gate 	char	*f_fullname;		/* full name for reconciling	*/
232*7c478bd9Sstevel@tonic-gate 	long	f_modtime;		/* modtime for ordering purpose	*/
233*7c478bd9Sstevel@tonic-gate 	long	f_modns;		/* low order modtime 		*/
234*7c478bd9Sstevel@tonic-gate 
235*7c478bd9Sstevel@tonic-gate 	/* this field is only valid for a file with a hard conflict	*/
236*7c478bd9Sstevel@tonic-gate 	char 	*f_problem;		/* description of conflict	*/
237*7c478bd9Sstevel@tonic-gate };
238*7c478bd9Sstevel@tonic-gate 
239*7c478bd9Sstevel@tonic-gate /*
240*7c478bd9Sstevel@tonic-gate  * globals
241*7c478bd9Sstevel@tonic-gate  */
242*7c478bd9Sstevel@tonic-gate extern struct base omnibase;		/* base for global rules	*/
243*7c478bd9Sstevel@tonic-gate extern struct base *bases;		/* base for the main list	*/
244*7c478bd9Sstevel@tonic-gate extern int inum_changes;		/* LISTed dirs with i# changes	*/
245*7c478bd9Sstevel@tonic-gate 
246*7c478bd9Sstevel@tonic-gate /* routines to manage base nodes, file nodes, and file infor	*/
247*7c478bd9Sstevel@tonic-gate errmask_t read_baseline(char *);
248*7c478bd9Sstevel@tonic-gate errmask_t write_baseline(char *);
249*7c478bd9Sstevel@tonic-gate struct file *add_file_to_base(struct base *, const char *);
250*7c478bd9Sstevel@tonic-gate struct file *add_file_to_dir(struct file *, const char *);
251*7c478bd9Sstevel@tonic-gate struct base *add_base(const char *src, const char *dst);
252*7c478bd9Sstevel@tonic-gate void note_info(struct file *, const struct stat *, side_t);
253*7c478bd9Sstevel@tonic-gate void update_info(struct file *, side_t);
254*7c478bd9Sstevel@tonic-gate 
255*7c478bd9Sstevel@tonic-gate /* routines to manage rules					*/
256*7c478bd9Sstevel@tonic-gate errmask_t read_rules(char *);
257*7c478bd9Sstevel@tonic-gate errmask_t write_rules(char *);
258*7c478bd9Sstevel@tonic-gate errmask_t add_include(struct base *, char *);
259*7c478bd9Sstevel@tonic-gate errmask_t add_ignore(struct base *, char *);
260*7c478bd9Sstevel@tonic-gate 
261*7c478bd9Sstevel@tonic-gate /* routines to manage and querry restriction lists		*/
262*7c478bd9Sstevel@tonic-gate errmask_t add_restr(char *);
263*7c478bd9Sstevel@tonic-gate bool_t check_restr(struct base *, const char *);
264*7c478bd9Sstevel@tonic-gate 
265*7c478bd9Sstevel@tonic-gate /* routines for dealing with ignore lists			*/
266*7c478bd9Sstevel@tonic-gate void ignore_reset();
267*7c478bd9Sstevel@tonic-gate void ignore_pgm(const char *);
268*7c478bd9Sstevel@tonic-gate void ignore_expr(const char *);
269*7c478bd9Sstevel@tonic-gate void ignore_file(const char *);
270*7c478bd9Sstevel@tonic-gate bool_t ignore_check(const char *);
271*7c478bd9Sstevel@tonic-gate 
272*7c478bd9Sstevel@tonic-gate /* database processing routines for the primary passes		*/
273*7c478bd9Sstevel@tonic-gate errmask_t evaluate(struct base *, side_t, bool_t);
274*7c478bd9Sstevel@tonic-gate errmask_t analyze(void);
275*7c478bd9Sstevel@tonic-gate errmask_t find_renames(struct file *);
276*7c478bd9Sstevel@tonic-gate errmask_t reconcile(struct file *);
277*7c478bd9Sstevel@tonic-gate int prune(void);
278*7c478bd9Sstevel@tonic-gate void summary(void);
279*7c478bd9Sstevel@tonic-gate char *full_name(struct file *, side_t, side_t);
280*7c478bd9Sstevel@tonic-gate 
281*7c478bd9Sstevel@tonic-gate /* routines in action.c to carry out reconciliation		*/
282*7c478bd9Sstevel@tonic-gate errmask_t do_copy(struct file *, side_t);
283*7c478bd9Sstevel@tonic-gate errmask_t do_remove(struct file *, side_t);
284*7c478bd9Sstevel@tonic-gate errmask_t do_rename(struct file *, side_t);
285*7c478bd9Sstevel@tonic-gate errmask_t do_like(struct file *, side_t, bool_t);
286*7c478bd9Sstevel@tonic-gate 
287*7c478bd9Sstevel@tonic-gate /* routines to deal with links in the reconciliation list	*/
288*7c478bd9Sstevel@tonic-gate struct file *find_link(struct file *, side_t);
289*7c478bd9Sstevel@tonic-gate void link_update(struct file *, side_t);
290*7c478bd9Sstevel@tonic-gate bool_t has_other_links(struct file *, side_t);
291*7c478bd9Sstevel@tonic-gate 
292*7c478bd9Sstevel@tonic-gate /* maintain a name stack during directory tree traversal	*/
293*7c478bd9Sstevel@tonic-gate void push_name(const char *);
294*7c478bd9Sstevel@tonic-gate void pop_name();
295*7c478bd9Sstevel@tonic-gate char *get_name(struct file *);
296*7c478bd9Sstevel@tonic-gate 
297*7c478bd9Sstevel@tonic-gate /* acl manipulation functions					*/
298*7c478bd9Sstevel@tonic-gate int get_acls(const char *, struct fileinfo *);
299*7c478bd9Sstevel@tonic-gate int set_acls(const char *, struct fileinfo *);
300*7c478bd9Sstevel@tonic-gate int cmp_acls(struct fileinfo *, struct fileinfo *);
301*7c478bd9Sstevel@tonic-gate char *show_acls(int, aclent_t *);
302*7c478bd9Sstevel@tonic-gate 
303*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
304*7c478bd9Sstevel@tonic-gate }
305*7c478bd9Sstevel@tonic-gate #endif
306*7c478bd9Sstevel@tonic-gate 
307*7c478bd9Sstevel@tonic-gate #endif	/* _DATABASE_H */
308