xref: /illumos-gate/usr/src/lib/libpkg/common/cfext.h (revision e47aa97b)
15c51f124SMoriah Waterland /*
25c51f124SMoriah Waterland  * CDDL HEADER START
35c51f124SMoriah Waterland  *
45c51f124SMoriah Waterland  * The contents of this file are subject to the terms of the
55c51f124SMoriah Waterland  * Common Development and Distribution License (the "License").
65c51f124SMoriah Waterland  * You may not use this file except in compliance with the License.
75c51f124SMoriah Waterland  *
85c51f124SMoriah Waterland  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
95c51f124SMoriah Waterland  * or http://www.opensolaris.org/os/licensing.
105c51f124SMoriah Waterland  * See the License for the specific language governing permissions
115c51f124SMoriah Waterland  * and limitations under the License.
125c51f124SMoriah Waterland  *
135c51f124SMoriah Waterland  * When distributing Covered Code, include this CDDL HEADER in each
145c51f124SMoriah Waterland  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
155c51f124SMoriah Waterland  * If applicable, add the following below this CDDL HEADER, with the
165c51f124SMoriah Waterland  * fields enclosed by brackets "[]" replaced with your own identifying
175c51f124SMoriah Waterland  * information: Portions Copyright [yyyy] [name of copyright owner]
185c51f124SMoriah Waterland  *
195c51f124SMoriah Waterland  * CDDL HEADER END
205c51f124SMoriah Waterland  */
215c51f124SMoriah Waterland 
225c51f124SMoriah Waterland /*
235c51f124SMoriah Waterland  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
245c51f124SMoriah Waterland  * Use is subject to license terms.
255c51f124SMoriah Waterland  */
265c51f124SMoriah Waterland 
275c51f124SMoriah Waterland #ifndef	_CFEXT_H
285c51f124SMoriah Waterland #define	_CFEXT_H
295c51f124SMoriah Waterland 
305c51f124SMoriah Waterland 
315c51f124SMoriah Waterland #ifdef	__cplusplus
325c51f124SMoriah Waterland extern "C" {
335c51f124SMoriah Waterland #endif
345c51f124SMoriah Waterland 
355c51f124SMoriah Waterland #include	<pkgstrct.h>
365c51f124SMoriah Waterland 
375c51f124SMoriah Waterland struct mergstat {
385c51f124SMoriah Waterland 	unsigned setuid:1;  /* pkgmap entry has setuid */
395c51f124SMoriah Waterland 	unsigned setgid:1;  /* ... and/or setgid bit set */
405c51f124SMoriah Waterland 	unsigned contchg:1; /* contents of the files different */
415c51f124SMoriah Waterland 	unsigned attrchg:1; /* attributes are different */
425c51f124SMoriah Waterland 	unsigned shared:1;  /* > 1 pkg associated with this */
435c51f124SMoriah Waterland 	unsigned osetuid:1; /* installed set[ug]id process ... */
445c51f124SMoriah Waterland 	unsigned osetgid:1; /* ... being overwritten by pkg. */
455c51f124SMoriah Waterland 	unsigned rogue:1;   /* conflicting file not owned by a package */
465c51f124SMoriah Waterland 	unsigned dir2nondir:1;  /* was a directory & now a non-directory */
475c51f124SMoriah Waterland 	unsigned replace:1; /* merge makes no sense for this object pair */
485c51f124SMoriah Waterland 	unsigned denied:1;  /* for some reason this was not allowed in */
495c51f124SMoriah Waterland 	unsigned preloaded:1;   /* already checked in a prior pkg op */
505c51f124SMoriah Waterland 	unsigned processed:1;   /* already installed or removed */
515c51f124SMoriah Waterland 	unsigned parentsyml2dir:1;
525c51f124SMoriah Waterland 	/* parent directory changed from symlink to a directory */
535c51f124SMoriah Waterland };
545c51f124SMoriah Waterland 
555c51f124SMoriah Waterland /*
565c51f124SMoriah Waterland  * This is information required by pkgadd for fast operation. A
575c51f124SMoriah Waterland  * cfextra struct is tagged to each cfent structure requiring
585c51f124SMoriah Waterland  * processing. This is how we avoid some unneeded repetition. The
595c51f124SMoriah Waterland  * entries incorporating the word 'local' refer to the path that
605c51f124SMoriah Waterland  * gets us to the delivered package file. In other words, to install
615c51f124SMoriah Waterland  * a file we usually copy from 'local' to 'path' below. In the case
625c51f124SMoriah Waterland  * of a link, where no actual copying takes place, local is the source
635c51f124SMoriah Waterland  * of the link. Note that environment variables are not evaluated in
645c51f124SMoriah Waterland  * the locals unless they are links since the literal path is how
655c51f124SMoriah Waterland  * pkgadd finds the entry under the reloc directory.
665c51f124SMoriah Waterland  */
675c51f124SMoriah Waterland struct cfextra {
685c51f124SMoriah Waterland 	struct cfent cf_ent;	/* basic contents file entry */
695c51f124SMoriah Waterland 	struct mergstat mstat;  /* merge status for installs */
70*e47aa97bSSimon Klinkert 	uint32_t   fsys_value; /* fstab[] entry index */
71*e47aa97bSSimon Klinkert 	uint32_t   fsys_base;  /* actual base filesystem in fs_tab[] */
725c51f124SMoriah Waterland 	char	*client_path;   /* the client-relative path */
735c51f124SMoriah Waterland 	char	*server_path;   /* the server-relative path */
745c51f124SMoriah Waterland 	char	*map_path;  /* as read from the pkgmap */
755c51f124SMoriah Waterland 	char	*client_local;  /* client_relative local */
765c51f124SMoriah Waterland 	char	*server_local;  /* server relative local */
775c51f124SMoriah Waterland };
785c51f124SMoriah Waterland 
795c51f124SMoriah Waterland #ifdef	__cplusplus
805c51f124SMoriah Waterland }
815c51f124SMoriah Waterland #endif
825c51f124SMoriah Waterland 
835c51f124SMoriah Waterland #endif	/* _CFEXT_H */
84