xref: /illumos-gate/usr/src/lib/libpkg/common/cfext.h (revision 5c51f124)
1*5c51f124SMoriah Waterland /*
2*5c51f124SMoriah Waterland  * CDDL HEADER START
3*5c51f124SMoriah Waterland  *
4*5c51f124SMoriah Waterland  * The contents of this file are subject to the terms of the
5*5c51f124SMoriah Waterland  * Common Development and Distribution License (the "License").
6*5c51f124SMoriah Waterland  * You may not use this file except in compliance with the License.
7*5c51f124SMoriah Waterland  *
8*5c51f124SMoriah Waterland  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*5c51f124SMoriah Waterland  * or http://www.opensolaris.org/os/licensing.
10*5c51f124SMoriah Waterland  * See the License for the specific language governing permissions
11*5c51f124SMoriah Waterland  * and limitations under the License.
12*5c51f124SMoriah Waterland  *
13*5c51f124SMoriah Waterland  * When distributing Covered Code, include this CDDL HEADER in each
14*5c51f124SMoriah Waterland  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*5c51f124SMoriah Waterland  * If applicable, add the following below this CDDL HEADER, with the
16*5c51f124SMoriah Waterland  * fields enclosed by brackets "[]" replaced with your own identifying
17*5c51f124SMoriah Waterland  * information: Portions Copyright [yyyy] [name of copyright owner]
18*5c51f124SMoriah Waterland  *
19*5c51f124SMoriah Waterland  * CDDL HEADER END
20*5c51f124SMoriah Waterland  */
21*5c51f124SMoriah Waterland 
22*5c51f124SMoriah Waterland /*
23*5c51f124SMoriah Waterland  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*5c51f124SMoriah Waterland  * Use is subject to license terms.
25*5c51f124SMoriah Waterland  */
26*5c51f124SMoriah Waterland 
27*5c51f124SMoriah Waterland #ifndef	_CFEXT_H
28*5c51f124SMoriah Waterland #define	_CFEXT_H
29*5c51f124SMoriah Waterland 
30*5c51f124SMoriah Waterland 
31*5c51f124SMoriah Waterland #ifdef	__cplusplus
32*5c51f124SMoriah Waterland extern "C" {
33*5c51f124SMoriah Waterland #endif
34*5c51f124SMoriah Waterland 
35*5c51f124SMoriah Waterland #include	<pkgstrct.h>
36*5c51f124SMoriah Waterland 
37*5c51f124SMoriah Waterland struct mergstat {
38*5c51f124SMoriah Waterland 	unsigned setuid:1;  /* pkgmap entry has setuid */
39*5c51f124SMoriah Waterland 	unsigned setgid:1;  /* ... and/or setgid bit set */
40*5c51f124SMoriah Waterland 	unsigned contchg:1; /* contents of the files different */
41*5c51f124SMoriah Waterland 	unsigned attrchg:1; /* attributes are different */
42*5c51f124SMoriah Waterland 	unsigned shared:1;  /* > 1 pkg associated with this */
43*5c51f124SMoriah Waterland 	unsigned osetuid:1; /* installed set[ug]id process ... */
44*5c51f124SMoriah Waterland 	unsigned osetgid:1; /* ... being overwritten by pkg. */
45*5c51f124SMoriah Waterland 	unsigned rogue:1;   /* conflicting file not owned by a package */
46*5c51f124SMoriah Waterland 	unsigned dir2nondir:1;  /* was a directory & now a non-directory */
47*5c51f124SMoriah Waterland 	unsigned replace:1; /* merge makes no sense for this object pair */
48*5c51f124SMoriah Waterland 	unsigned denied:1;  /* for some reason this was not allowed in */
49*5c51f124SMoriah Waterland 	unsigned preloaded:1;   /* already checked in a prior pkg op */
50*5c51f124SMoriah Waterland 	unsigned processed:1;   /* already installed or removed */
51*5c51f124SMoriah Waterland 	unsigned parentsyml2dir:1;
52*5c51f124SMoriah Waterland 	/* parent directory changed from symlink to a directory */
53*5c51f124SMoriah Waterland };
54*5c51f124SMoriah Waterland 
55*5c51f124SMoriah Waterland /*
56*5c51f124SMoriah Waterland  * This is information required by pkgadd for fast operation. A
57*5c51f124SMoriah Waterland  * cfextra struct is tagged to each cfent structure requiring
58*5c51f124SMoriah Waterland  * processing. This is how we avoid some unneeded repetition. The
59*5c51f124SMoriah Waterland  * entries incorporating the word 'local' refer to the path that
60*5c51f124SMoriah Waterland  * gets us to the delivered package file. In other words, to install
61*5c51f124SMoriah Waterland  * a file we usually copy from 'local' to 'path' below. In the case
62*5c51f124SMoriah Waterland  * of a link, where no actual copying takes place, local is the source
63*5c51f124SMoriah Waterland  * of the link. Note that environment variables are not evaluated in
64*5c51f124SMoriah Waterland  * the locals unless they are links since the literal path is how
65*5c51f124SMoriah Waterland  * pkgadd finds the entry under the reloc directory.
66*5c51f124SMoriah Waterland  */
67*5c51f124SMoriah Waterland struct cfextra {
68*5c51f124SMoriah Waterland 	struct cfent cf_ent;	/* basic contents file entry */
69*5c51f124SMoriah Waterland 	struct mergstat mstat;  /* merge status for installs */
70*5c51f124SMoriah Waterland 	short   fsys_value; /* fstab[] entry index */
71*5c51f124SMoriah Waterland 	short   fsys_base;  /* actual base filesystem in fs_tab[] */
72*5c51f124SMoriah Waterland 	char	*client_path;   /* the client-relative path */
73*5c51f124SMoriah Waterland 	char	*server_path;   /* the server-relative path */
74*5c51f124SMoriah Waterland 	char	*map_path;  /* as read from the pkgmap */
75*5c51f124SMoriah Waterland 	char	*client_local;  /* client_relative local */
76*5c51f124SMoriah Waterland 	char	*server_local;  /* server relative local */
77*5c51f124SMoriah Waterland };
78*5c51f124SMoriah Waterland 
79*5c51f124SMoriah Waterland #ifdef	__cplusplus
80*5c51f124SMoriah Waterland }
81*5c51f124SMoriah Waterland #endif
82*5c51f124SMoriah Waterland 
83*5c51f124SMoriah Waterland #endif	/* _CFEXT_H */
84