- python: exceptions on NOKEY/NOTTRUSTED.
CVS patchset: 5667
CVS date: 2002/08/23 21:01:59
- fix: region trailer offset sanity check wrong (#71996).
- fix: don't stop if db1 database is currently in /var/lib/rpm (#72224).
- add a macro to create a sub-package with debugging symbols.
+ - merge signature returns into rpmRC.
+ - python: exceptions on NOKEY/NOTTRUSTED.
4.0.3 -> 4.0.4:
- solaris: translate i86pc to i386 (#57182).
}
switch (rc) {
+ case RPMRC_OK:
+ case RPMRC_NOKEY:
+ case RPMRC_NOTTRUSTED:
+ break;
case RPMRC_NOTFOUND:
rpmError(RPMERR_BADMAGIC, _("readRPM: %s is not an RPM package\n"),
(fileName ? fileName : "<stdin>"));
return RPMERR_BADMAGIC;
- case RPMRC_OK:
- break;
case RPMRC_FAIL:
- case RPMRC_BADSIZE:
- case RPMRC_SHORTREAD:
default:
rpmError(RPMERR_BADMAGIC, _("readRPM: reading header from %s\n"),
(fileName ? fileName : "<stdin>"));
strncpy(lead.name, buf, sizeof(lead.name));
}
- if (writeLead(fd, &lead)) {
+ if (writeLead(fd, &lead) != RPMRC_OK) {
rc = RPMERR_NOSPACE;
rpmError(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
Fstrerror(fd));
/*@-boundswrite@*/
buf[0] = '\0';
/*@=boundswrite@*/
- switch (rpmVerifySignature(ts, buf)) {
- case RPMSIG_OK: /* Signature is OK. */
- rc = RPMRC_OK;
- break;
- case RPMSIG_NOTTRUSTED: /* Signature is OK, but key is not trusted. */
- case RPMSIG_NOKEY: /* Key is unavailable. */
- rc = RPMRC_OK;
- break;
- case RPMSIG_UNKNOWN: /* Signature is unknown type. */
- rc = RPMRC_OK;
- break;
- default:
- case RPMSIG_BAD: /* Signature does not verify. */
- rc = RPMRC_FAIL;
- break;
- }
+ rc = rpmVerifySignature(ts, buf);
/*@-boundswrite@*/
if (msg != NULL)
}
memset(l, 0, sizeof(*l));
- if (readLead(fd, l)) {
+ rc = readLead(fd, l);
+ if (rc != RPMRC_OK) {
rc = RPMRC_NOTFOUND;
goto exit;
}
/* Read the signature header. */
rc = rpmReadSignature(fd, &sigh, l->signature_type);
- if (!(rc == RPMRC_OK || rc == RPMRC_BADSIZE)) {
+ switch (rc) {
+ default:
rpmError(RPMERR_SIGGEN, _("%s: rpmReadSignature failed\n"), fn);
goto exit;
- }
- if (sigh == NULL) {
- rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
- rc = RPMRC_FAIL;
- goto exit;
+ /*@notreached@*/ break;
+ case RPMRC_OK:
+ if (sigh == NULL) {
+ rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
+ rc = RPMRC_FAIL;
+ goto exit;
+ }
+ break;
}
#define _chk(_mask) (sigtag == 0 && !(vsflags & (_mask)))
/*@-boundswrite@*/
buf[0] = '\0';
/*@=boundswrite@*/
- switch (rpmVerifySignature(ts, buf)) {
- case RPMSIG_OK: /* Signature is OK. */
+ rc = rpmVerifySignature(ts, buf);
+ switch (rc) {
+ case RPMRC_OK: /* Signature is OK. */
rpmMessage(RPMMESS_DEBUG, "%s: %s", fn, buf);
- rc = RPMRC_OK;
break;
- case RPMSIG_NOTTRUSTED: /* Signature is OK, but key is not trusted. */
- case RPMSIG_NOKEY: /* Key is unavailable. */
+ case RPMRC_NOTTRUSTED: /* Signature is OK, but key is not trusted. */
+ case RPMRC_NOKEY: /* Public key is unavailable. */
/* XXX Print NOKEY/NOTTRUSTED warning only once. */
{ int lvl = (rpmtsStashKeyid(ts) ? RPMMESS_DEBUG : RPMMESS_WARNING);
rpmMessage(lvl, "%s: %s", fn, buf);
rc = RPMRC_OK;
} break;
- case RPMSIG_UNKNOWN: /* Signature is unknown type. */
+ case RPMRC_NOTFOUND: /* Signature is unknown type. */
rpmMessage(RPMMESS_WARNING, "%s: %s", fn, buf);
rc = RPMRC_OK;
break;
default:
- case RPMSIG_BAD: /* Signature does not verify. */
+ case RPMRC_FAIL: /* Signature does not verify. */
rpmMessage(RPMMESS_ERROR, "%s: %s", fn, buf);
rc = RPMRC_FAIL;
break;
* @param fi transaction element file info
* @param h header from
* @param newH header to
- * @return 0 on success, 1 on failure
+ * @return 0 on success
*/
/*@-boundswrite@*/
-static int mergeFiles(rpmfi fi, Header h, Header newH)
+static rpmRC mergeFiles(rpmfi fi, Header h, Header newH)
/*@modifies h @*/
{
HGE_t hge = (HGE_t)fi->hge;
default:
rpmError(RPMERR_DATATYPE, _("Data type %d not supported\n"),
(int) type);
- return 1;
+ return RPMRC_FAIL;
/*@notreached@*/ /*@switchbreak@*/ break;
}
data = hfd(data, type);
newEVR = hfd(newEVR, nvt);
Names = hfd(Names, rnt);
}
- return 0;
+ return RPMRC_OK;
}
/*@=boundswrite@*/
* @return 0 always
*/
/*@-bounds@*/
-static int markReplacedFiles(const rpmpsm psm)
+static rpmRC markReplacedFiles(const rpmpsm psm)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/
{
int num, xx;
if (!(rpmfiFC(fi) > 0 && fi->replaced))
- return 0;
+ return RPMRC_OK;
num = prev = 0;
for (sfi = replaced; sfi->otherPkg; sfi++) {
num++;
}
if (num == 0)
- return 0;
+ return RPMRC_OK;
offsets = alloca(num * sizeof(*offsets));
offsets[0] = 0;
}
mi = rpmdbFreeIterator(mi);
- return 0;
+ return RPMRC_OK;
}
/*@=bounds@*/
int i;
rc = rpmReadPackageFile(ts, fd, "InstallSourcePackage", &h);
- if (!(rc == RPMRC_OK || rc == RPMRC_BADSIZE) || h == NULL) {
+ switch (rc) {
+ case RPMRC_NOTTRUSTED:
+ case RPMRC_NOKEY:
+ case RPMRC_OK:
+ break;
+ default:
goto exit;
+ /*@notreached@*/ break;
}
- rc = RPMRC_OK; /* XXX HACK */
+ if (h == NULL)
+ goto exit;
+
+ rc = RPMRC_OK;
+
isSource = headerIsEntry(h, RPMTAG_SOURCEPACKAGE);
if (!isSource) {
* @param arg1 no. instances of package installed after scriptlet exec
* (-1 is no arg)
* @param arg2 ditto, but for the target package
- * @return 0 on success, 1 on error
+ * @return 0 on success
*/
-static int runScript(rpmpsm psm, Header h,
+static rpmRC runScript(rpmpsm psm, Header h,
const char * sln,
int progArgc, const char ** progArgv,
const char * script, int arg1, int arg2)
const char *n, *v, *r;
if (progArgv == NULL && script == NULL)
- return 0;
+ return rc;
psm->child = 0;
psm->reaped = 0;
/*@-branchstate@*/
if (makeTempFile((!rpmtsChrootDone(ts) ? rootDir : "/"), &fn, &fd)) {
if (freePrefixes) free(prefixes);
- return 1;
+ return RPMRC_FAIL;
}
/*@=branchstate@*/
} else {
out = fdDup(STDOUT_FILENO);
}
- if (out == NULL) return 1; /* XXX can't happen */
+ if (out == NULL) return RPMRC_FAIL; /* XXX can't happen */
/*@-branchstate@*/
if (!psmFork(psm)) {
* @param triggersAlreadyRun
* @return
*/
-static int handleOneTrigger(const rpmpsm psm, Header sourceH, Header triggeredH,
+static rpmRC handleOneTrigger(const rpmpsm psm,
+ Header sourceH, Header triggeredH,
int arg2, unsigned char * triggersAlreadyRun)
/*@globals rpmGlobalMacroContext, fileSystem, internalState@*/
/*@modifies psm, sourceH, triggeredH, *triggersAlreadyRun,
/**
* Run trigger scripts in the database that are fired by this header.
* @param psm package state machine data
- * @return 0 on success, 1 on error
+ * @return 0 on success
*/
-static int runTriggers(rpmpsm psm)
+static rpmRC runTriggers(rpmpsm psm)
/*@globals rpmGlobalMacroContext,
fileSystem, internalState @*/
/*@modifies psm, rpmGlobalMacroContext,
/**
* Run triggers from this header that are fired by headers in the database.
* @param psm package state machine data
- * @return 0 on success, 1 on error
+ * @return 0 on success
*/
-static int runImmedTriggers(rpmpsm psm)
+static rpmRC runImmedTriggers(rpmpsm psm)
/*@globals rpmGlobalMacroContext,
fileSystem, internalState @*/
/*@modifies psm, rpmGlobalMacroContext,
unsigned char * triggersRun;
rpmRC rc = RPMRC_OK;
- if (fi->h == NULL) return 0; /* XXX can't happen */
+ if (fi->h == NULL) return rc; /* XXX can't happen */
if (!( hge(fi->h, RPMTAG_TRIGGERNAME, &tnt,
(void **) &triggerNames, &numTriggers) &&
hge(fi->h, RPMTAG_TRIGGERINDEX, &tit,
(void **) &triggerIndices, &numTriggerIndices))
)
- return 0;
+ return rc;
triggersRun = alloca(sizeof(*triggersRun) * numTriggerIndices);
memset(triggersRun, 0, sizeof(*triggersRun) * numTriggerIndices);
* on install with -v.
*/
/*@-bounds -nullpass@*/ /* FIX: testing null annotation for fi->h */
-int rpmpsmStage(rpmpsm psm, pkgStage stage)
+rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
{
const rpmts ts = psm->ts;
rpmfi fi = psm->fi;
* need the leading / stripped.
*/
{ const char * p;
- rc = hge(fi->h, RPMTAG_DEFAULTPREFIX, NULL, (void **) &p, NULL);
- fi->striplen = (rc ? strlen(p) + 1 : 1);
+ xx = hge(fi->h, RPMTAG_DEFAULTPREFIX, NULL, (void **) &p, NULL);
+ fi->striplen = (xx ? strlen(p) + 1 : 1);
}
fi->mapflags =
CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID;
/* Retrieve installed header. */
rc = rpmpsmStage(psm, PSM_RPMDB_LOAD);
-if (rc == 0)
+if (rc == RPMRC_OK)
if (psm->te)
psm->te->h = headerLink(fi->h);
}
if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPRE)) {
rc = rpmpsmStage(psm, PSM_SCRIPT);
- if (rc) {
+ if (rc != RPMRC_OK) {
rpmError(RPMERR_SCRIPT,
_("%s: %s scriptlet failed (%d), skipping %s\n"),
psm->stepName, tag2sln(psm->scriptTag), rc,
strncpy(lead.name, rpmteNEVR(psm->te), sizeof(lead.name));
rc = writeLead(psm->fd, &lead);
- if (rc) {
+ if (rc != RPMRC_OK) {
rpmError(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
Fstrerror(psm->fd));
- rc = RPMRC_FAIL;
break;
}
}
* @param stage next stage
* @return 0 on success
*/
-int rpmpsmStage(rpmpsm psm, pkgStage stage)
+rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/;
(void) Fclose(fd);
- if (!(rpmrc == RPMRC_OK || rpmrc == RPMRC_NOTFOUND)) {
+ res = 0;
+ switch (rpmrc) {
+ default:
rpmError(RPMERR_QUERY, _("query of %s failed\n"), fileURL);
res = 1;
- /*@loopbreak@*/ break;
- }
- if (rpmrc == RPMRC_OK && h == NULL) {
- rpmError(RPMERR_QUERY,
+ /*@switchbreak@*/ break;
+ case RPMRC_OK:
+ if (h == NULL) {
+ rpmError(RPMERR_QUERY,
_("old format source packages cannot be queried\n"));
- res = 1;
- /*@loopbreak@*/ break;
- }
+ res = 1;
+ /*@switchbreak@*/ break;
+ }
- /* Query a package file. */
- if (rpmrc == RPMRC_OK) {
+ /* Query a package file. */
res = qva->qva_showPackage(qva, ts, h);
h = headerFree(h);
rpmtsEmpty(ts);
continue;
+ /*@notreached@*/ /*@switchbreak@*/ break;
+ case RPMRC_NOTFOUND:
+ res = 0;
+ /*@switchbreak@*/ break;
}
+ if (res)
+ /*@loopbreak@*/ break;
/* Try to read a package manifest. */
fd = Fopen(fileURL, "r.fpio");
/*@-boundswrite@*/
memset(l, 0, sizeof(*l));
/*@=boundswrite@*/
- if (readLead(fd, l)) {
+ rc = readLead(fd, l);
+ if (rc != RPMRC_OK) {
rpmError(RPMERR_READLEAD, _("%s: not an rpm package\n"), rpm);
goto exit;
}
}
rc = rpmReadSignature(fd, &sigh, l->signature_type);
- if (!(rc == RPMRC_OK || rc == RPMRC_BADSIZE)) {
+ switch (rc) {
+ default:
rpmError(RPMERR_SIGGEN, _("%s: rpmReadSignature failed\n"), rpm);
goto exit;
- }
- if (sigh == NULL) {
- rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), rpm);
- goto exit;
+ /*@notreached@*/ /*@switchbreak@*/ break;
+ case RPMRC_OK:
+ if (sigh == NULL) {
+ rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), rpm);
+ goto exit;
+ }
+ /*@switchbreak@*/ break;
}
/* Write the header and archive to a temp file */
goto exit;
l->signature_type = RPMSIGTYPE_HEADERSIG;
- if (writeLead(ofd, l)) {
+ rc = writeLead(ofd, l);
+ if (rc != RPMRC_OK) {
rpmError(RPMERR_WRITELEAD, _("%s: writeLead failed: %s\n"), trpm,
Fstrerror(ofd));
goto exit;
/*@-boundswrite@*/
memset(l, 0, sizeof(*l));
/*@=boundswrite@*/
- if (readLead(fd, l)) {
+ rc = readLead(fd, l);
+ if (rc != RPMRC_OK) {
rpmError(RPMERR_READLEAD, _("%s: not an rpm package\n"), fn);
res++;
goto exit;
}
rc = rpmReadSignature(fd, &sigh, l->signature_type);
- if (!(rc == RPMRC_OK || rc == RPMRC_BADSIZE)) {
+ switch (rc) {
+ default:
rpmError(RPMERR_SIGGEN, _("%s: rpmReadSignature failed\n"), fn);
res++;
goto exit;
- }
- if (sigh == NULL) {
- rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
- res++;
- goto exit;
+ /*@notreached@*/ /*@switchbreak@*/ break;
+ case RPMRC_OK:
+ if (sigh == NULL) {
+ rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
+ res++;
+ goto exit;
+ }
+ /*@switchbreak@*/ break;
}
/* Grab a hint of what needs doing to avoid duplication. */
case RPMSIGTAG_PGP5: /* XXX legacy */
case RPMSIGTAG_PGP:
switch (res3) {
- case RPMSIG_NOKEY:
+ case RPMRC_NOKEY:
res2 = 1;
/*@fallthrough@*/
- case RPMSIG_NOTTRUSTED:
+ case RPMRC_NOTTRUSTED:
{ int offset = 6;
b = stpcpy(b, "(MD5) (PGP) ");
tempKey = strstr(result, "ey ID");
offset = 9;
}
if (tempKey) {
- if (res3 == RPMSIG_NOKEY) {
+ if (res3 == RPMRC_NOKEY) {
m = stpcpy(m, " PGP#");
m = stpncpy(m, tempKey + offset, 8);
*m = '\0';
case RPMSIGTAG_GPG:
/* Do not consider this a failure */
switch (res3) {
- case RPMSIG_NOKEY:
+ case RPMRC_NOKEY:
b = stpcpy(b, "(GPG) ");
m = stpcpy(m, " GPG#");
tempKey = strstr(result, "ey ID");
tvsflags = rpmtsSetVSFlags(ts, vsflags);
eiu->rpmrc = rpmReadPackageFile(ts, eiu->fd, *eiu->fnp, &eiu->h);
tvsflags = rpmtsSetVSFlags(ts, tvsflags);
-
- eiu->isSource = headerIsEntry(eiu->h, RPMTAG_SOURCEPACKAGE);
-
xx = Fclose(eiu->fd);
eiu->fd = NULL;
- if (eiu->rpmrc == RPMRC_FAIL || eiu->rpmrc == RPMRC_SHORTREAD) {
+ switch (eiu->rpmrc) {
+ case RPMRC_FAIL:
+ rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), *eiu->fnp);
eiu->numFailed++; *eiu->fnp = NULL;
continue;
+ /*@notreached@*/ /*@switchbreak@*/ break;
+ case RPMRC_NOTFOUND:
+ goto maybe_manifest;
+ /*@notreached@*/ /*@switchbreak@*/ break;
+ case RPMRC_OK:
+ default:
+ /*@switchbreak@*/ break;
}
- if (eiu->isSource &&
- (eiu->rpmrc == RPMRC_OK || eiu->rpmrc == RPMRC_BADSIZE))
- {
+ eiu->isSource = headerIsEntry(eiu->h, RPMTAG_SOURCEPACKAGE);
+
+ if (eiu->isSource) {
rpmMessage(RPMMESS_DEBUG, "\tadded source package [%d]\n",
eiu->numSRPMS);
eiu->sourceURL = xrealloc(eiu->sourceURL,
continue;
}
- if (eiu->rpmrc == RPMRC_OK || eiu->rpmrc == RPMRC_BADSIZE) {
-
- if (eiu->relocations) {
- const char ** paths;
- int pft;
- int c;
+ if (eiu->relocations) {
+ const char ** paths;
+ int pft;
+ int c;
- if (headerGetEntry(eiu->h, RPMTAG_PREFIXES, &pft,
+ if (headerGetEntry(eiu->h, RPMTAG_PREFIXES, &pft,
(void **) &paths, &c) && (c == 1))
- {
- eiu->relocations->oldPath = xstrdup(paths[0]);
- paths = headerFreeData(paths, pft);
- } else {
- const char * name;
- xx = headerNVR(eiu->h, &name, NULL, NULL);
- rpmMessage(RPMMESS_ERROR,
+ {
+ eiu->relocations->oldPath = xstrdup(paths[0]);
+ paths = headerFreeData(paths, pft);
+ } else {
+ const char * name;
+ xx = headerNVR(eiu->h, &name, NULL, NULL);
+ rpmMessage(RPMMESS_ERROR,
_("package %s is not relocateable\n"), name);
- eiu->numFailed++;
- goto exit;
- /*@notreached@*/
- }
+ eiu->numFailed++;
+ goto exit;
+ /*@notreached@*/
}
+ }
- /* On --freshen, verify package is installed and newer */
- if (ia->installInterfaceFlags & INSTALL_FRESHEN) {
- rpmdbMatchIterator mi;
- const char * name;
- Header oldH;
- int count;
-
- xx = headerNVR(eiu->h, &name, NULL, NULL);
- mi = rpmtsInitIterator(ts, RPMTAG_NAME, name, 0);
- count = rpmdbGetIteratorCount(mi);
- while ((oldH = rpmdbNextIterator(mi)) != NULL) {
- if (rpmVersionCompare(oldH, eiu->h) < 0)
- /*@innercontinue@*/ continue;
- /* same or newer package already installed */
- count = 0;
- /*@innerbreak@*/ break;
- }
- mi = rpmdbFreeIterator(mi);
- if (count == 0) {
- eiu->h = headerFree(eiu->h);
- continue;
- }
- /* Package is newer than those currently installed. */
+ /* On --freshen, verify package is installed and newer */
+ if (ia->installInterfaceFlags & INSTALL_FRESHEN) {
+ rpmdbMatchIterator mi;
+ const char * name;
+ Header oldH;
+ int count;
+
+ xx = headerNVR(eiu->h, &name, NULL, NULL);
+ mi = rpmtsInitIterator(ts, RPMTAG_NAME, name, 0);
+ count = rpmdbGetIteratorCount(mi);
+ while ((oldH = rpmdbNextIterator(mi)) != NULL) {
+ if (rpmVersionCompare(oldH, eiu->h) < 0)
+ /*@innercontinue@*/ continue;
+ /* same or newer package already installed */
+ count = 0;
+ /*@innerbreak@*/ break;
+ }
+ mi = rpmdbFreeIterator(mi);
+ if (count == 0) {
+ eiu->h = headerFree(eiu->h);
+ continue;
}
+ /* Package is newer than those currently installed. */
+ }
- /*@-abstract@*/
- rc = rpmtsAddInstallElement(ts, eiu->h, (fnpyKey)fileName,
+ /*@-abstract@*/
+ rc = rpmtsAddInstallElement(ts, eiu->h, (fnpyKey)fileName,
(ia->installInterfaceFlags & INSTALL_UPGRADE) != 0,
relocations);
- /*@=abstract@*/
+ /*@=abstract@*/
- /* XXX reference held by transaction set */
- eiu->h = headerFree(eiu->h);
- if (eiu->relocations)
- eiu->relocations->oldPath = _free(eiu->relocations->oldPath);
+ /* XXX reference held by transaction set */
+ eiu->h = headerFree(eiu->h);
+ if (eiu->relocations)
+ eiu->relocations->oldPath = _free(eiu->relocations->oldPath);
- switch(rc) {
- case 0:
- rpmMessage(RPMMESS_DEBUG, "\tadded binary package [%d]\n",
+ switch(rc) {
+ case 0:
+ rpmMessage(RPMMESS_DEBUG, "\tadded binary package [%d]\n",
eiu->numRPMS);
- /*@switchbreak@*/ break;
- case 1:
- rpmMessage(RPMMESS_ERROR,
+ /*@switchbreak@*/ break;
+ case 1:
+ rpmMessage(RPMMESS_ERROR,
_("error reading from file %s\n"), *eiu->fnp);
- eiu->numFailed++;
- goto exit;
- /*@notreached@*/ /*@switchbreak@*/ break;
- case 2:
- rpmMessage(RPMMESS_ERROR,
+ eiu->numFailed++;
+ goto exit;
+ /*@notreached@*/ /*@switchbreak@*/ break;
+ case 2:
+ rpmMessage(RPMMESS_ERROR,
_("file %s requires a newer version of RPM\n"),
*eiu->fnp);
- eiu->numFailed++;
- goto exit;
- /*@notreached@*/ /*@switchbreak@*/ break;
- }
-
- eiu->numRPMS++;
- continue;
+ eiu->numFailed++;
+ goto exit;
+ /*@notreached@*/ /*@switchbreak@*/ break;
}
- if (eiu->rpmrc != RPMRC_NOTFOUND) {
- rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), *eiu->fnp);
- eiu->numFailed++; *eiu->fnp = NULL;
- break;
- }
+ eiu->numRPMS++;
+ continue;
+maybe_manifest:
/* Try to read a package manifest. */
eiu->fd = Fopen(*eiu->fnp, "r.fpio");
if (eiu->fd == NULL || Ferror(eiu->fd)) {
eiu->fd = NULL;
/* If successful, restart the query loop. */
- if (rc == 0) {
+ if (rc == RPMRC_OK) {
eiu->prevx++;
goto restart;
}
FD_t fd;
const char ** av = NULL;
int ac = 0;
- int rc;
+ rpmRC rpmrc;
int xx;
int i;
av = NULL; ac = 0;
- rc = rpmGlob(globstr, &ac, &av);
+ xx = rpmGlob(globstr, &ac, &av);
- if (rc == 0)
+ if (xx == 0)
for (i = 0; i < ac; i++) {
rpmTagType type;
int_32 count;
int isSource;
- rpmRC rpmrc;
fd = Fopen(av[i], "r.ufdio");
if (fd == NULL || Ferror(fd)) {
continue;
}
- xx = rpmReadPackageFile(ts, fd, av[i], &h);
- rpmrc = (xx ? RPMRC_FAIL : RPMRC_OK); /* XXX HACK */
- isSource = headerIsEntry(h, RPMTAG_SOURCEPACKAGE);
-
- if (rpmrc != RPMRC_OK || isSource) {
- (void) Fclose(fd);
- continue;
+ rpmrc = rpmReadPackageFile(ts, fd, av[i], &h);
+ (void) Fclose(fd);
+ switch (rpmrc) {
+ default:
+ goto bottom;
+ /*@notreached@*/ /*@switchbreak@*/ break;
+ case RPMRC_OK:
+ isSource = headerIsEntry(h, RPMTAG_SOURCEPACKAGE);
+ if (isSource)
+ goto bottom;
+ /*@switchbreak@*/ break;
}
tidp = NULL;
if (hge(h, tag, &type, (void **) &tidp, &count) && tidp) {
idtx = IDTXgrow(idtx, 1);
- if (idtx == NULL || idtx->idt == NULL) {
- h = headerFree(h);
- (void) Fclose(fd);
- continue;
- }
+ if (idtx == NULL || idtx->idt == NULL)
+ goto bottom;
+
{ IDT idt;
idt = idtx->idt + idtx->nidt;
idt->h = headerLink(h);
idtx->nidt++;
}
/*@=branchstate@*/
-
+bottom:
h = headerFree(h);
- (void) Fclose(fd);
}
for (i = 0; i < ac; i++)
/* The lead needs to be 8 byte aligned */
-int writeLead(FD_t fd, const struct rpmlead *lead)
+rpmRC writeLead(FD_t fd, const struct rpmlead *lead)
{
struct rpmlead l;
/*@-boundswrite@*/
if (Fwrite(&l, 1, sizeof(l), fd) != sizeof(l))
- return 1;
+ return RPMRC_FAIL;
/*@=boundswrite@*/
- return 0;
+ return RPMRC_OK;
}
-int readLead(FD_t fd, struct rpmlead *lead)
+rpmRC readLead(FD_t fd, struct rpmlead *lead)
{
/*@-boundswrite@*/
memset(lead, 0, sizeof(*lead));
if (timedRead(fd, (char *)lead, sizeof(*lead)) != sizeof(*lead)) {
rpmError(RPMERR_READ, _("read failed: %s (%d)\n"), Fstrerror(fd),
errno);
- return 1;
+ return RPMRC_FAIL;
}
/*@=type@*/
if (memcmp(lead->magic, lead_magic, sizeof(lead_magic)))
- return 1;
+ return RPMRC_FAIL;
lead->type = ntohs(lead->type);
lead->archnum = ntohs(lead->archnum);
if (lead->major >= 2)
lead->signature_type = ntohs(lead->signature_type);
- return 0;
+ return RPMRC_OK;
}
* Write lead to file handle.
* @param fd file handle
* @param lead data address
- * @return 0 on success, 1 on error
+ * @return 0 on success
*/
-int writeLead(FD_t fd, const struct rpmlead *lead)
+rpmRC writeLead(FD_t fd, const struct rpmlead *lead)
/*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/;
* Read lead from file handle.
* @param fd file handle
* @retval lead data address
- * @return 0 on success, 1 on error
+ * @return 0 on success
*/
-int readLead(FD_t fd, /*@out@*/ struct rpmlead *lead)
+rpmRC readLead(FD_t fd, /*@out@*/ struct rpmlead *lead)
/*@modifies fd, *lead @*/;
#ifdef __cplusplus
RPMRC_OK = 0, /*!< Generic success code */
RPMRC_NOTFOUND = 1, /*!< Generic not found code. */
RPMRC_FAIL = 2, /*!< Generic failure code. */
- RPMRC_BADSIZE = 3,
- RPMRC_SHORTREAD = 4
+ RPMRC_NOTTRUSTED = 3, /*!< Signature is OK, but key is not trusted. */
+ RPMRC_NOKEY = 4 /*!< Public key is unavailable. */
} rpmRC;
/*@-redecl@*/
RPMSIGTAG_RSA = RPMTAG_RSAHEADER /*!< internal RSA header signature. */
};
-/**
- * Return codes from verifySignature().
- */
-typedef enum rpmVerifySignatureReturn_e {
- RPMSIG_OK = 0, /*!< Signature is OK. */
- RPMSIG_UNKNOWN = 1, /*!< Signature is unknown. */
- RPMSIG_BAD = 2, /*!< Signature does not verify. */
- RPMSIG_NOKEY = 3, /*!< Key is unavailable. */
- RPMSIG_NOTTRUSTED = 4 /*!< Signature is OK, but key is not trusted. */
-} rpmVerifySignatureReturn;
-
/** \ingroup signature
* Verify a signature from a package.
*
* @retval result detailed text result of signature verification
* @return result of signature verification
*/
-rpmVerifySignatureReturn rpmVerifySignature(const rpmts ts,
+rpmRC rpmVerifySignature(const rpmts ts,
/*@out@*/ char * result)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies ts, *result, rpmGlobalMacroContext,
return mi;
}
-rpmVerifySignatureReturn rpmtsFindPubkey(rpmts ts)
+rpmRC rpmtsFindPubkey(rpmts ts)
{
const void * sig = rpmtsSig(ts);
pgpDig dig = rpmtsDig(ts);
pgpDigParams sigp = rpmtsSignature(ts);
pgpDigParams pubp = rpmtsSignature(ts);
- rpmVerifySignatureReturn res;
+ rpmRC res;
int xx;
if (sig == NULL || dig == NULL || sigp == NULL || pubp == NULL) {
- res = RPMSIG_NOKEY; /* XXX RPMSIG_ARGS */
+ res = RPMRC_NOKEY;
goto exit;
}
/* Was a matching pubkey found? */
if (ix < 0 || ts->pkpkt == NULL) {
- res = RPMSIG_NOKEY;
+ res = RPMRC_NOKEY;
goto exit;
}
{
ts->pkpkt = _free(ts->pkpkt);
ts->pkpktlen = 0;
- res = RPMSIG_NOKEY;
+ res = RPMRC_NOKEY;
goto exit;
}
const char * pkfn = rpmExpand("%{_gpg_pubkey}", NULL);
if (pgpReadPkts(pkfn, &ts->pkpkt, &ts->pkpktlen) != PGPARMOR_PUBKEY) {
pkfn = _free(pkfn);
- res = RPMSIG_NOKEY;
+ res = RPMRC_NOKEY;
goto exit;
}
pkfn = _free(pkfn);
&& sigp->hash_algo == pubp->hash_algo
#endif
&& !memcmp(sigp->signid, pubp->signid, sizeof(sigp->signid)) )
- res = RPMSIG_OK;
+ res = RPMRC_OK;
else
- res = RPMSIG_NOKEY;
+ res = RPMRC_NOKEY;
/* XXX Verify the signature signature. */
}
rpmrc = rpmReadPackageFile(ts, fd, str, &h);
xx = Fclose(fd);
- if (rpmrc == RPMRC_OK || rpmrc == RPMRC_BADSIZE) {
+ switch (rpmrc) {
+ default:
+ str = _free(str);
+ break;
+ case RPMRC_OK:
if (h != NULL &&
!rpmtsAddInstallElement(ts, h, (fnpyKey)str, 1, NULL))
{
rpmMessage(RPMMESS_DEBUG, _("Adding: %s\n"), str);
rc = -1;
/* XXX str memory leak */
- } else
- str = _free(str);
- } else
+ break;
+ }
str = _free(str);
+ break;
+ }
h = headerFree(h);
goto exit;
}
/**
* Retrieve pubkey from rpm database.
* @param ts rpm transaction
- * @return RPMSIG_OK on success, RPMSIG_NOKEY if not found
+ * @return RPMRC_OK on success, RPMRC_NOKEY if not found
*/
-rpmVerifySignatureReturn rpmtsFindPubkey(rpmts ts)
+rpmRC rpmtsFindPubkey(rpmts ts)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState */;
rc = RPMRC_OK;
break;
default:
- rc = RPMRC_BADSIZE;
+ rc = RPMRC_OK; /* XXX repackaging destroys size checks */
break;
}
/*@=boundsread@*/
}
if (pad && timedRead(fd, buf, pad) != pad)
- rc = RPMRC_SHORTREAD;
+ rc = RPMRC_FAIL;
break;
default:
break;
return pass;
}
-static /*@observer@*/ const char * rpmSigString(rpmVerifySignatureReturn res)
+static /*@observer@*/ const char * rpmSigString(rpmRC res)
/*@*/
{
const char * str;
switch (res) {
- case RPMSIG_OK: str = "OK"; break;
- case RPMSIG_BAD: str = "BAD"; break;
- case RPMSIG_NOKEY: str = "NOKEY"; break;
- case RPMSIG_NOTTRUSTED: str = "NOTRUSTED"; break;
+ case RPMRC_OK: str = "OK"; break;
+ case RPMRC_FAIL: str = "BAD"; break;
+ case RPMRC_NOKEY: str = "NOKEY"; break;
+ case RPMRC_NOTTRUSTED: str = "NOTRUSTED"; break;
default:
- case RPMSIG_UNKNOWN: str = "UNKNOWN"; break;
+ case RPMRC_NOTFOUND: str = "UNKNOWN"; break;
}
return str;
}
/*@-boundswrite@*/
-static rpmVerifySignatureReturn
+static rpmRC
verifySizeSignature(const rpmts ts, /*@out@*/ char * t)
/*@modifies *t @*/
{
const void * sig = rpmtsSig(ts);
pgpDig dig = rpmtsDig(ts);
- rpmVerifySignatureReturn res;
+ rpmRC res;
int_32 size = 0x7fffffff;
*t = '\0';
t = stpcpy(t, _("Header+Payload size: "));
if (sig == NULL || dig == NULL || dig->nbytes == 0) {
- res = RPMSIG_NOKEY; /* XXX RPMSIG_ARGS */
- res = RPMSIG_NOKEY;
+ res = RPMRC_NOKEY;
t = stpcpy(t, rpmSigString(res));
goto exit;
}
memcpy(&size, sig, sizeof(size));
if (size != dig->nbytes) {
- res = RPMSIG_BAD;
+ res = RPMRC_FAIL;
t = stpcpy(t, rpmSigString(res));
sprintf(t, " Expected(%d) != (%d)\n", size, dig->nbytes);
} else {
- res = RPMSIG_OK;
+ res = RPMRC_OK;
t = stpcpy(t, rpmSigString(res));
sprintf(t, " (%d)", dig->nbytes);
}
/*@=boundswrite@*/
/*@-boundswrite@*/
-static rpmVerifySignatureReturn
+static rpmRC
verifyMD5Signature(const rpmts ts, /*@out@*/ char * t,
/*@null@*/ DIGEST_CTX md5ctx)
/*@modifies *t @*/
const void * sig = rpmtsSig(ts);
int_32 siglen = rpmtsSiglen(ts);
pgpDig dig = rpmtsDig(ts);
- rpmVerifySignatureReturn res;
+ rpmRC res;
byte * md5sum = NULL;
size_t md5len = 0;
t = stpcpy(t, _("MD5 digest: "));
if (md5ctx == NULL || sig == NULL || dig == NULL) {
- res = RPMSIG_NOKEY; /* XXX RPMSIG_ARGS */
+ res = RPMRC_NOKEY;
t = stpcpy(t, rpmSigString(res));
goto exit;
}
(void **)&md5sum, &md5len, 0);
if (md5len != siglen || memcmp(md5sum, sig, md5len)) {
- res = RPMSIG_BAD;
+ res = RPMRC_FAIL;
t = stpcpy(t, rpmSigString(res));
t = stpcpy(t, " Expected(");
(void) pgpHexCvt(t, sig, siglen);
t += strlen(t);
t = stpcpy(t, ") != (");
} else {
- res = RPMSIG_OK;
+ res = RPMRC_OK;
t = stpcpy(t, rpmSigString(res));
t = stpcpy(t, " (");
}
* @param ts transaction set
* @retval t verbose success/failure text
* @param sha1ctx
- * @return RPMSIG_OK on success
+ * @return RPMRC_OK on success
*/
-static rpmVerifySignatureReturn
+static rpmRC
verifySHA1Signature(const rpmts ts, /*@out@*/ char * t,
/*@null@*/ DIGEST_CTX sha1ctx)
/*@modifies *t @*/
int_32 siglen = rpmtsSiglen(ts);
#endif
pgpDig dig = rpmtsDig(ts);
- rpmVerifySignatureReturn res;
+ rpmRC res;
const char * SHA1 = NULL;
*t = '\0';
t = stpcpy(t, _("Header SHA1 digest: "));
if (sha1ctx == NULL || sig == NULL || dig == NULL) {
- res = RPMSIG_NOKEY; /* XXX RPMSIG_ARGS */
+ res = RPMRC_NOKEY;
t = stpcpy(t, rpmSigString(res));
goto exit;
}
(void **)&SHA1, NULL, 1);
if (SHA1 == NULL || strlen(SHA1) != strlen(sig) || strcmp(SHA1, sig)) {
- res = RPMSIG_BAD;
+ res = RPMRC_FAIL;
t = stpcpy(t, rpmSigString(res));
t = stpcpy(t, " Expected(");
t = stpcpy(t, sig);
t = stpcpy(t, ") != (");
} else {
- res = RPMSIG_OK;
+ res = RPMRC_OK;
t = stpcpy(t, rpmSigString(res));
t = stpcpy(t, " (");
}
* @param ts transaction set
* @retval t verbose success/failure text
* @param md5ctx
- * @return RPMSIG_OK on success
+ * @return RPMRC_OK on success
*/
-static rpmVerifySignatureReturn
+static rpmRC
verifyPGPSignature(rpmts ts, /*@out@*/ char * t,
/*@null@*/ DIGEST_CTX md5ctx)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
int_32 sigtag = rpmtsSigtag(ts);
pgpDig dig = rpmtsDig(ts);
pgpDigParams sigp = rpmtsSignature(ts);
- rpmVerifySignatureReturn res;
+ rpmRC res;
int xx;
*t = '\0';
t = stpcpy(t, _("V3 RSA/MD5 signature: "));
if (md5ctx == NULL || sig == NULL || dig == NULL || sigp == NULL) {
- res = RPMSIG_NOKEY; /* XXX RPMSIG_ARGS */
+ res = RPMRC_NOKEY;
goto exit;
}
&& sigp->pubkey_algo == PGPPUBKEYALGO_RSA
&& sigp->hash_algo == PGPHASHALGO_MD5))
{
- res = RPMSIG_NOKEY;
+ res = RPMRC_NOKEY;
goto exit;
}
signhash16[0] = (nibble(s[0]) << 4) | nibble(s[1]);
signhash16[1] = (nibble(s[2]) << 4) | nibble(s[3]);
if (memcmp(signhash16, sigp->signhash16, sizeof(signhash16))) {
- res = RPMSIG_BAD;
+ res = RPMRC_FAIL;
goto exit;
}
/* Retrieve the matching public key. */
res = rpmtsFindPubkey(ts);
- if (res != RPMSIG_OK)
+ if (res != RPMRC_OK)
goto exit;
if (rsavrfy(&dig->rsa_pk, &dig->rsahm, &dig->c))
- res = RPMSIG_OK;
+ res = RPMRC_OK;
else
- res = RPMSIG_BAD;
+ res = RPMRC_FAIL;
exit:
t = stpcpy(t, rpmSigString(res));
* @param ts transaction set
* @retval t verbose success/failure text
* @param sha1ctx
- * @return RPMSIG_OK on success
+ * @return RPMRC_OK on success
*/
/*@-boundswrite@*/
-static rpmVerifySignatureReturn
+static rpmRC
verifyGPGSignature(rpmts ts, /*@out@*/ char * t,
/*@null@*/ DIGEST_CTX sha1ctx)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
int_32 sigtag = rpmtsSigtag(ts);
pgpDig dig = rpmtsDig(ts);
pgpDigParams sigp = rpmtsSignature(ts);
- rpmVerifySignatureReturn res;
+ rpmRC res;
int xx;
*t = '\0';
t = stpcpy(t, _("V3 DSA signature: "));
if (sha1ctx == NULL || sig == NULL || dig == NULL || sigp == NULL) {
- res = RPMSIG_NOKEY; /* XXX RPMSIG_ARGS */
+ res = RPMRC_NOKEY;
goto exit;
}
&& sigp->pubkey_algo == PGPPUBKEYALGO_DSA
&& sigp->hash_algo == PGPHASHALGO_SHA1))
{
- res = RPMSIG_NOKEY;
+ res = RPMRC_NOKEY;
goto exit;
}
signhash16[0] = (*dig->hm.data >> 24) & 0xff;
signhash16[1] = (*dig->hm.data >> 16) & 0xff;
if (memcmp(signhash16, sigp->signhash16, sizeof(signhash16))) {
- res = RPMSIG_BAD;
+ res = RPMRC_FAIL;
goto exit;
}
}
/* Retrieve the matching public key. */
res = rpmtsFindPubkey(ts);
- if (res != RPMSIG_OK)
+ if (res != RPMRC_OK)
goto exit;
if (dsavrfy(&dig->p, &dig->q, &dig->g,
&dig->hm, &dig->y, &dig->r, &dig->s))
- res = RPMSIG_OK;
+ res = RPMRC_OK;
else
- res = RPMSIG_BAD;
+ res = RPMRC_FAIL;
exit:
t = stpcpy(t, rpmSigString(res));
}
/*@=boundswrite@*/
-rpmVerifySignatureReturn
+rpmRC
rpmVerifySignature(const rpmts ts, char * result)
{
const void * sig = rpmtsSig(ts);
int_32 siglen = rpmtsSiglen(ts);
int_32 sigtag = rpmtsSigtag(ts);
pgpDig dig = rpmtsDig(ts);
- rpmVerifySignatureReturn res;
+ rpmRC res;
if (sig == NULL || siglen <= 0 || dig == NULL) {
sprintf(result, _("Verify signature: BAD PARAMETERS\n"));
- return RPMSIG_UNKNOWN;
+ return RPMRC_NOTFOUND;
}
switch (sigtag) {
case RPMSIGTAG_LEMD5_1:
case RPMSIGTAG_LEMD5_2:
sprintf(result, _("Broken MD5 digest: UNSUPPORTED\n"));
- res = RPMSIG_UNKNOWN;
+ res = RPMRC_NOTFOUND;
break;
default:
sprintf(result, _("Signature: UNKNOWN (%d)\n"), sigtag);
- res = RPMSIG_UNKNOWN;
+ res = RPMRC_NOTFOUND;
break;
}
return res;
rpmteNEVR(p), &p->h);
vsflags = rpmtsSetVSFlags(ts, ovsflags);
- if (!(rpmrc == RPMRC_OK || rpmrc == RPMRC_BADSIZE)) {
+ switch (rpmrc) {
+ default:
/*@-noeffectuncon@*/ /* FIX: notify annotations */
p->fd = ts->notify(p->h, RPMCALLBACK_INST_CLOSE_FILE,
0, 0,
/*@=noeffectuncon@*/
p->fd = NULL;
ourrc++;
+ /*@innerbreak@*/ break;
+ case RPMRC_OK:
+ /*@innerbreak@*/ break;
}
if (rpmteFd(p) != NULL) gotfd = 1;
}
/*@globals _Py_NoneStruct, fileSystem @*/
/*@modifies s, _Py_NoneStruct, fileSystem @*/
{
- hdrObject * hdr;
+ PyObject * result = NULL;
Header h;
FD_t fd;
int fdno;
Fclose(fd);
switch (rpmrc) {
- case RPMRC_BADSIZE:
case RPMRC_OK:
- hdr = hdr_Wrap(h);
- h = headerFree(h); /* XXX ref held by hdr */
+ if (h)
+ result = Py_BuildValue("N", hdr_Wrap(h));
+ h = headerFree(h); /* XXX ref held by result */
break;
case RPMRC_NOTFOUND:
Py_INCREF(Py_None);
- hdr = (hdrObject *) Py_None;
+ result = Py_None;
+ break;
+
+ case RPMRC_NOKEY:
+ PyErr_SetString(pyrpmError, "public key not availaiable");
+ break;
+
+ case RPMRC_NOTTRUSTED:
+ PyErr_SetString(pyrpmError, "public key not trusted");
break;
case RPMRC_FAIL:
- case RPMRC_SHORTREAD:
default:
PyErr_SetString(pyrpmError, "error reading package header");
- return NULL;
+ break;
}
- return Py_BuildValue("N", hdr);
+ return result;
}
/** \ingroup python
Py_INCREF(Py_None);
result = Py_None;
break;
- default:
+
+ case RPMRC_NOKEY:
+ PyErr_SetString(pyrpmError, "public key not availaiable");
+ break;
+
+ case RPMRC_NOTTRUSTED:
+ PyErr_SetString(pyrpmError, "public key not trusted");
+ break;
+
case RPMRC_FAIL:
+ default:
PyErr_SetString(pyrpmError, msg);
break;
}
%define version @VERSION@
Version: %{version}
%{expand: %%define rpm_version %{version}}
-Release: 0.87
+Release: 0.88
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz
Copyright: GPL
%{__prefix}/include/popt.h
%changelog
+* Fri Aug 22 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.88
+- merge signature returns into rpmRC.
+- python: exceptions on NOKEY/NOTTRUSTED.
+
* Thu Aug 21 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.87
- fix: don't stop if db1 database is currently in /var/lib/rpm (#72224).
- add a macro to create a sub-package with debugging symbols.
}
switch (rc) {
- case RPMRC_BADSIZE:
case RPMRC_OK:
+ case RPMRC_NOKEY:
+ case RPMRC_NOTTRUSTED:
break;
case RPMRC_NOTFOUND:
fprintf(stderr, _("argument is not an RPM package\n"));
exit(EXIT_FAILURE);
break;
case RPMRC_FAIL:
- case RPMRC_SHORTREAD:
default:
fprintf(stderr, _("error reading header from package\n"));
exit(EXIT_FAILURE);
@INCPATH@ \
-I$(top_srcdir)/misc
-EXTRA_DIST = rpminject.c rpmsort.c
+EXTRA_DIST = rpminject.c rpmsort.c sections.h utils.h
EXTRA_PROGRAMS = rpminject rpmsort
Fclose(fd);
fd = NULL;
- if (rpmrc == RPMRC_FAIL || rpmrc == RPMRC_SHORTREAD) {
- numFailed++; *fnp = NULL;
- continue;
- }
-
- if (rpmrc == RPMRC_OK || rpmrc == RPMRC_BADSIZE) {
- rc = rpmtsAddInstallElement(ts, h, (fnpyKey)fileName, 0, NULL);
- h = headerFree(h);
- continue;
- }
-
- if (rpmrc != RPMRC_NOTFOUND) {
+ switch (rpmrc) {
+ case RPMRC_FAIL:
+ default:
rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), *fnp);
numFailed++; *fnp = NULL;
- break;
+ /*@switchbreak@*/ break;
+ case RPMRC_OK:
+ rc = rpmtsAddInstallElement(ts, h, (fnpyKey)fileName, 0, NULL);
+ /*@switchbreak@*/ break;
+ case RPMRC_NOTFOUND:
+ goto maybe_manifest;
+ /*@notreached@*/ /*@switchbreak@*/ break;
}
+ h = headerFree(h);
+ continue;
+maybe_manifest:
/* Try to read a package manifest. */
fd = Fopen(*fnp, "r.fpio");
if (fd == NULL || Ferror(fd)) {