2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 1993, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
2N/A/* All Rights Reserved */
2N/A
2N/A#ifndef _PKGLIB_H
2N/A#define _PKGLIB_H
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#include <sys/types.h>
2N/A#include <limits.h>
2N/A#include <stdio.h>
2N/A#include <pkgdev.h>
2N/A#include <pkgstrct.h>
2N/A#include <openssl/bio.h>
2N/A#include <openssl/x509.h>
2N/A#include <netdb.h>
2N/A#include <boot_http.h>
2N/A#include "pkgerr.h"
2N/A#include "keystore.h"
2N/A#include "cfext.h"
2N/A
2N/A/*
2N/A * The contents database file interface.
2N/A */
2N/A
2N/Atypedef struct pkg_server *PKGserver;
2N/A
2N/A/* Some commands modify the internal database: add them here */
2N/A#define PKG_WRITE_COMMAND(cmd) ((cmd) == PKG_ADDLINES)
2N/A
2N/A#define PKG_EXIT 0x0
2N/A#define PKG_FINDFILE 0x1
2N/A#define PKG_DUMP 0x2
2N/A#define PKG_PKGSYNC 0x3
2N/A#define PKG_FILTER 0x4
2N/A#define PKG_ADDLINES 0x5
2N/A#define PKG_NOP 0x6
2N/A
2N/A#define SUNW_PKG_SERVERMODE "SUNW_PKG_SERVERMODE"
2N/A
2N/A#define PKGSERV_MODE "pkg-server-mode="
2N/A#define PKGSERV_MODE_LEN (sizeof (PKGSERV_MODE) - 1)
2N/A
2N/A#define MODE_PERMANENT "permanent"
2N/A#define MODE_RUN_ONCE "run_once"
2N/A#define MODE_TIMEOUT "timeout"
2N/A
2N/A#define MAXLOGFILESIZE (20 * 1024 * 1024)
2N/A
2N/A#define PKGLOG "pkglog"
2N/A#define PKGDOOR ".door"
2N/A
2N/Atypedef enum {
2N/A INVALID, /* Not initialized */
2N/A NEVER, /* Don't start, does check if it is running. */
2N/A FLUSH_LOG, /* Run it once to incorporate the log. */
2N/A RUN_ONCE, /* Run until the current client stops. */
2N/A TIMEOUT, /* Run until a timeout occurs. */
2N/A PERMANENT, /* Run until it is externally terminated. */
2N/A DEFAULTMODE = TIMEOUT /* The default mode, must come last */
2N/A} start_mode_t;
2N/A
2N/Atypedef struct pkgcmd {
2N/A int cmd;
2N/A char buf[1];
2N/A} pkgcmd_t;
2N/A
2N/Atypedef struct pkgfilter {
2N/A int cmd;
2N/A int len;
2N/A char buf[1];
2N/A} pkgfilter_t;
2N/A
2N/A/*
2N/A * Virtual File Protocol definitions
2N/A */
2N/A
2N/A/*
2N/A * flags associated with virtual file protocol operations; note that these flags
2N/A * may only occupy the low order 16 bits of the 32-bit unsigned flag.
2N/A */
2N/A
2N/Atypedef unsigned long VFPFLAGS_T;
2N/A
2N/A#define VFP_NONE 0x00000000 /* no special flags */
2N/A#define VFP_NEEDNOW 0x00000001 /* need memory now */
2N/A#define VFP_SEQUENTIAL 0x00000002 /* sequential access */
2N/A#define VFP_RANDOM 0x00000004 /* random access */
2N/A#define VFP_NOMMAP 0x00000008 /* do not use mmap to access file */
2N/A#define VFP_NOMALLOC 0x00000010 /* do not use malloc to buffer file */
2N/A
2N/A/* virtual file protocol object */
2N/A
2N/Atypedef struct _vfp VFP_T;
2N/A
2N/A/* structure behind the virtual file protocol object */
2N/A
2N/Astruct _vfp {
2N/A FILE *_vfpFile; /* -> opened FILE */
2N/A char *_vfpCurr; /* -> current byte to read/write */
2N/A char *_vfpHighWater; /* -> last byte modified */
2N/A char *_vfpEnd; /* -> last data byte */
2N/A char *_vfpPath; /* -> path associated with FILE */
2N/A char *_vfpStart; /* -> first data byte */
2N/A void *_vfpExtra; /* undefined */
2N/A size_t _vfpSize; /* size of mapped/allocated area */
2N/A size_t _vfpMapSize; /* # mapped bytes */
2N/A VFPFLAGS_T _vfpFlags; /* flags associated with vfp/data */
2N/A int _vfpOverflow; /* non-zero if buffer write overflow */
2N/A blkcnt_t _vfpCkStBlocks; /* checkpoint # blocks */
2N/A dev_t _vfpCkDev; /* checkpoint device i.d. */
2N/A ino_t _vfpCkIno; /* checkpoint inode # */
2N/A off_t _vfpCkSize; /* checkpoint size */
2N/A time_t _vfpCkMtime; /* checkpoint modification time */
2N/A};
2N/A
2N/A/*
2N/A * get highest modified byte (length) contained in vfp
2N/A *
2N/A * determine number of bytes to write - it will be the highest of:
2N/A * -- the current pointer into the file - this is updated whenever
2N/A * the location of the file is changed by a single byte
2N/A * -- the last "high water mark" - the last known location that
2N/A * was written to the file - updated only when the location
2N/A * of the file is directly changed - e.g. vfpSetCurrCharPtr,
2N/A * vfpTruncate, vfpRewind.
2N/A * this reduces the "bookkeeping" that needs to be done to know
2N/A * how many bytes to write out to the file - typically a file is
2N/A * written sequentially so the current file pointer is sufficient
2N/A * to determine how many bytes to write out.
2N/A */
2N/A
2N/A#define vfpGetModifiedLen(VFP) \
2N/A (size_t)(((VFP)->_vfpHighWater > (VFP)->_vfpCurr) ? \
2N/A (((ptrdiff_t)(VFP)->_vfpHighWater - \
2N/A (ptrdiff_t)(VFP)->_vfpStart)) : \
2N/A (((ptrdiff_t)(VFP)->_vfpCurr - \
2N/A (ptrdiff_t)(VFP)->_vfpStart)))
2N/A
2N/A/*
2N/A * increment current pointer by specified delta
2N/A * if the delta exceeds the buffer size, set pointer to buffer end
2N/A */
2N/A#define vfpIncCurrPtrBy(VFP, INC) \
2N/A { \
2N/A ((VFP)->_vfpCurr) += (INC); \
2N/A if (((VFP)->_vfpCurr) > ((VFP)->_vfpEnd)) { \
2N/A (VFP)->_vfpCurr = (VFP)->_vfpEnd; \
2N/A (VFP)->_vfpOverflow = 1; \
2N/A } \
2N/A if ((VFP)->_vfpHighWater < (VFP)->_vfpCurr) { \
2N/A (VFP)->_vfpHighWater = (VFP)->_vfpCurr; \
2N/A } \
2N/A }
2N/A
2N/A/* get the path associated with the vfp */
2N/A#define vfpGetPath(VFP) ((VFP)->_vfpPath)
2N/A
2N/A/* get a string from the vfp into a fixed size buffer */
2N/A#define vfpGets(VFP, PTR, LEN) \
2N/A { \
2N/A char *XXpXX = (PTR); \
2N/A size_t XXlXX = (LEN); \
2N/A while ((*(VFP)->_vfpCurr != '\0') && \
2N/A (*(VFP)->_vfpCurr != '\n')) { \
2N/A if (XXlXX > 1) { \
2N/A *XXpXX++ = *(VFP)->_vfpCurr; \
2N/A XXlXX--; \
2N/A } \
2N/A (VFP)->_vfpCurr++; \
2N/A } \
2N/A *XXpXX++ = '\0'; \
2N/A if (*(VFP)->_vfpCurr != '\0') { \
2N/A (VFP)->_vfpCurr++; \
2N/A } \
2N/A }
2N/A
2N/A/* get number of bytes remaining to read */
2N/A#define vfpGetBytesRemaining(VFP) \
2N/A (((((VFP)->_vfpHighWater) <= ((VFP)->_vfpCurr))) ? 0 : \
2N/A ((((ptrdiff_t)(VFP)->_vfpHighWater)-((ptrdiff_t)(VFP)->_vfpCurr))))
2N/A
2N/A/* get number of bytes remaining to write */
2N/A#define vfpGetBytesAvailable(VFP) \
2N/A (((((VFP)->_vfpEnd) <= ((VFP)->_vfpCurr))) ? 0 : \
2N/A ((((ptrdiff_t)(VFP)->_vfpEnd)-((ptrdiff_t)(VFP)->_vfpCurr))))
2N/A
2N/A/* put current character and increment to next */
2N/A#define vfpPutc(VFP, C) \
2N/A { \
2N/A (*(VFP)->_vfpCurr) = ((char)(C)); \
2N/A vfpIncCurrPtrBy((VFP), 1); \
2N/A }
2N/A
2N/A/* put integer to current character and increment */
2N/A#define vfpPutInteger(VFP, NUMBER) vfpPutFormat((VFP), "%d", (NUMBER))
2N/A
2N/A/* put long to current character and increment */
2N/A#define vfpPutLong(VFP, NUMBER) vfpPutFormat((VFP), "%ld", (NUMBER))
2N/A
2N/A/* get current character and increment to next */
2N/A#define vfpGetc(VFP) (*(VFP)->_vfpCurr++)
2N/A
2N/A/* get current character - do not increment */
2N/A#define vfpGetcNoInc(VFP) (*(VFP)->_vfpCurr)
2N/A
2N/A/* get pointer to current character */
2N/A#define vfpGetCurrCharPtr(VFP) ((VFP)->_vfpCurr)
2N/A
2N/A/* increment current character pointer */
2N/A#define vfpIncCurrPtr(VFP) vfpIncCurrPtrBy((VFP), 1)
2N/A
2N/A/* decrement current character pointer */
2N/A#define vfpDecCurrPtr(VFP) ((VFP)->_vfpCurr--)
2N/A
2N/A/* get pointer to first data byte in buffer */
2N/A#define vfpGetFirstCharPtr(VFP) ((VFP)->_vfpStart)
2N/A
2N/A/* get pointer to last data byte in buffer */
2N/A#define vfpGetLastCharPtr(VFP) ((VFP)->_vfpHighWater)
2N/A
2N/A/* set pointer to current character */
2N/A#define vfpSetCurrCharPtr(VFP, PTR) \
2N/A if ((VFP)->_vfpCurr > (VFP)->_vfpHighWater) { \
2N/A (VFP)->_vfpHighWater = (VFP)->_vfpCurr; \
2N/A } \
2N/A ((VFP)->_vfpCurr = (PTR))
2N/A
2N/A/* set pointer to last data byte in buffer */
2N/A#define vfpSetLastCharPtr(VFP, PTR) \
2N/A if ((PTR) >= (VFP)->_vfpStart) { \
2N/A (VFP)->_vfpHighWater = (PTR); \
2N/A if ((VFP)->_vfpCurr > (VFP)->_vfpHighWater) { \
2N/A (VFP)->_vfpCurr = (VFP)->_vfpHighWater; \
2N/A } \
2N/A }
2N/A
2N/A/* seek to end of file - one past last data byte in file */
2N/A#define vfpSeekToEnd(VFP) ((VFP)->_vfpCurr = ((VFP)->_vfpHighWater)+1)
2N/A
2N/A/* get number of bytes between current char and specified char */
2N/A#define vfpGetCurrPtrDelta(VFP, P) \
2N/A (((ptrdiff_t)(P))-((ptrdiff_t)(VFP)->_vfpCurr))
2N/A
2N/A/* put string to current character and increment */
2N/A#define vfpPuts(VFP, S) \
2N/A { \
2N/A size_t xxLen; \
2N/A size_t xxResult; \
2N/A xxLen = vfpGetBytesAvailable((VFP)); \
2N/A xxResult = strlcpy(((VFP)->_vfpCurr), (S), xxLen); \
2N/A vfpIncCurrPtrBy((VFP), xxResult); \
2N/A }
2N/A
2N/A/* put fixed number of bytes to current character and increment */
2N/A#define vfpPutBytes(VFP, PTR, LEN) \
2N/A { \
2N/A size_t xxLen; \
2N/A xxLen = vfpGetBytesAvailable((VFP)); \
2N/A if (xxLen > (LEN)) { \
2N/A xxLen = (LEN); \
2N/A } else { \
2N/A (VFP)->_vfpOverflow = 1; \
2N/A } \
2N/A memcpy((VFP)->_vfpCurr, (PTR), (xxLen)); \
2N/A vfpIncCurrPtrBy((VFP), (xxLen)); \
2N/A }
2N/A
2N/A/* put format one arg to current character and increment */
2N/A#define vfpPutFormat(VFP, FORMAT, ARG) \
2N/A { \
2N/A char xxTeMpXX[256]; \
2N/A (void) snprintf(xxTeMpXX, sizeof (xxTeMpXX), (FORMAT), (ARG)); \
2N/A vfpPuts((VFP), xxTeMpXX); \
2N/A }
2N/A
2N/Astruct dm_buf {
2N/A char *text_buffer; /* start of allocated buffer */
2N/A int offset; /* number of bytes into the text_buffer */
2N/A int allocation; /* size of buffer in bytes */
2N/A};
2N/A
2N/A/* This structure is used to hold a dynamically growing string */
2N/A
2N/Astruct dstr {
2N/A char *pc;
2N/A int len;
2N/A int max;
2N/A};
2N/A
2N/A/* setmapmode() defines */
2N/A#define MAPALL 0 /* resolve all variables */
2N/A#define MAPBUILD 1 /* map only build variables */
2N/A#define MAPINSTALL 2 /* map only install variables */
2N/A#define MAPNONE 3 /* map no variables */
2N/A
2N/A#define NON_ABI_NAMELNGTH 33 /* 32 chars for name + 1 for NULL */
2N/A
2N/A#define BLK_SIZE 512 /* size of logical block */
2N/A
2N/A/* max length for printed attributes */
2N/A#define ATTR_MAX 80
2N/A
2N/A/*
2N/A * These three defines indicate that the prototype file contains a '?'
2N/A * meaning do not specify this data in the pkgmap entry.
2N/A */
2N/A#define CURMODE BADMODE /* current mode has been specified */
2N/A#define CUROWNER BADOWNER /* ... same for owner ... */
2N/A#define CURGROUP BADGROUP /* ... and group. */
2N/A
2N/A#define WILDCARD BADMODE >> 1
2N/A#define DB_UNDEFINED_ENTRY "?"
2N/A
2N/A#define DEFAULT_MODE 0755
2N/A#define DEFAULT_MODE_FILE 0644
2N/A#define DEFAULT_OWNER "root"
2N/A#define DEFAULT_GROUP "other"
2N/A
2N/A#define INST_RELEASE "var/sadm/system/admin/INST_RELEASE"
2N/A
2N/A#define RANDOM "/dev/urandom"
2N/A#define BLOCK 256
2N/A
2N/A#define TERM_WIDTH 60
2N/A#define SMALL_DIVISOR 4
2N/A#define MED_DIVISOR 5
2N/A#define LARGE_DIVISOR 10
2N/A#define MED_DWNLD (10 * 1024 * 1024) /* 10 MB */
2N/A#define LARGE_DWNLD (5 * MED_DWNLD) /* 50 MB */
2N/A
2N/A#define HTTP "http://"
2N/A#define HTTPS "https://"
2N/A
2N/A#define PKGADD "pkgadd"
2N/A
2N/A/* Settings for network admin defaults */
2N/A
2N/A#define NET_TIMEOUT_DEFAULT 60
2N/A#define NET_RETRIES_DEFAULT 3
2N/A#define NET_TIMEOUT_MIN 1 /* 1 second */
2N/A#define NET_TIMEOUT_MAX (5 * 60) /* 5 minutes */
2N/A#define NET_RETRIES_MIN 1
2N/A#define NET_RETRIES_MAX 10
2N/A#define AUTH_NOCHECK 0
2N/A#define AUTH_QUIT 1
2N/A
2N/A/* package header magic tokens */
2N/A#define HDR_PREFIX "# PaCkAgE DaTaStReAm"
2N/A#define HDR_SUFFIX "# end of header"
2N/A
2N/A/* name of security files */
2N/A#define PKGSEC "/var/sadm/security"
2N/A#define SIGNATURE_FILENAME "signature"
2N/A
2N/A#define GROUP "/etc/group"
2N/A#define PASSWD "/etc/passwd"
2N/A
2N/A/*
2N/A * The next three mean that no mode, owner or group was specified or that the
2N/A * one specified is invalid for some reason. Sometimes this is an error in
2N/A * which case it is generally converted to CUR* with a warning. Other times
2N/A * it means "look it up" by stating the existing file system object pointred
2N/A * to in the prototype file.
2N/A */
2N/A#define NOMODE (BADMODE-1)
2N/A#define NOOWNER "@"
2N/A#define NOGROUP "@"
2N/A
2N/A/* string comparitor abbreviators */
2N/A
2N/A#define ci_streq(a, b) (strcasecmp((a), (b)) == 0)
2N/A#define ci_strneq(a, b, c) (strncasecmp((a), (b), (c)) == 0)
2N/A#define streq(a, b) (strcmp((a), (b)) == 0)
2N/A#define strneq(a, b, c) (strncmp((a), (b), (c)) == 0)
2N/A
2N/Aextern FILE *epopen(char *cmd, char *mode);
2N/Aextern char **gpkglist(char *dir, char **pkg, char **catg);
2N/Aextern int is_not_valid_length(char **category);
2N/Aextern int is_not_valid_category(char **category, char *progname);
2N/Aextern int is_same_CATEGORY(char **category, char *installed_category);
2N/Aextern char **get_categories(char *catg_arg);
2N/A
2N/Aextern void pkglist_cont(char *keyword);
2N/Aextern char **pkgalias(char *pkg);
2N/Aextern char *get_prog_name(void);
2N/Aextern char *set_prog_name(char *name);
2N/Aextern int averify(int fix, char *ftype, char *path, struct ainfo *ainfo);
2N/Aextern int ckparam(char *param, char *value);
2N/Aextern int ckvolseq(char *dir, int part, int nparts);
2N/Aextern int cverify(int fix, char *ftype, char *path, struct cinfo *cinfo,
2N/A int allow_checksum);
2N/Aextern unsigned long compute_checksum(int *r_cksumerr, char *a_path);
2N/Aextern int fverify(int fix, char *ftype, char *path, struct ainfo *ainfo,
2N/A struct cinfo *cinfo);
2N/Aextern char *getErrbufAddr(void);
2N/Aextern int getErrbufSize(void);
2N/Aextern char *getErrstr(void);
2N/Aextern void setErrstr(char *errstr);
2N/Aextern int devtype(char *alias, struct pkgdev *devp);
2N/Aextern int ds_totread; /* total number of parts read */
2N/Aextern int ds_close(int pkgendflg);
2N/Aextern int ds_findpkg(char *device, char *pkg);
2N/Aextern int ds_getinfo(char *string);
2N/Aextern int ds_getpkg(char *device, int n, char *dstdir);
2N/Aextern int ds_ginit(char *device);
2N/Aextern boolean_t ds_fd_open(void);
2N/Aextern int ds_init(char *device, char **pkg, char *norewind);
2N/Aextern void ds_inc_totread(int parts);
2N/Aextern int BIO_ds_dump_header(PKG_ERR *, BIO *);
2N/Aextern int BIO_ds_dump(PKG_ERR *, char *, BIO *);
2N/Aextern int BIO_dump_cmd(char *cmd, BIO *bio);
2N/Aextern int ds_next(char *, char *);
2N/Aextern int ds_readbuf(char *device);
2N/Aextern int epclose(FILE *pp);
2N/Aextern int esystem(char *cmd, int ifd, int ofd);
2N/Aextern int e_ExecCmdArray(int *r_status, char **r_results,
2N/A char *a_inputFile, char *a_cmd, char **a_args);
2N/Aextern int e_ExecCmdList(int *r_status, char **r_results,
2N/A char *a_inputFile, char *a_cmd, ...);
2N/Aextern int gpkgmap(struct cfent *ept, FILE *fp);
2N/Aextern int gpkgmapvfp(struct cfent *ept, VFP_T *fpv);
2N/Aextern void setmapmode(int mode_no);
2N/Aextern int isFdRemote(int a_fd);
2N/Aextern int isFstypeRemote(char *a_fstype);
2N/Aextern int isPathRemote(char *a_path);
2N/Aextern int iscpio(char *path, int *iscomp);
2N/Aextern int isdir(char *path);
2N/Aextern int isfile(char *dir, char *file);
2N/Aextern int fmkdir(char *a_path, int a_mode);
2N/Aextern int pkgexecl(char *filein, char *fileout, char *uname, char *gname,
2N/A ...);
2N/Aextern int pkgexecv(char *filein, char *fileout, char *uname, char *gname,
2N/A char *arg[]);
2N/Aextern int pkghead(char *device);
2N/Aextern int pkgmount(struct pkgdev *devp, char *pkg, int part, int nparts,
2N/A int getvolflg);
2N/Aextern int pkgtrans(char *device1, char *device2, char **pkg,
2N/A int options, keystore_handle_t, char *);
2N/Aextern int pkgumount(struct pkgdev *devp);
2N/Aextern int ppkgmap(struct cfent *ept, FILE *fp);
2N/Aextern int putcfile(struct cfent *ept, FILE *fp);
2N/Aextern int putcvfpfile(struct cfent *ept, VFP_T *vfp);
2N/Aextern int rrmdir(char *path);
2N/Aextern void set_memalloc_failure_func(void (*)(int));
2N/Aextern void *xmalloc(size_t size);
2N/Aextern void *xrealloc(void *ptr, size_t size);
2N/Aextern char *xstrdup(char *str);
2N/Aextern void set_passphrase_prompt(char *);
2N/Aextern void set_passphrase_passarg(char *);
2N/Aextern int pkg_passphrase_cb(char *, int, int, void *);
2N/A
2N/Aextern int srchcfile(struct cfent *ept, char *path, PKGserver server);
2N/Aextern struct group *cgrgid(gid_t gid);
2N/Aextern struct group *cgrnam(char *nam);
2N/Aextern struct passwd *cpwnam(char *nam);
2N/Aextern struct passwd *cpwuid(uid_t uid);
2N/Aextern struct group *clgrgid(gid_t gid);
2N/Aextern struct group *clgrnam(char *nam);
2N/Aextern struct passwd *clpwnam(char *nam);
2N/Aextern struct passwd *clpwuid(uid_t uid);
2N/Aextern void basepath(char *path, char *basedir, char *ir);
2N/Aextern void canonize(char *file);
2N/Aextern void canonize_slashes(char *file);
2N/Aextern void checksum_off(void);
2N/Aextern void checksum_on(void);
2N/Aextern void cvtpath(char *path, char *copy);
2N/Aextern void ds_order(char *list[]);
2N/Aextern void ds_putinfo(char *buf);
2N/Aextern void ds_skiptoend(char *device);
2N/Aextern void ecleanup(void);
2N/A/*PRINTFLIKE1*/
2N/Aextern void logerr(char *fmt, ...);
2N/Aextern int mappath(int flag, char *path);
2N/Aextern int mapvar(int flag, char *varname);
2N/A/*PRINTFLIKE1*/
2N/Aextern void progerr(char *fmt, ...);
2N/Aextern void pkgerr(PKG_ERR *);
2N/Aextern void rpterr(void);
2N/Aextern void tputcfent(struct cfent *ept, FILE *fp);
2N/Aextern void set_nonABI_symlinks(void);
2N/Aextern int nonABI_symlinks(void);
2N/Aextern void disable_attribute_check(void);
2N/Aextern int get_disable_attribute_check(void);
2N/A
2N/A/* security.c */
2N/Aextern void sec_init(void);
2N/Aextern char *get_subject_display_name(X509 *);
2N/Aextern char *get_issuer_display_name(X509 *);
2N/Aextern char *get_serial_num(X509 *);
2N/Aextern char *get_fingerprint(X509 *, const EVP_MD *);
2N/Aextern int get_cert_chain(PKG_ERR *, X509 *, STACK_OF(X509) *,
2N/A STACK_OF(X509) *, STACK_OF(X509) **);
2N/A
2N/A/* pkgstr.c */
2N/Avoid pkgstrConvertUllToTimeString_r(unsigned long long a_time,
2N/A char *a_buf, int a_bufLen);
2N/Achar *pkgstrConvertPathToBasename(char *a_path);
2N/Achar *pkgstrConvertPathToDirname(char *a_path);
2N/Achar *pkgstrDup(char *a_str);
2N/Achar *pkgstrLocatePathBasename(char *a_path);
2N/Avoid pkgstrScaleNumericString(char *a_buf, unsigned long long scale);
2N/Avoid pkgstrAddToken(char **a_old, char *a_new, char a_separator);
2N/Aboolean_t pkgstrContainsToken(char *a_string, char *a_token,
2N/A char *a_separators);
2N/Avoid pkgstrExpandTokens(char **a_old, char *a_string,
2N/A char a_separator, char *a_separators);
2N/Achar *pkgstrGetToken(char *r_sep, char *a_string, int a_index,
2N/A char *a_separators);
2N/Avoid pkgstrGetToken_r(char *r_sep, char *a_string, int a_index,
2N/A char *a_separators, char *a_buf, int a_bufLen);
2N/Aunsigned long pkgstrNumTokens(char *a_string, char *a_separators);
2N/Achar *pkgstrPrintf(char *a_format, ...);
2N/Avoid pkgstrPrintf_r(char *a_buf, int a_bufLen, char *a_format, ...);
2N/Avoid pkgstrRemoveToken(char **r_string, char *a_token,
2N/A char *a_separators, int a_index);
2N/Avoid pkgstrRemoveLeadingWhitespace(char **a_str);
2N/A/* vfpops.c */
2N/Aextern int vfpCheckpointFile(VFP_T **r_destVfp, VFP_T **a_vfp,
2N/A char *a_path);
2N/Aextern int vfpCheckpointOpen(VFP_T **a_cvfp, VFP_T **r_vfp, char *a_path,
2N/A char *a_mode, VFPFLAGS_T a_flags);
2N/Aextern int vfpClearModified(VFP_T *a_vfp);
2N/Aextern int vfpClose(VFP_T **r_vfp);
2N/Aextern int vfpGetModified(VFP_T *a_vfp);
2N/Aextern int vfpOpen(VFP_T **r_vfp, char *a_path, char *a_mode,
2N/A VFPFLAGS_T a_flags);
2N/Aextern void vfpRewind(VFP_T *a_vfp);
2N/Aextern ssize_t vfpSafePwrite(int a_fildes, void *a_buf,
2N/A size_t a_nbyte, off_t a_offset);
2N/Aextern ssize_t vfpSafeWrite(int a_fildes, void *a_buf, size_t a_nbyte);
2N/Aextern int vfpSetFlags(VFP_T *a_vfp, VFPFLAGS_T a_flags);
2N/Aextern int vfpSetModified(VFP_T *a_vfp);
2N/Aextern int vfpSetSize(VFP_T *a_vfp, size_t a_size);
2N/Aextern void vfpTruncate(VFP_T *a_vfp);
2N/Aextern int vfpWriteToFile(VFP_T *a_vfp, char *a_path);
2N/A
2N/A/* handlelocalfs.c */
2N/Aboolean_t enable_local_fs(void);
2N/Aboolean_t restore_local_fs(void);
2N/A
2N/A/* pkgserv.c */
2N/Aextern PKGserver pkgopenserver(const char *, const char *, boolean_t);
2N/Aextern void pkgcloseserver(PKGserver);
2N/Aextern int pkgcmd(PKGserver, void *, size_t, char **, size_t *,
2N/A int *);
2N/Aextern boolean_t pkgsync_needed(const char *, const char *, boolean_t);
2N/Aextern int pkgsync(const char *, const char *, boolean_t);
2N/Aextern int pkgservercommitfile(VFP_T *, PKGserver);
2N/Aextern int pkgopenfilter(PKGserver server, const char *pkginst);
2N/Aextern void pkgclosefilter(PKGserver);
2N/Aextern char *pkggetentry(PKGserver, int *, int *);
2N/Aextern char *pkggetentry_named(PKGserver, const char *, int *,
2N/A int *);
2N/Aextern void pkgserversetmode(start_mode_t);
2N/Aextern start_mode_t pkgservergetmode(void);
2N/Aextern start_mode_t pkgparsemode(const char *);
2N/Aextern char *pkgmodeargument(start_mode_t);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _PKGLIB_H */