/*
* 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
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#include <pkgstrct.h>
#include <pkglocs.h>
#include <locale.h>
#include <libintl.h>
#include <pkglib.h>
#include "libadm.h"
#include "libinst.h"
extern short npaths;
extern short used[];
/* ckentry.c */
gpkgmapvfp((P), (VFP)))
"and cannot be verified"
static int shellmatch(char *, char *);
static int is_partial_path_in_DB(char *, char *);
int selpath(char *, int);
int selpkg(char *);
/*
* This routine checks all files which are referenced in the pkgmap which is
* identified by the mapfile arg. When the package is installed, the mapfile
* may be the contents file or a separate pkgmap (maptyp tells the function
* which it is). The variable uninst tells the function whether the package
* is in the installed state or not. The envfile entry is usually a pkginfo
* file, but it could be any environment parameter list.
*/
int
{
char *value;
int count;
int errflg;
int n;
int selected;
return (-1);
}
param[0] = '\0';
/*
* If checking an uninstalled package, we
* only want two parameters. If we took all
* of them, including path definitions, we
* wouldn't be looking in the right places in
* the reloc and root directories.
*/
if (uninst) {
16) == 0) && value) {
}
7) == 0) && value)
} else
}
param[0] = '\0';
}
}
/*
* If we are using a contents file for the map, this locks the
* contents file in order to freeze the database and assure it
* remains synchronized with the file system against which it is
* being compared. There is no practical way to lock another pkgmap
* on some unknown medium so we don't bother.
*/
if (maptyp) { /* If this is the contents file */
return (-1);
}
} else {
return (-1);
}
}
do {
break;
}
/*
* Search for partial paths in the ext DB.
*/
if (pathtype) {
/* LINTED warning: statement has no consequent: if */
/* Check this entry */
;
/* LINTED warning: statement has no consequen */
/* Check this entry */
;
} else {
continue;
}
} else {
/* Skip to next DB entry */
continue;
}
}
if (n < 0) {
"Unknown");
exit(99);
}
if (n == 0)
break; /* done with file */
/*
* The class list may not be complete for good reason, so
* there's no complaining if this returns an index of -1.
*/
/*
* check to see if the entry we just read
* is associated with one of the packages
* we have listed on the command line
*/
selected = 0;
while (pinfo) {
selected++;
break;
}
}
if (!selected)
continue; /* not selected */
}
/*
* Check to see if the pathname associated with the entry
* we just read is associated with the list of paths we
* supplied on the command line
*/
continue; /* not selected */
/*
* Determine if this is a package object wanting
* verification. Metafiles are always checked, otherwise, we
* rely on the class to discriminate.
*/
/* If there's no class list... */
/*
* ... or this entry isn't in that class list
* or it's in a private format, then don't
* check it.
*/
continue;
count++;
errflg++;
} while (n != 0);
if (maptyp)
relslock();
else
if (environ) {
/* free up environment resources */
for (n = 0; environ[n]; n++)
}
if (maptyp) {
/*
* make sure each listed package was associated with
* an entry from the prototype or pkgmap
*/
}
/*
* make sure each listed pathname was associated with an entry
* from the prototype or pkgmap
*/
}
return (errflg);
}
int
selpkg(char *p)
{
static char *selected;
char *root;
register int i;
if (p == NULL) {
if (pkgcnt) {
for (i = 0; i < pkgcnt; ++i) {
/* bugid 1227628 */
root = get_inst_root();
if (root)
sizeof (buf),
else
sizeof (buf),
pkg[i]);
pkg[i]);
else
pkg[i]);
}
}
} else {
for (i = 0; i < pkgcnt; ++i) {
root = get_inst_root();
if (root)
sizeof (buf),
else
sizeof (buf),
pkg[i]);
pkg[i]);
else
pkg[i]);
}
}
}
return (0); /* return value not important */
} else if (pkgcnt == 0)
return (1);
selected =
exit(99);
/*NOTREACHED*/
}
}
for (i = 0; i < pkgcnt; ++i) {
selected[i] = 'b';
return (1);
}
}
return (0);
}
int
{
int n;
if (!npaths)
return (1); /* everything is selectable */
for (n = 0; n < npaths; n++) {
if (!used[n])
partial_path ? ppathlist[n] :
pathlist[n]);
} else if (partial_path) {
used[n] = 1;
return (1);
used[n] = 1;
return (1);
}
}
return (0); /* not selected */
}
static int
{
/* Check if the value is NULL */
return (1);
}
return (0);
return (1);
}
static int
{
return (0);
} else {
return (1);
}
}