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