xref: /onnv-gate/usr/src/cmd/svr4pkg/hdrs/install.h (revision 9781:ccf49524d5dc)
1*9781SMoriah.Waterland@Sun.COM /*
2*9781SMoriah.Waterland@Sun.COM  * CDDL HEADER START
3*9781SMoriah.Waterland@Sun.COM  *
4*9781SMoriah.Waterland@Sun.COM  * The contents of this file are subject to the terms of the
5*9781SMoriah.Waterland@Sun.COM  * Common Development and Distribution License (the "License").
6*9781SMoriah.Waterland@Sun.COM  * You may not use this file except in compliance with the License.
7*9781SMoriah.Waterland@Sun.COM  *
8*9781SMoriah.Waterland@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*9781SMoriah.Waterland@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*9781SMoriah.Waterland@Sun.COM  * See the License for the specific language governing permissions
11*9781SMoriah.Waterland@Sun.COM  * and limitations under the License.
12*9781SMoriah.Waterland@Sun.COM  *
13*9781SMoriah.Waterland@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*9781SMoriah.Waterland@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*9781SMoriah.Waterland@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*9781SMoriah.Waterland@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*9781SMoriah.Waterland@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*9781SMoriah.Waterland@Sun.COM  *
19*9781SMoriah.Waterland@Sun.COM  * CDDL HEADER END
20*9781SMoriah.Waterland@Sun.COM  */
21*9781SMoriah.Waterland@Sun.COM 
22*9781SMoriah.Waterland@Sun.COM /*
23*9781SMoriah.Waterland@Sun.COM  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*9781SMoriah.Waterland@Sun.COM  * Use is subject to license terms.
25*9781SMoriah.Waterland@Sun.COM  */
26*9781SMoriah.Waterland@Sun.COM 
27*9781SMoriah.Waterland@Sun.COM /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28*9781SMoriah.Waterland@Sun.COM /* All Rights Reserved */
29*9781SMoriah.Waterland@Sun.COM 
30*9781SMoriah.Waterland@Sun.COM #ifndef __INSTALL_H
31*9781SMoriah.Waterland@Sun.COM #define	__INSTALL_H
32*9781SMoriah.Waterland@Sun.COM 
33*9781SMoriah.Waterland@Sun.COM 
34*9781SMoriah.Waterland@Sun.COM #ifdef __cplusplus
35*9781SMoriah.Waterland@Sun.COM extern "C" {
36*9781SMoriah.Waterland@Sun.COM #endif
37*9781SMoriah.Waterland@Sun.COM 
38*9781SMoriah.Waterland@Sun.COM #include <sys/types.h>
39*9781SMoriah.Waterland@Sun.COM #include <limits.h>
40*9781SMoriah.Waterland@Sun.COM #include <pkgstrct.h>
41*9781SMoriah.Waterland@Sun.COM 
42*9781SMoriah.Waterland@Sun.COM /* Settings for procedure scripts */
43*9781SMoriah.Waterland@Sun.COM #define	PROC_USER	"root"
44*9781SMoriah.Waterland@Sun.COM #define	PROC_GRP	"other"
45*9781SMoriah.Waterland@Sun.COM #define	PROC_STDIN	"/dev/null"
46*9781SMoriah.Waterland@Sun.COM #define	PROC_XSTDIN	"/dev/tty"
47*9781SMoriah.Waterland@Sun.COM #define	PROC_STDOUT	"/dev/tty"
48*9781SMoriah.Waterland@Sun.COM 
49*9781SMoriah.Waterland@Sun.COM /* Settings for class action scripts */
50*9781SMoriah.Waterland@Sun.COM #define	CAS_USER	"root"
51*9781SMoriah.Waterland@Sun.COM #define	CAS_GRP		"other"
52*9781SMoriah.Waterland@Sun.COM #define	CAS_STDIN	"/dev/null"
53*9781SMoriah.Waterland@Sun.COM #define	CAS_STDOUT	"/dev/tty"
54*9781SMoriah.Waterland@Sun.COM 
55*9781SMoriah.Waterland@Sun.COM /* Settings for non-privileged scripts */
56*9781SMoriah.Waterland@Sun.COM #define	CHK_USER	"install"	/* default user i.d. to use */
57*9781SMoriah.Waterland@Sun.COM #define	CHK_USER_ALT	"noaccess"	/* alternate non-priv user */
58*9781SMoriah.Waterland@Sun.COM #define	CHK_USER_ROOT	"root"		/* root user */
59*9781SMoriah.Waterland@Sun.COM #define	CHK_USER_NON	"root"		/* user for non-compliant pkg's */
60*9781SMoriah.Waterland@Sun.COM #define	CHK_GRP		"other"
61*9781SMoriah.Waterland@Sun.COM #define	CHK_STDIN	"/dev/null"
62*9781SMoriah.Waterland@Sun.COM #define	CHK_STDOUT	"/dev/tty"
63*9781SMoriah.Waterland@Sun.COM 
64*9781SMoriah.Waterland@Sun.COM /* Settings for admin "rscriptalt" option */
65*9781SMoriah.Waterland@Sun.COM #define	RSCRIPTALT		rscriptalt
66*9781SMoriah.Waterland@Sun.COM #define	RSCRIPTALT_KEYWORD	"rscriptalt"
67*9781SMoriah.Waterland@Sun.COM #define	RSCRIPTALT_ROOT		"root"
68*9781SMoriah.Waterland@Sun.COM #define	RSCRIPTALT_NOACCESS	"noaccess"
69*9781SMoriah.Waterland@Sun.COM 
70*9781SMoriah.Waterland@Sun.COM #define	OAMBASE	"/usr/sadm/sysadm"
71*9781SMoriah.Waterland@Sun.COM #define	MAILCMD	"/usr/bin/mail"
72*9781SMoriah.Waterland@Sun.COM #define	DATSTRM	"datastream"
73*9781SMoriah.Waterland@Sun.COM #define	SHELL	"/sbin/sh"
74*9781SMoriah.Waterland@Sun.COM #define	PKGINFO	"pkginfo"
75*9781SMoriah.Waterland@Sun.COM #define	PKGMAP	"pkgmap"
76*9781SMoriah.Waterland@Sun.COM #define	LIVE_CONT	"__live_cont__"
77*9781SMoriah.Waterland@Sun.COM #define	RELOC "reloc"
78*9781SMoriah.Waterland@Sun.COM #define	ROOT "root"
79*9781SMoriah.Waterland@Sun.COM 
80*9781SMoriah.Waterland@Sun.COM /* Additional cfent/cfextra codes. */
81*9781SMoriah.Waterland@Sun.COM #define	BADFSYS	(short)(-1) /* an fsys is needed */
82*9781SMoriah.Waterland@Sun.COM #define	BADINDEX    (-1)    /* pkg class idx not yet set */
83*9781SMoriah.Waterland@Sun.COM 
84*9781SMoriah.Waterland@Sun.COM /* This holds admin file data. */
85*9781SMoriah.Waterland@Sun.COM struct admin {
86*9781SMoriah.Waterland@Sun.COM 	char	*mail;
87*9781SMoriah.Waterland@Sun.COM 	char	*instance;
88*9781SMoriah.Waterland@Sun.COM 	char	*partial;
89*9781SMoriah.Waterland@Sun.COM 	char	*runlevel;
90*9781SMoriah.Waterland@Sun.COM 	char	*idepend;
91*9781SMoriah.Waterland@Sun.COM 	char	*rdepend;
92*9781SMoriah.Waterland@Sun.COM 	char	*space;
93*9781SMoriah.Waterland@Sun.COM 	char	*setuid;
94*9781SMoriah.Waterland@Sun.COM 	char	*conflict;
95*9781SMoriah.Waterland@Sun.COM 	char	*action;
96*9781SMoriah.Waterland@Sun.COM 	char	*networktimeout;
97*9781SMoriah.Waterland@Sun.COM 	char	*networkretries;
98*9781SMoriah.Waterland@Sun.COM 	char	*authentication;
99*9781SMoriah.Waterland@Sun.COM 	char	*keystore;
100*9781SMoriah.Waterland@Sun.COM 	char	*proxy;
101*9781SMoriah.Waterland@Sun.COM 	char	*basedir;
102*9781SMoriah.Waterland@Sun.COM 	char	*rscriptalt;
103*9781SMoriah.Waterland@Sun.COM };
104*9781SMoriah.Waterland@Sun.COM 
105*9781SMoriah.Waterland@Sun.COM /*
106*9781SMoriah.Waterland@Sun.COM  * This table details the status of all filesystems available to the target
107*9781SMoriah.Waterland@Sun.COM  * host.
108*9781SMoriah.Waterland@Sun.COM  */
109*9781SMoriah.Waterland@Sun.COM struct fstable {
110*9781SMoriah.Waterland@Sun.COM 	char	*name;	/* name of filesystem, (mount point) */
111*9781SMoriah.Waterland@Sun.COM 	int	namlen;	/* The length of the name (mountpoint) */
112*9781SMoriah.Waterland@Sun.COM 	fsblkcnt_t bsize;	/* fundamental file system block size */
113*9781SMoriah.Waterland@Sun.COM 	fsblkcnt_t frsize;	/* file system fragment size */
114*9781SMoriah.Waterland@Sun.COM 	fsblkcnt_t bfree;	/* total # of free blocks */
115*9781SMoriah.Waterland@Sun.COM 	fsblkcnt_t bused;	/* total # of used blocks */
116*9781SMoriah.Waterland@Sun.COM 	fsblkcnt_t ffree;	/* total # of free file nodes */
117*9781SMoriah.Waterland@Sun.COM 	fsblkcnt_t fused;	/* total # of used file nodes */
118*9781SMoriah.Waterland@Sun.COM 	char	*fstype;	/* type of filesystem - nfs, lo, ... */
119*9781SMoriah.Waterland@Sun.COM 	char	*remote_name;	/* client's mounted filesystem */
120*9781SMoriah.Waterland@Sun.COM 	unsigned	writeable:1;	/* access permission */
121*9781SMoriah.Waterland@Sun.COM 	unsigned	write_tested:1;	/* access permission fully tested */
122*9781SMoriah.Waterland@Sun.COM 	unsigned	remote:1;	/* on a remote filesystem */
123*9781SMoriah.Waterland@Sun.COM 	unsigned	mounted:1;	/* actually mounted right now */
124*9781SMoriah.Waterland@Sun.COM 	unsigned	srvr_map:1;	/* use server_map() */
125*9781SMoriah.Waterland@Sun.COM 	unsigned	cl_mounted:1;	/* mounted in client space */
126*9781SMoriah.Waterland@Sun.COM 	unsigned	mnt_failed:1;	/* attempt to loopback mount failed */
127*9781SMoriah.Waterland@Sun.COM 	unsigned	served:1;	/* filesystem comes from a server */
128*9781SMoriah.Waterland@Sun.COM };
129*9781SMoriah.Waterland@Sun.COM 
130*9781SMoriah.Waterland@Sun.COM #define	ADM(x, y)	((adm.x != NULL) && (y != NULL) && \
131*9781SMoriah.Waterland@Sun.COM 			    strcmp(adm.x, y) == 0)
132*9781SMoriah.Waterland@Sun.COM #define	ADMSET(x)	(adm.x != NULL)
133*9781SMoriah.Waterland@Sun.COM #define	PARAMETRIC(x) (x[0] == '$')
134*9781SMoriah.Waterland@Sun.COM #define	RELATIVE(x)	(x[0] != '/')
135*9781SMoriah.Waterland@Sun.COM 
136*9781SMoriah.Waterland@Sun.COM #if defined(lint) && !defined(gettext)
137*9781SMoriah.Waterland@Sun.COM #define	gettext(x)	x
138*9781SMoriah.Waterland@Sun.COM #endif	/* defined(lint) && !defined(gettext) */
139*9781SMoriah.Waterland@Sun.COM 
140*9781SMoriah.Waterland@Sun.COM #ifdef __cplusplus
141*9781SMoriah.Waterland@Sun.COM }
142*9781SMoriah.Waterland@Sun.COM #endif
143*9781SMoriah.Waterland@Sun.COM 
144*9781SMoriah.Waterland@Sun.COM #endif	/* __INSTALL_H */
145