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