- fix: parse header data more carefully.
- fix: register SIGCHLD handler before forking (#73134).
- better diagnostics on failed header parsing.
+ - lclint clean.
4.0.3 -> 4.0.4:
- solaris: translate i86pc to i386 (#57182).
* @return 0 if new keyid, otherwise 1
*/
static int rpmtsStashKeyid(rpmts ts)
- /*@globals nkeyids, keyids @*/
- /*@modifies nkeyids, keyids @*/
+ /*@globals nextkeyid, nkeyids, keyids @*/
+ /*@modifies nextkeyid, nkeyids, keyids @*/
{
const void * sig = rpmtsSig(ts);
pgpDig dig = rpmtsDig(ts);
keyids = xrealloc(keyids, nkeyids * sizeof(*keyids));
}
/*@-boundswrite@*/
- keyids[nextkeyid] = keyid;
+ if (keyids) /* XXX can't happen */
+ keyids[nextkeyid] = keyid;
/*@=boundswrite@*/
nextkeyid++;
nextkeyid %= nkeyids_max;
int headerVerifyInfo(int il, int dl, const void * pev, void * iv, int negate)
{
+/*@-castexpose@*/
entryInfo pe = (entryInfo) pev;
+/*@=castexpose@*/
entryInfo info = iv;
int i;
int xx;
int i;
+/*@-boundswrite@*/
buf[0] = '\0';
+/*@=boundswrite@*/
/* Is the blob the right size? */
if (uc > 0 && pvlen != uc) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("blob size(%d): BAD, 8 + 16 * il(%d) + dl(%d)\n"),
uc, il, dl);
goto exit;
/* Check (and convert) the 1st tag element. */
xx = headerVerifyInfo(1, dl, pe, &entry->info, 0);
if (xx != -1) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("tag[%d]: BAD, tag %d type %d offset %d count %d\n"),
0, entry->info.tag, entry->info.type,
entry->info.offset, entry->info.count);
/* Is the offset within the data area? */
if (entry->info.offset >= dl) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("region offset: BAD, tag %d type %d offset %d count %d\n"),
entry->info.tag, entry->info.type,
entry->info.offset, entry->info.count);
/* Is there an immutable header region tag trailer? */
regionEnd = dataStart + entry->info.offset;
+/*@-sizeoftype@*/
/*@-bounds@*/
(void) memcpy(info, regionEnd, REGION_TAG_COUNT);
/*@=bounds@*/
regionEnd += REGION_TAG_COUNT;
-/*@-sizeoftype@*/
xx = headerVerifyInfo(1, dl, info, &entry->info, 1);
if (xx != -1 ||
!(entry->info.tag == RPMTAG_HEADERIMMUTABLE
&& entry->info.type == RPM_BIN_TYPE
&& entry->info.count == REGION_TAG_COUNT))
{
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("region trailer: BAD, tag %d type %d offset %d count %d\n"),
entry->info.tag, entry->info.type,
entry->info.offset, entry->info.count);
/* Is the no. of tags in the region less than the total no. of tags? */
ril = entry->info.offset/sizeof(*pe);
if ((entry->info.offset % sizeof(*pe)) || ril > il) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("region size: BAD, ril(%d) > il(%d)\n"), ril, il);
goto exit;
}
for (i = ril; i < il; i++) {
xx = headerVerifyInfo(1, dl, pe+i, &entry->info, 0);
if (xx != -1) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("tag[%d]: BAD, tag %d type %d offset %d count %d\n"),
i, entry->info.tag, entry->info.type,
entry->info.offset, entry->info.count);
}
if (entry->info.type != RPM_STRING_TYPE || *b != '\0' || blen != 40)
{
- snprintf(buf, sizeof(buf), _("hdr SHA1: BAD, not hex\n"));
+ (void) snprintf(buf, sizeof(buf), _("hdr SHA1: BAD, not hex\n"));
goto exit;
}
/*@=boundsread@*/
if (vsflags & RPMVSF_NODSAHEADER)
/*@switchbreak@*/ break;
if (entry->info.type != RPM_BIN_TYPE) {
- snprintf(buf, sizeof(buf), _("hdr DSA: BAD, not binary\n"));
+ (void) snprintf(buf, sizeof(buf), _("hdr DSA: BAD, not binary\n"));
goto exit;
}
/*@-boundswrite@*/
exit:
/* Return determined RPMRC_OK/RPMRC_FAIL conditions. */
if (rc != RPMRC_NOTFOUND) {
+/*@-boundswrite@*/
buf[sizeof(buf)-1] = '\0';
if (msg) *msg = xstrdup(buf);
+/*@=boundswrite@*/
return rc;
}
verifyinfo_exit:
xx = headerVerifyInfo(ril-1, dl, pe+1, &entry->info, 0);
if (xx != -1) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("tag[%d]: BAD, tag %d type %d offset %d count %d\n"),
xx+1, entry->info.tag, entry->info.type,
entry->info.offset, entry->info.count);
rc = RPMRC_FAIL;
} else {
- snprintf(buf, sizeof(buf), "Header sanity check: OK\n");
+ (void) snprintf(buf, sizeof(buf), "Header sanity check: OK\n");
rc = RPMRC_OK;
}
+/*@-boundswrite@*/
buf[sizeof(buf)-1] = '\0';
if (msg) *msg = xstrdup(buf);
+/*@=boundswrite@*/
return rc;
}
rpmRC rc = RPMRC_FAIL; /* assume failure */
int xx;
+/*@-boundswrite@*/
buf[0] = '\0';
if (hdrp)
*hdrp = NULL;
if (msg)
*msg = NULL;
+/*@=boundswrite@*/
+ memset(block, 0, sizeof(block));
if ((xx = timedRead(fd, (char *)block, sizeof(block))) != sizeof(block)) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("hdr size(%d): BAD, read returned %d\n"), sizeof(block), xx);
goto exit;
}
if (memcmp(block, header_magic, sizeof(header_magic))) {
- snprintf(buf, sizeof(buf), _("hdr magic: BAD\n"));
+ (void) snprintf(buf, sizeof(buf), _("hdr magic: BAD\n"));
goto exit;
}
+/*@-boundsread@*/
il = ntohl(block[2]);
+/*@=boundsread@*/
if (hdrchkTags(il)) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("hdr tags: BAD, no. of tags(%d) out of range\n"), il);
goto exit;
}
+/*@-boundsread@*/
dl = ntohl(block[3]);
+/*@=boundsread@*/
if (hdrchkData(dl)) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("hdr data: BAD, no. of bytes(%d) out of range\n"), dl);
goto exit;
}
+/*@-sizeoftype@*/
nb = (il * sizeof(struct entryInfo_s)) + dl;
+/*@=sizeoftype@*/
uc = sizeof(il) + sizeof(dl) + nb;
ei = xmalloc(uc);
+/*@-bounds@*/
ei[0] = block[2];
ei[1] = block[3];
if ((xx = timedRead(fd, (char *)&ei[2], nb)) != nb) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("hdr blob(%d): BAD, read returned %d\n"), nb, xx);
goto exit;
}
+/*@=bounds@*/
/* Sanity check header tags */
rc = headerCheck(ts, ei, uc, msg);
/* OK, blob looks sane, load the header. */
h = headerLoad(ei);
if (h == NULL) {
- snprintf(buf, sizeof(buf), _("hdr load: BAD\n"));
+ (void) snprintf(buf, sizeof(buf), _("hdr load: BAD\n"));
goto exit;
}
h->flags |= HEADERFLAG_ALLOCATED;
ei = NULL; /* XXX will be freed with header */
exit:
- if (rc == RPMRC_OK && hdrp && h)
+/*@-boundswrite@*/
+ if (hdrp && h && rc == RPMRC_OK)
*hdrp = headerLink(h);
+/*@=boundswrite@*/
ei = _free(ei);
h = headerFree(h);
return rc;
}
+/*@-bounds@*/ /* LCL: segfault */
int rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
{
pgpDig dig;
sigh = rpmFreeSignature(sigh);
return rc;
}
+/*@=bounds@*/
*/
static pid_t psmFork(rpmpsm psm)
/*@globals fileSystem, internalState @*/
- /*@modifies psm, fileSystem, internalState @*/
+ /*@modifies fileSystem, internalState @*/
{
pid_t pid;
* @return fork(2) pid
*/
static pid_t psmRegisterFork(rpmpsm psm)
- /*@globals psmtbl, fileSystem @*/
- /*@modifies psm, psmtbl, fileSystem @*/
+ /*@globals psmtbl, fileSystem, internalState @*/
+ /*@modifies psm, psmtbl, fileSystem, internalState @*/
{
sigset_t newMask, oldMask;
int empty = -1;
* Unregister a child reaper.
*/
static int psmUnregister(rpmpsm psm, pid_t child)
- /*@globals psmtbl, fileSystem @*/
- /*@modifies psmtbl, fileSystem @*/
+ /*@globals psmtbl, fileSystem, internalState @*/
+ /*@modifies psmtbl, fileSystem, internalState @*/
{
sigset_t newMask, oldMask;
int i = 0;
* @return
*/
static inline pid_t psmGetReaped(rpmpsm psm)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/
{
sigset_t newMask, oldMask;
pid_t reaped;
FD_t out;
rpmRC rc = RPMRC_OK;
const char *n, *v, *r;
+ pid_t pid;
if (progArgv == NULL && script == NULL)
return rc;
if (out == NULL) return RPMRC_FAIL; /* XXX can't happen */
/*@-branchstate@*/
- if ((psm->child = psmRegisterFork(psm)) == 0) {
+ pid = psmRegisterFork(psm);
+ psm->child = pid;
+ if (psm->child == 0) {
const char * rootDir;
int pipes[2];
_("package has neither file owner or id lists\n"));
}
}
+/*@-branchstate@*/
if (te > t) {
/*@-boundswrite@*/
*te++ = '\n';
*t = '\0';
/*@=boundswrite@*/
}
+/*@=branchstate@*/
}
rc = 0;
* @return result of last non-zero showPackage() return
*/
int rpmcliShowMatches(QVA_t qva, rpmts ts)
- /*@globals rpmGlobalMacroContext, fileSystem@*/
- /*@modifies qva, rpmGlobalMacroContext, fileSystem @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies qva, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmcli
* Display list of tags that can be used in --queryformat.
int rpmErase(rpmts ts, const struct rpmInstallArguments_s * ia,
/*@null@*/ const char ** argv)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
- /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
+ /*@modifies ts, ia, rpmGlobalMacroContext,
+ fileSystem, internalState @*/;
/**
* A rollback transaction id element.
* Translate and merge legacy signature tags into header.
* @todo Remove headerSort() through headerInitIterator() modifies sig.
* @param h header
- * @param sig signature header
+ * @param sigh signature header
*/
-void headerMergeLegacySigs(Header h, const Header sig)
- /*@modifies h, sig @*/;
+void headerMergeLegacySigs(Header h, const Header sigh)
+ /*@modifies h, sigh @*/;
/** \ingroup header
* Regenerate signature header.
* @param ts transaction set
* @param uh unloaded header blob
* @param uc no. of bytes in blob (or 0 to disable)
- * @retval *msg verification error message
+ * @retval *msg verification error message (or NULL)
* @return RPMRC_OK on success
*/
-rpmRC headerCheck(rpmts ts, const void * uh, size_t uc, const char ** msg)
+rpmRC headerCheck(rpmts ts, const void * uh, size_t uc,
+ /*@out@*/ /*@null@*/ const char ** msg)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies ts, *msg, rpmGlobalMacroContext,
fileSystem, internalState @*/;
* @param ts transaction set
* @param fd file handle
* @retval hdrp address of header (or NULL)
- * @retval *msg verification error message
+ * @retval *msg verification error message (or NULL)
* @return RPMRC_OK on success
*/
-rpmRC rpmReadHeader(rpmts ts, FD_t fd, Header *hdrp, const char ** msg)
+rpmRC rpmReadHeader(rpmts ts, FD_t fd, /*@out@*/ Header *hdrp,
+ /*@out@*/ /*@null@*/ const char ** msg)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
- /*@modifies ts, *msg, rpmGlobalMacroContext,
+ /*@modifies ts, *hdrp, *msg, rpmGlobalMacroContext,
fileSystem, internalState @*/;
/**
#include "debug.h"
/*@access Header@*/ /* XXX compared with NULL */
+/*@access entryInfo @*/ /* XXX rpmReadSignature */
+/*@access indexEntry @*/ /* XXX rpmReadSignature */
/*@access FD_t@*/ /* XXX compared with NULL */
/*@access DIGEST_CTX@*/ /* XXX compared with NULL */
/*@access pgpDig@*/
int xx;
int i;
+/*@-boundswrite@*/
if (sighp)
*sighp = NULL;
buf[0] = '\0';
+/*@=boundswrite@*/
if (sig_type != RPMSIGTYPE_HEADERSIG)
goto exit;
+ memset(block, 0, sizeof(block));
if ((xx = timedRead(fd, (char *)block, sizeof(block))) != sizeof(block)) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("sigh size(%d): BAD, read returned %d\n"), sizeof(block), xx);
goto exit;
}
if (memcmp(block, header_magic, sizeof(header_magic))) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("sigh magic: BAD\n"));
goto exit;
}
+/*@-boundsread@*/
il = ntohl(block[2]);
+/*@=boundsread@*/
if (il < 0 || il > 32) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("sigh tags: BAD, no. of tags(%d) out of range\n"), il);
goto exit;
}
+/*@-boundsread@*/
dl = ntohl(block[3]);
+/*@=boundsread@*/
if (dl < 0 || dl > 8192) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("sigh data: BAD, no. of bytes(%d) out of range\n"), dl);
goto exit;
}
+/*@-sizeoftype@*/
nb = (il * sizeof(struct entryInfo_s)) + dl;
+/*@=sizeoftype@*/
ei = xmalloc(sizeof(il) + sizeof(dl) + nb);
+/*@-bounds@*/
ei[0] = block[2];
ei[1] = block[3];
pe = (entryInfo) &ei[2];
+/*@=bounds@*/
dataStart = (unsigned char *) (pe + il);
if ((xx = timedRead(fd, (char *)pe, nb)) != nb) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("sigh blob(%d): BAD, read returned %d\n"), nb, xx);
goto exit;
}
/* Check (and convert) the 1st tag element. */
xx = headerVerifyInfo(1, dl, pe, &entry->info, 0);
if (xx != -1) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("tag[%d]: BAD, tag %d type %d offset %d count %d\n"),
0, entry->info.tag, entry->info.type,
entry->info.offset, entry->info.count);
/*@=sizeoftype@*/
if (entry->info.offset >= dl) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("region offset: BAD, tag %d type %d offset %d count %d\n"),
entry->info.tag, entry->info.type,
entry->info.offset, entry->info.count);
/* Is there an immutable header region tag trailer? */
dataEnd = dataStart + entry->info.offset;
+/*@-sizeoftype@*/
/*@-bounds@*/
(void) memcpy(info, dataEnd, REGION_TAG_COUNT);
/*@=bounds@*/
dataEnd += REGION_TAG_COUNT;
-/*@-sizeoftype@*/
xx = headerVerifyInfo(1, dl, info, &entry->info, 1);
if (xx != -1 ||
!(entry->info.tag == RPMTAG_HEADERSIGNATURES
&& entry->info.type == RPM_BIN_TYPE
&& entry->info.count == REGION_TAG_COUNT))
{
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("region trailer: BAD, tag %d type %d offset %d count %d\n"),
entry->info.tag, entry->info.type,
entry->info.offset, entry->info.count);
/* Is the no. of tags in the region less than the total no. of tags? */
ril = entry->info.offset/sizeof(*pe);
if ((entry->info.offset % sizeof(*pe)) || ril > il) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("region size: BAD, ril(%d) > il(%d)\n"), ril, il);
goto exit;
}
}
/* Sanity check signature tags */
+/*@-boundswrite@*/
memset(info, 0, sizeof(*info));
+/*@=boundswrite@*/
for (i = 1; i < il; i++) {
xx = headerVerifyInfo(1, dl, pe+i, &entry->info, 0);
if (xx != -1) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("sigh tag[%d]: BAD, tag %d type %d offset %d count %d\n"),
i, entry->info.tag, entry->info.type,
entry->info.offset, entry->info.count);
/* OK, blob looks sane, load the header. */
sigh = headerLoad(ei);
if (sigh == NULL) {
- snprintf(buf, sizeof(buf), _("sigh load: BAD\n"));
+ (void) snprintf(buf, sizeof(buf), _("sigh load: BAD\n"));
goto exit;
}
sigh->flags |= HEADERFLAG_ALLOCATED;
/* Position at beginning of header. */
if (pad && (xx = timedRead(fd, (char *)block, pad)) != pad) {
- snprintf(buf, sizeof(buf),
+ (void) snprintf(buf, sizeof(buf),
_("sigh pad(%d): BAD, read %d bytes\n"), pad, xx);
goto exit;
}
}
exit:
- if (rc == RPMRC_OK && sighp && sigh)
+/*@-boundswrite@*/
+ if (sighp && sigh && rc == RPMRC_OK)
*sighp = headerLink(sigh);
sigh = headerFree(sigh);
-/*@-boundswrite@*/
if (msg != NULL) {
buf[sizeof(buf)-1] = '\0';
*msg = xstrdup(buf);
* @return rpmRC return code
*/
rpmRC rpmReadSignature(FD_t fd, /*@null@*/ /*@out@*/ Header *sighp,
- sigType sig_type, const char ** msg)
+ sigType sig_type, /*@null@*/ /*@out@*/ const char ** msg)
/*@globals fileSystem @*/
- /*@modifies fd, *sighp, fileSystem @*/;
+ /*@modifies fd, *sighp, *msg, fileSystem @*/;
/** \ingroup signature
* Write signature header.
*/
int rpmdbFindFpList(/*@null@*/ rpmdb db, fingerPrint * fpList,
/*@out@*/ dbiIndexSet * matchList, int numItems)
- /*@globals rpmGlobalMacroContext, fileSystem @*/
- /*@modifies db, *matchList, rpmGlobalMacroContext, fileSystem @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies db, *matchList, rpmGlobalMacroContext,
+ fileSystem, internalState @*/;
/* Be carefull with the memory... assert(*fullName == '/' || !scareMemory) */
case RPM_STRING_TYPE:
if (count != 1)
return -1;
+/*@-boundsread@*/
while (*s++) {
if (se && s > se)
return -1;
length++;
}
+/*@=boundsread@*/
length++; /* count nul terminator too. */
break;
if (onDisk) {
while (count--) {
length++; /* count nul terminator too */
+/*@-boundsread@*/
while (*s++) {
if (se && s > se)
return -1;
length++;
}
+/*@=boundsread@*/
}
} else {
const char ** av = (const char **)p;
return -1;
if (hdrchkData(ie.info.offset))
return -1;
+/*@-boundsread@*/
if (hdrchkAlign(ie.info.type, ie.info.offset))
return -1;
+/*@=boundsread@*/
ie.data = t = dataStart + ie.info.offset;
if (dataEnd && t >= dataEnd)
if (hdrchkData(off))
goto errxit;
if (off) {
+/*@-sizeoftype@*/
size_t nb = REGION_TAG_COUNT;
+/*@=sizeoftype@*/
int_32 * stei = memcpy(alloca(nb), dataStart + off, nb);
rdl = -ntohl(stei[2]); /* negative offset */
ril = rdl/sizeof(*pe);
int length;
length = dataLength(type, p, c, 0, NULL);
+/*@-branchstate@*/
if (length > 0) {
data = xmalloc(length);
copyData(type, data, p, c, length);
}
+/*@=branchstate@*/
if (lengthPtr)
*lengthPtr = length;
* @return -1 on error, otherwise, an open file descriptor
*/
static int open_dso(const char * path, /*@null@*/ pid_t * pidp, /*@null@*/ size_t *fsizep)
- /*@globals rpmGlobalMacroContext, internalState @*/
- /*@modifies *pidp, *fsizep, rpmGlobalMacroContext, internalState @*/
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies *pidp, *fsizep, rpmGlobalMacroContext,
+ fileSystem, internalState @*/
{
/*@only@*/
static const char * cmd = NULL;
*/
/*@mayexit@*/
static int unblockSignals(/*@unused@*/ rpmdb db, sigset_t * oldMask)
- /*@globals rpmdbRock, fileSystem @*/
- /*@modifies rpmdbRock, fileSystem @*/
+ /*@globals rpmdbRock, fileSystem, internalState @*/
+ /*@modifies rpmdbRock, fileSystem, internalState @*/
{
(void) rpmdbCheckSignals();
return sigprocmask(SIG_SETMASK, oldMask, NULL);
*/
static int rpmdbFindByFile(rpmdb db, /*@null@*/ const char * filespec,
DBT * key, DBT * data, /*@out@*/ dbiIndexSet * matches)
- /*@globals rpmGlobalMacroContext, fileSystem @*/
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies db, *key, *data, *matches, rpmGlobalMacroContext,
- fileSystem @*/
+ fileSystem, internalState @*/
/*@requires maxSet(matches) >= 0 @*/
{
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
/*@null@*/ const char * version,
/*@null@*/ const char * release,
/*@out@*/ dbiIndexSet * matches)
- /*@globals rpmGlobalMacroContext, fileSystem @*/
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies dbi, *dbcursor, *key, *data, *matches,
- rpmGlobalMacroContext, fileSystem @*/
+ rpmGlobalMacroContext, fileSystem, internalState @*/
/*@requires maxSet(matches) >= 0 @*/
{
int gotMatches = 0;
*/
static rpmRC dbiFindByLabel(dbiIndex dbi, DBC * dbcursor, DBT * key, DBT * data,
/*@null@*/ const char * arg, /*@out@*/ dbiIndexSet * matches)
- /*@globals rpmGlobalMacroContext, fileSystem @*/
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies dbi, *dbcursor, *key, *data, *matches,
- rpmGlobalMacroContext, fileSystem @*/
+ rpmGlobalMacroContext, fileSystem, internalState @*/
/*@requires maxSet(matches) >= 0 @*/
{
const char * release;
* @return 0 on success
*/
static int miFreeHeader(rpmdbMatchIterator mi, dbiIndex dbi)
- /*@globals fileSystem @*/
- /*@modifies mi, fileSystem @*/
+ /*@globals fileSystem, internalState @*/
+ /*@modifies mi, fileSystem, internalState @*/
{
int rc = 0;
/*@only@*/ /*@null@*/
rpmdbMatchIterator rpmdbInitIterator(/*@null@*/ rpmdb db, rpmTag rpmtag,
/*@null@*/ const void * keyp, size_t keylen)
- /*@globals rpmGlobalMacroContext, fileSystem @*/
- /*@modifies db, rpmGlobalMacroContext, fileSystem @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb
* Return next package header from iteration.
*/
/*@null@*/
Header rpmdbNextIterator(/*@null@*/ rpmdbMatchIterator mi)
- /*@globals rpmGlobalMacroContext, fileSystem @*/
- /*@modifies mi, rpmGlobalMacroContext, fileSystem @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb
* Check rpmdb signal handler for trapped signal exit.
*/
/*@mayexit@*/
int rpmdbCheckSignals(void)
- /*@globals fileSystem @*/
- /*@modifies fileSystem @*/;
+ /*@globals fileSystem, internalState @*/
+ /*@modifies fileSystem, internalState @*/;
/** \ingroup rpmdb
* Destroy rpm database iterator.
*/
/*@null@*/
rpmdbMatchIterator rpmdbFreeIterator(/*@only@*/ /*@null@*/rpmdbMatchIterator mi)
- /*@globals rpmGlobalMacroContext, fileSystem @*/
- /*@modifies mi, rpmGlobalMacroContext, fileSystem @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb
* Add package header to rpm database and indices.
*/
int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts,
/*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
- /*@globals rpmGlobalMacroContext, fileSystem @*/
- /*@modifies db, h, rpmGlobalMacroContext, fileSystem @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies db, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb
* Remove package header from rpm database and indices.
int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum,
/*@null@*/ rpmts ts,
/*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
- /*@globals rpmGlobalMacroContext, fileSystem @*/
- /*@modifies db, rpmGlobalMacroContext, fileSystem @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb
* Rebuild database indices from package headers.
#include "debug.h"
+#if defined(__LCLINT__)
+/*@-exportheader@*/
+extern const unsigned short int **__ctype_b_loc (void) /*@*/;
+/*@=exportheader@*/
+#endif
+
/*@access FD_t@*/ /* XXX compared with NULL */
/*@access MacroContext@*/
/*@access MacroEntry@*/
#include "ugid.h"
#include "debug.h"
+/*@access DIR@*/
/*@access FD_t@*/
/*@access urlinfo@*/
/*@=abstract@*/
mydir->fd = ftpmagicdir;
+/*@-usereleased@*/
mydir->data = (char *) dp;
+/*@=usereleased@*/
mydir->allocation = nb;
mydir->size = ac;
mydir->offset = -1;
}
av[ac] = NULL;
+/*@-kepttrans@*/
return (DIR *) mydir;
+/*@=kepttrans@*/
}
/*@=boundswrite@*/