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.
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.
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]
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
35 #include <sys/stat.h> /* mkdir declaration is here? */
40 #include <sys/types.h>
49 #include "pkginstall.h"
51 extern struct admin adm
;
52 extern struct cfextra
**extlist
;
53 extern int ckquit
, nocnflct
, nosetuid
, rprcflag
;
54 extern char ilockfile
[], rlockfile
[], instdir
[], savlog
[],
55 tmpdir
[], pkgloc
[], pkgloc_sav
[], pkgbin
[], pkgsav
[],
57 extern char saveSpoolInstallDir
[];
59 static boolean_t preinstallCheck
= B_FALSE
;
60 static char *zoneName
= (char *)NULL
;
62 static char ask_cont
[100];
64 #define DISPSIZ 20 /* number of items to display on one page */
66 #define MSG_RUNLEVEL "\\nThe current run-level of this machine is <%s>, " \
67 "which is not a run-level suggested for installation " \
68 "of this package. Suggested run-levels (in order of " \
69 "preference) include:"
70 #define HLP_RUNLEVEL "If this package is not installed in a run-level " \
71 "which has been suggested, it is possible that the " \
72 "package may not install or operate properly. If " \
73 "you wish to follow the run-level suggestions, " \
74 "answer 'n' to stop installation of the package."
75 #define MSG_STATECHG "\\nTo change states, execute\\n\\tshutdown -y " \
76 "-i%s -g0\\nafter exiting the installation process. " \
77 "Please note that after changing states you " \
78 "may have to mount appropriate filesystem(s) " \
79 "in order to install this package."
81 #define ASK_CONFLICT "Do you want to install these conflicting files"
82 #define MSG_CONFLICT "\\nThe following files are already installed on the " \
83 "system and are being used by another package:"
84 #define MSG_ROGUE "\\n* - conflict with a file which does not " \
85 "belong to any package."
86 #define HLP_CONFLICT "If you choose to install conflicting files, the " \
87 "files listed above will be overwritten and/or have " \
88 "their access permissions changed. If you choose " \
89 "not to install these files, installation will " \
90 "proceed but these specific files will not be " \
91 "installed. Note that sane operation of the " \
92 "software being installed may require these files " \
93 "be installed; thus choosing to not to do so may " \
94 "cause inapropriate operation. If you wish to stop " \
95 "installation of this package, enter 'q' to quit."
97 #define ASK_SETUID "Do you want to install these as setuid/setgid files"
98 #define MSG_SETUID "\\nThe following files are being installed with " \
99 "setuid and/or setgid permissions:"
100 #define MSG_OVERWR "\\n* - overwriting a file which is also " \
102 #define HLP_SETUID "The package being installed appears to contain " \
103 "processes which will have their effective user or " \
104 "group ids set upon execution. History has shown " \
105 "that these types of processes can be a source of " \
106 "security problems on your system. If you choose " \
107 "not to install these as setuid files, installation " \
108 "will proceed but these specific files will be " \
109 "installed as regular files with setuid and/or " \
110 "setgid permissions reset. Note that sane " \
111 "operation of the software being installed may " \
112 "require that these files be installed with setuid " \
113 "or setgid permissions as delivered; thus choosing " \
114 "to install them as regular files may cause " \
115 "inapropriate operation. If you wish to stop " \
116 "installation of this package, enter 'q' to quit."
117 #define MSG_PARTINST "\\nThe installation of this package was previously " \
118 "terminated and installation was never successfully " \
120 #define MSG_PARTREM "\\nThe removal of this package was terminated at " \
121 "some point in time, and package removal was only " \
122 "partially completed."
123 #define HLP_PARTIAL "Installation of partially installed packages is " \
124 "normally allowable, but some packages providers " \
125 "may suggest that a partially installed package be " \
126 "completely removed before re-attempting " \
127 "installation. Check the documentation provided " \
128 "with this package, and then answer 'y' if you feel " \
129 "it is advisable to continue the installation process."
131 #define HLP_SPACE "It appears that there is not enough free space on " \
132 "your system in which to install this package. It " \
133 "is possible that one or more filesystems are not " \
134 "properly mounted. Neither installation of the " \
135 "package nor its operation can be guaranteed under " \
136 "these conditions. If you choose to disregard this " \
137 "warning, enter 'y' to continue the installation " \
139 #define HLP_DEPEND "The package being installed has indicated a " \
140 "dependency on the existence (or non-existence) " \
141 "of another software package. If this dependency is " \
142 "not met before continuing, the package may not " \
143 "install or operate properly. If you wish to " \
144 "disregard this dependency, answer 'y' to continue " \
145 "the installation process."
147 #define MSG_PRIV "\\nThis package contains scripts which will be " \
148 "executed with super-user permission during the " \
149 "process of installing this package."
150 #define HLP_PRIV "During the installation of this package, certain " \
151 "scripts provided with the package will execute with " \
152 "super-user permission. These scripts may modify or " \
153 "otherwise change your system without your " \
154 "knowledge. If you are certain of the origin and " \
155 "trustworthiness of the package being installed, " \
156 "answer 'y' to continue the installation process."
158 #define ASK_CONT "Do you want to continue with the installation of <%s>"
159 #define HLP_CONT "If you choose 'y', installation of this package " \
160 "will continue. If you want to stop installation " \
161 "of this package, choose 'n'."
163 #define MSG_MKPKGDIR "unable to make packaging directory <%s>"
165 #define MSG_CKCONFL_GZ "## Checking for conflicts with packages already " \
167 #define MSG_CKCONFL_LZ "## Checking for conflicts with packages already " \
168 "installed in zone <%s>."
169 #define MSG_CKDEPEND_GZ "## Verifying package dependencies."
170 #define MSG_CKDEPEND_LZ "## Verifying package dependencies in zone <%s>."
171 #define MSG_CKSPACE_GZ "## Verifying disk space requirements."
172 #define MSG_CKSPACE_LZ "## Verifying disk space requirements in zone <%s>."
173 #define MSG_CKUID_GZ "## Checking for setuid/setgid programs."
174 #define MSG_CKUID_LZ "## Checking for setuid/setgid programs in zone <%s>."
176 #define MSG_SCRFND "Package scripts were found."
177 #define MSG_UIDFND "Setuid/setgid processes detected."
178 #define MSG_ATTRONLY "!%s %s <attribute change only>"
180 #define MSG_CONTDISP "[Hit <RETURN> to continue display]"
182 #define ERR_NO_RUNST "unable to determine current run-state"
183 #define ERR_DEPFAILED "Dependency checking failed."
184 #define ERR_SPCFAILED "Space checking failed."
185 #define ERR_CNFFAILED "Conflict checking failed."
186 #define ERR_BADFILE "packaging file <%s> is corrupt"
192 * 2 - undefined error
193 * 3 - answer was not "y"/was "q"
194 * 4 - quit action taken
195 * 5 - interactive mode required
196 * If "preinstallcheck" is set to B_TRUE:
197 * 8 - partial install detected
198 * 9 - partial removal detected
207 if (ADM(partial
, "nocheck")) {
211 if (access(ilockfile
, F_OK
) == 0) {
212 if (preinstallCheck
== B_TRUE
) {
213 return (8); /* partial install detected */
216 (void) snprintf(ask_cont
, sizeof (ask_cont
),
217 gettext(ASK_CONT
), pkginst
);
219 msgtext
= gettext(MSG_PARTINST
);
220 ptext(stderr
, msgtext
);
222 if (ADM(partial
, "quit")) {
226 if (echoGetFlag() == B_FALSE
) {
233 if (n
= ckyorn(ans
, NULL
, NULL
, gettext(HLP_PARTIAL
),
238 if (strchr("yY", *ans
) == NULL
) {
244 if (access(rlockfile
, F_OK
) == 0) {
245 if (preinstallCheck
== B_TRUE
) {
246 return (9); /* partial removal detected */
249 (void) snprintf(ask_cont
, sizeof (ask_cont
),
250 gettext(ASK_CONT
), pkginst
);
253 msgtext
= gettext(MSG_PARTREM
);
254 ptext(stderr
, msgtext
);
256 if (ADM(partial
, "quit")) {
260 if (echoGetFlag() == B_FALSE
) {
267 if (n
= ckyorn(ans
, NULL
, NULL
, gettext(HLP_PARTIAL
),
272 if (strchr("yY", *ans
) == NULL
) {
285 * 2 - undefined error
286 * 3 - answer was not "y"/was "q"
287 * 4 - quit action taken
288 * 5 - interactive mode required
296 struct utmpx
*putmpx
;
297 char ans
[MAX_INPUT
], *pt
, *istates
, *pstate
;
301 if (ADM(runlevel
, "nocheck")) {
305 pt
= getenv("ISTATES");
310 utmpx
.ut_type
= RUN_LVL
;
311 putmpx
= getutxid(&utmpx
);
312 if (putmpx
== NULL
) {
313 progerr(gettext(ERR_NO_RUNST
));
317 (void) snprintf(ask_cont
, sizeof (ask_cont
),
318 gettext(ASK_CONT
), pkginst
);
321 * this cryptic code is trying to pull the run level
322 * out of the utmpx entry...the level starts in column
323 * 11 - looks like "run-level %c"
325 uxstate
= strtok(&putmpx
->ut_line
[10], " \t\n");
327 istates
= qstrdup(pt
);
328 if ((pt
= strtok(pt
, " \t\n, ")) == NULL
) {
329 return (0); /* no list is no list */
334 if (strcmp(pt
, uxstate
) == 0) {
338 } while (pt
= strtok(NULL
, " \t\n, "));
340 if (preinstallCheck
== B_FALSE
) {
341 msgtext
= gettext(MSG_RUNLEVEL
);
342 ptext(stderr
, msgtext
, uxstate
);
344 (void) fprintf(stdout
, "runlevel=%s", uxstate
);
347 pt
= strtok(istates
, " \t\n, ");
349 if (preinstallCheck
== B_FALSE
) {
350 ptext(stderr
, "\\t%s", pt
);
352 (void) fprintf(stdout
, ":%s", pt
);
354 } while (pt
= strtok(NULL
, " \t\n, "));
356 if (preinstallCheck
== B_TRUE
) {
357 (void) fprintf(stdout
, "\n");
362 if (preinstallCheck
== B_TRUE
) {
366 if (ADM(runlevel
, "quit")) {
370 if (echoGetFlag() == B_FALSE
) {
377 if (n
= ckyorn(ans
, NULL
, NULL
, gettext(HLP_RUNLEVEL
),
384 if (strchr("yY", *ans
) != NULL
) {
387 if (preinstallCheck
== B_FALSE
) {
388 ptext(stderr
, gettext(MSG_STATECHG
), pstate
);
398 * 2 - undefined error
399 * 3 - answer was not "y"/was "q"
400 * 4 - quit action taken
401 * 5 - interactive mode required
411 if (ADM(idepend
, "nocheck")) {
415 (void) snprintf(path
, sizeof (path
), "%s/%s", instdir
, DEPEND_FILE
);
416 if (access(path
, F_OK
) != 0) {
417 return (0); /* no dependency file provided by package */
420 if (zoneName
== (char *)NULL
) {
421 echo(gettext(MSG_CKDEPEND_GZ
));
423 echo(gettext(MSG_CKDEPEND_LZ
), zoneName
);
426 if (dockdeps(path
, 0, preinstallCheck
)) {
427 (void) snprintf(ask_cont
, sizeof (ask_cont
),
428 gettext(ASK_CONT
), pkginst
);
429 msgtext
= gettext(ERR_DEPFAILED
);
431 if (preinstallCheck
== B_TRUE
) {
435 if (ADM(idepend
, "quit")) {
439 if (echoGetFlag() == B_FALSE
) {
446 if (n
= ckyorn(ans
, NULL
, NULL
, gettext(HLP_DEPEND
),
451 if (strchr("yY", *ans
) == NULL
) {
462 cksetZoneName(char *a_zoneName
)
464 zoneName
= a_zoneName
;
468 cksetPreinstallCheck(boolean_t a_preinstallCheck
)
470 preinstallCheck
= a_preinstallCheck
;
477 * 2 - undefined error
478 * 3 - answer was not "y"/was "q"
479 * 4 - quit action taken
480 * 5 - interactive mode required
489 if (ADM(space
, "nocheck")) {
493 if (zoneName
== (char *)NULL
) {
494 echo(gettext(MSG_CKSPACE_GZ
));
496 echo(gettext(MSG_CKSPACE_LZ
), zoneName
);
499 (void) snprintf(path
, sizeof (path
), "%s/install/space", instdir
);
500 if (access(path
, F_OK
) == 0) {
507 msgtext
= gettext(ERR_SPCFAILED
);
508 (void) snprintf(ask_cont
, sizeof (ask_cont
),
509 gettext(ASK_CONT
), pkginst
);
511 if (preinstallCheck
== B_TRUE
) {
515 if (ADM(space
, "quit")) {
519 if (echoGetFlag() == B_FALSE
) {
526 n
= ckyorn(ans
, NULL
, NULL
, gettext(HLP_SPACE
), ask_cont
);
531 if (strchr("yY", *ans
) == NULL
) {
545 if (mkpath(get_PKGADM())) {
546 if (preinstallCheck
== B_TRUE
) {
547 (void) fprintf(stdout
, "ckdirs=%s\n", get_PKGADM());
549 progerr(gettext(MSG_MKPKGDIR
), get_PKGADM());
554 (void) snprintf(path
, sizeof (path
), "%s/admin", get_PKGADM());
557 if (preinstallCheck
== B_TRUE
) {
558 (void) fprintf(stdout
, "ckdirs=%s\n", path
);
560 progerr(gettext(MSG_MKPKGDIR
), path
);
565 (void) snprintf(path
, sizeof (path
), "%s/logs", get_PKGADM());
568 if (preinstallCheck
== B_TRUE
) {
569 (void) fprintf(stdout
, "ckdirs=%s\n", path
);
571 progerr(gettext(MSG_MKPKGDIR
), path
);
576 if (mkpath(PKGSCR
)) {
577 if (preinstallCheck
== B_TRUE
) {
578 (void) fprintf(stdout
, "ckdirs=%s\n", PKGSCR
);
580 progerr(gettext(MSG_MKPKGDIR
), PKGSCR
);
585 if (mkpath(get_PKGLOC())) {
586 if (preinstallCheck
== B_TRUE
) {
587 (void) fprintf(stdout
, "ckdirs=%s\n", get_PKGLOC());
589 progerr(gettext(MSG_MKPKGDIR
), get_PKGLOC());
604 boolean_t nonExistentPkgloc
= B_FALSE
;
607 * If pkgloc doesn't exist make sure it gets removed after creating
608 * it if this is a preinstall check. All dryrun and preinstallation
609 * checks must not modify the file system.
612 if (access(pkgloc
, F_OK
) != 0) {
613 nonExistentPkgloc
= B_TRUE
;
616 if (mkpath(pkgloc
)) {
617 if (preinstallCheck
== B_TRUE
) {
618 (void) fprintf(stdout
, "ckdirs=%s\n", pkgloc
);
620 progerr(gettext(MSG_MKPKGDIR
), pkgloc
);
625 if (mkpath(pkgbin
)) {
626 if (preinstallCheck
== B_TRUE
) {
627 (void) fprintf(stdout
, "ckdirs=%s\n", pkgbin
);
629 progerr(gettext(MSG_MKPKGDIR
), pkgbin
);
634 if (mkpath(pkgsav
)) {
635 if (preinstallCheck
== B_TRUE
) {
636 (void) fprintf(stdout
, "ckdirs=%s\n", pkgsav
);
638 progerr(gettext(MSG_MKPKGDIR
), pkgsav
);
643 if (!is_spool_create() && mkpath(saveSpoolInstallDir
)) {
644 if (preinstallCheck
== B_TRUE
) {
645 (void) fprintf(stdout
, "ckdirs=%s\n", pkgsav
);
647 progerr(gettext(MSG_MKPKGDIR
), pkgsav
);
652 if (preinstallCheck
&& nonExistentPkgloc
) {
663 * 2 - undefined error
664 * 3 - answer was not "y"/was "q"
665 * 4 - quit action taken
666 * 5 - interactive mode required
672 int i
, n
, count
, has_a_rogue
= 0;
675 if (ADM(conflict
, "nochange")) {
680 if (ADM(conflict
, "nocheck")) {
684 if (zoneName
== (char *)NULL
) {
685 echo(gettext(MSG_CKCONFL_GZ
));
687 echo(gettext(MSG_CKCONFL_LZ
), zoneName
);
691 for (i
= 0; extlist
[i
]; i
++) {
693 struct mergstat
*mstat
;
695 if (extlist
[i
]->cf_ent
.ftype
== 'i') {
699 ept
= &(extlist
[i
]->cf_ent
);
700 mstat
= &(extlist
[i
]->mstat
);
702 if (is_remote_fs(ept
->path
, &(extlist
[i
]->fsys_value
)) &&
703 !is_fs_writeable(ept
->path
,
704 &(extlist
[i
]->fsys_value
))) {
709 * If no other package claims it or it's from a continuation
712 if (!mstat
->shared
|| mstat
->preloaded
) {
716 if (ept
->ftype
== 'e') {
724 if (mstat
->contchg
) {
726 if (preinstallCheck
== B_FALSE
) {
727 ptext(stderr
, gettext(MSG_CONFLICT
));
729 } else if ((echoGetFlag() == B_TRUE
) &&
730 ((count
% DISPSIZ
) == 0)) {
731 echo(gettext(MSG_CONTDISP
));
735 * NOTE : The leading "!" in this string forces
736 * puttext() to print leading white space.
739 if (preinstallCheck
== B_FALSE
) {
740 ptext(stderr
, "!%s %s",
741 (mstat
->rogue
) ? "*" : " ", ept
->path
);
743 (void) fprintf(stdout
,
744 "conflict-contents=%s\n", ept
->path
);
746 } else if (mstat
->attrchg
) {
748 if (preinstallCheck
== B_FALSE
) {
749 ptext(stderr
, gettext(MSG_CONFLICT
));
751 } else if ((echoGetFlag() == B_TRUE
) &&
752 ((count
% DISPSIZ
) == 0)) {
753 echo(gettext(MSG_CONTDISP
));
756 if (preinstallCheck
== B_FALSE
) {
757 ptext(stderr
, gettext(MSG_ATTRONLY
),
758 (mstat
->rogue
) ? "*" : " ", ept
->path
);
760 (void) fprintf(stdout
,
761 "conflict-attributes=%s\n", ept
->path
);
768 if (preinstallCheck
== B_FALSE
) {
769 ptext(stderr
, gettext(MSG_ROGUE
));
773 msgtext
= gettext(ERR_CNFFAILED
);
775 if (preinstallCheck
== B_TRUE
) {
779 if (ADM(conflict
, "quit")) {
783 if (echoGetFlag() == B_FALSE
) {
789 if (n
= ckyorn(ans
, NULL
, NULL
, gettext(HLP_CONFLICT
),
790 gettext(ASK_CONFLICT
))) {
794 if (strchr("yY", *ans
) == NULL
) {
796 (void) snprintf(ask_cont
, sizeof (ask_cont
),
797 gettext(ASK_CONT
), pkginst
);
799 if (n
= ckyorn(ans
, NULL
, NULL
, gettext(HLP_CONT
),
804 if (strchr("yY", *ans
) == NULL
) {
819 * 2 - undefined error
820 * 3 - answer was not "y"/was "q"
821 * 4 - quit action taken
822 * 5 - interactive mode required
828 int i
, n
, count
, overwriting
= 0;
831 /* See if the administrative defaults already resolve this check. */
832 if (ADM(setuid
, "nocheck")) {
836 if (ADM(setuid
, "nochange")) {
837 nosetuid
++; /* Do not install processes as setuid/gid. */
841 /* The administrative defaults require review of the package. */
843 if (zoneName
== (char *)NULL
) {
844 echo(gettext(MSG_CKUID_GZ
));
846 echo(gettext(MSG_CKUID_LZ
), zoneName
);
850 for (i
= 0; extlist
[i
]; i
++) {
852 struct mergstat
*mstat
= &(extlist
[i
]->mstat
);
855 * Provide the administrator with info as to whether there is
856 * already a setuid process in place. This is only necessary
857 * to help the administrator decide whether or not to lay
858 * down the process, it doesn't have anything to do with the
859 * administrative defaults.
861 if (mstat
->osetuid
|| mstat
->osetgid
) {
867 if (mstat
->setuid
|| mstat
->setgid
) {
869 if (preinstallCheck
== B_FALSE
) {
870 ptext(stderr
, gettext(MSG_SETUID
));
872 } else if ((echoGetFlag() == B_TRUE
) &&
873 ((count
% DISPSIZ
) == 0)) {
874 echo(gettext(MSG_CONTDISP
));
878 * NOTE : The leading "!" in these strings forces
879 * puttext() to print leading white space.
882 if (mstat
->setuid
&& mstat
->setgid
) {
883 if (preinstallCheck
== B_FALSE
) {
884 ptext(stderr
, gettext(
885 "!%s %s <setuid %s setgid %s>"),
886 (overwr
) ? "*" : " ",
887 extlist
[i
]->cf_ent
.path
,
888 extlist
[i
]->cf_ent
.ainfo
.owner
,
889 extlist
[i
]->cf_ent
.ainfo
.group
);
891 (void) fprintf(stdout
, "setuid=%s:%s\n",
892 extlist
[i
]->cf_ent
.path
,
893 extlist
[i
]->cf_ent
.ainfo
.owner
);
894 (void) fprintf(stdout
, "setgid=%s:%s\n",
895 extlist
[i
]->cf_ent
.path
,
896 extlist
[i
]->cf_ent
.ainfo
.group
);
898 } else if (mstat
->setuid
) {
899 if (preinstallCheck
== B_FALSE
) {
900 ptext(stderr
, gettext(
901 "!%s %s <setuid %s>"),
902 (overwr
) ? "*" : " ",
903 extlist
[i
]->cf_ent
.path
,
904 extlist
[i
]->cf_ent
.ainfo
.owner
);
906 (void) fprintf(stdout
, "setuid=%s:%s\n",
907 extlist
[i
]->cf_ent
.path
,
908 extlist
[i
]->cf_ent
.ainfo
.owner
);
910 } else if (mstat
->setgid
) {
911 if (preinstallCheck
== B_FALSE
) {
912 ptext(stderr
, gettext(
913 "!%s%s <setgid %s>"),
914 (overwr
) ? "*" : " ",
915 extlist
[i
]->cf_ent
.path
,
916 extlist
[i
]->cf_ent
.ainfo
.group
);
918 (void) fprintf(stdout
, "setgid=%s:%s\n",
919 extlist
[i
]->cf_ent
.path
,
920 extlist
[i
]->cf_ent
.ainfo
.group
);
928 if (preinstallCheck
== B_FALSE
) {
929 ptext(stderr
, gettext(MSG_OVERWR
));
931 (void) fprintf(stdout
,
932 "setuid-overwrite=true\n");
936 msgtext
= gettext(MSG_UIDFND
);
938 if (preinstallCheck
== B_TRUE
) {
942 if (ADM(setuid
, "quit")) {
945 if (echoGetFlag() == B_FALSE
) {
950 if (n
= ckyorn(ans
, NULL
, NULL
, gettext(HLP_SETUID
),
951 gettext(ASK_SETUID
))) {
954 if (strchr("yY", *ans
) == NULL
) {
956 (void) snprintf(ask_cont
, sizeof (ask_cont
),
957 gettext(ASK_CONT
), pkginst
);
958 if (n
= ckyorn(ans
, NULL
, NULL
, gettext(HLP_CONT
),
962 if (strchr("yY", *ans
) == NULL
) {
978 * 2 - undefined error
979 * 3 - answer was not "y"/was "q"
980 * 4 - quit action taken
981 * 5 - interactive mode required
990 char ans
[MAX_INPUT
], path
[PATH_MAX
];
992 if (ADM(action
, "nocheck")) {
996 (void) snprintf(path
, sizeof (path
), "%s/install", instdir
);
997 if ((dirfp
= opendir(path
)) == NULL
) {
1002 while ((dp
= readdir(dirfp
)) != NULL
) {
1003 if (strcmp(dp
->d_name
, "preinstall") == 0 ||
1004 strcmp(dp
->d_name
, "postinstall") == 0 ||
1005 strncmp(dp
->d_name
, "i.", 2) == 0) {
1010 (void) closedir(dirfp
);
1013 if (preinstallCheck
== B_FALSE
) {
1014 ptext(stderr
, gettext(MSG_PRIV
));
1015 msgtext
= gettext(MSG_SCRFND
);
1017 (void) snprintf(ask_cont
, sizeof (ask_cont
),
1018 gettext(ASK_CONT
), pkginst
);
1020 if (preinstallCheck
== B_TRUE
) {
1024 if (ADM(action
, "quit")) {
1028 if (echoGetFlag() == B_FALSE
) {
1035 if (n
= ckyorn(ans
, NULL
, NULL
, gettext(HLP_PRIV
),
1040 if (strchr("yY", *ans
) == NULL
) {
1061 char source
[PATH_MAX
];
1064 for (i
= 0; extlist
[i
]; i
++) {
1065 ept
= &(extlist
[i
]->cf_ent
);
1066 if (ept
->ftype
!= 'i') {
1070 if (ept
->ainfo
.local
) {
1071 (void) snprintf(source
, sizeof (source
),
1072 "%s/%s", instdir
, ept
->ainfo
.local
);
1073 } else if (strcmp(ept
->path
, PKGINFO
) == 0) {
1074 (void) snprintf(source
, sizeof (source
),
1075 "%s/%s", instdir
, ept
->path
);
1077 (void) snprintf(source
, sizeof (source
),
1078 "%s/install/%s", instdir
, ept
->path
);
1080 if (cverify(0, &ept
->ftype
, source
, &ept
->cinfo
, 1)) {
1082 if (preinstallCheck
== B_FALSE
) {
1083 progerr(gettext(ERR_BADFILE
), source
);
1084 logerr(getErrbufAddr());
1086 (void) fprintf(stdout
, "ckpkgfilebad=%s",