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