RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ Doxyfile.in rpm/lib/ formats.c package.c rpmchecksig.c...

From: Jeff Johnson <jbj@rpm5.org>
Date: Mon 26 Nov 2007 - 22:05:57 CET
Message-Id: <20071126210557.9135734845D@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   26-Nov-2007 22:05:57
  Branch: HEAD                             Handle: 2007112621055601

  Modified files:
    rpm                     Doxyfile.in
    rpm/lib                 formats.c package.c rpmchecksig.c rpmgi.c
    rpm/rpmdb               Makefile.am hdrfmt.c header.c pkgio.c rpmdb.c
                            rpmtag.h rpmwf.c signature.c

  Log:
    - splint fiddles. cool, splint _FINALLY_ can see that rpmTag !=
    rpmSigTag.

  Summary:
    Revision    Changes     Path
    2.82        +0  -2      rpm/Doxyfile.in
    2.124       +2  -0      rpm/lib/formats.c
    2.194       +10 -10     rpm/lib/package.c
    1.202       +34 -32     rpm/lib/rpmchecksig.c
    2.46        +2  -0      rpm/lib/rpmgi.c
    1.93        +2  -0      rpm/rpmdb/Makefile.am
    1.47        +23 -12     rpm/rpmdb/hdrfmt.c
    1.139       +7  -6      rpm/rpmdb/header.c
    1.62        +6  -1      rpm/rpmdb/pkgio.c
    1.223       +18 -3      rpm/rpmdb/rpmdb.c
    1.18        +4  -7      rpm/rpmdb/rpmtag.h
    1.22        +12 -0      rpm/rpmdb/rpmwf.c
    1.35        +2  -0      rpm/rpmdb/signature.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/Doxyfile.in
  ============================================================================
  $ cvs diff -u -r2.81 -r2.82 Doxyfile.in
  --- rpm/Doxyfile.in	19 Nov 2007 18:57:54 -0000	2.81
  +++ rpm/Doxyfile.in	26 Nov 2007 21:05:56 -0000	2.82
  @@ -607,10 +607,8 @@
                            @top_srcdir@/rpmdb/fprint.c \
                            @top_srcdir@/rpmdb/fprint.h \
                            @top_srcdir@/rpmdb/hdrfmt.c \
  -                         @top_srcdir@/rpmdb/hdrinline.h \
                            @top_srcdir@/rpmdb/hdrNVR.c \
                            @top_srcdir@/rpmdb/header.c \
  -                         @top_srcdir@/rpmdb/header.h \
                            @top_srcdir@/rpmdb/header_internal.c \
                            @top_srcdir@/rpmdb/header_internal.h \
                            @top_srcdir@/rpmdb/legacy.c \
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/formats.c
  ============================================================================
  $ cvs diff -u -r2.123 -r2.124 formats.c
  --- rpm/lib/formats.c	24 Nov 2007 23:55:01 -0000	2.123
  +++ rpm/lib/formats.c	26 Nov 2007 21:05:56 -0000	2.124
  @@ -23,6 +23,8 @@
   
   #include "debug.h"
   
  +/*@access headerSprintfExtension @*/
  +
   /**
    * Retrieve mounted file system paths.
    * @param h		header
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/package.c
  ============================================================================
  $ cvs diff -u -r2.193 -r2.194 package.c
  --- rpm/lib/package.c	24 Nov 2007 22:07:28 -0000	2.193
  +++ rpm/lib/package.c	26 Nov 2007 21:05:56 -0000	2.194
  @@ -173,19 +173,19 @@
       she->tag = 0;
       opx = 0;
       vsflags = pgpGetVSFlags(dig);
  -    if (_chk(RPMVSF_NODSAHEADER) && headerIsEntry(sigh, RPMSIGTAG_DSA)) {
  -	she->tag = RPMSIGTAG_DSA;
  +    if (_chk(RPMVSF_NODSAHEADER) && headerIsEntry(sigh, (rpmTag)RPMSIGTAG_DSA)) {
  +	she->tag = (rpmTag)RPMSIGTAG_DSA;
       } else
  -    if (_chk(RPMVSF_NORSAHEADER) && headerIsEntry(sigh, RPMSIGTAG_RSA)) {
  -	she->tag = RPMSIGTAG_RSA;
  +    if (_chk(RPMVSF_NORSAHEADER) && headerIsEntry(sigh, (rpmTag)RPMSIGTAG_RSA)) {
  +	she->tag = (rpmTag)RPMSIGTAG_RSA;
       } else
  -    if (_chk(RPMVSF_NOSHA1HEADER) && headerIsEntry(sigh, RPMSIGTAG_SHA1)) {
  -	she->tag = RPMSIGTAG_SHA1;
  +    if (_chk(RPMVSF_NOSHA1HEADER) && headerIsEntry(sigh, (rpmTag)RPMSIGTAG_SHA1)) {
  +	she->tag = (rpmTag)RPMSIGTAG_SHA1;
       } else
       if (_chk(RPMVSF_NOMD5|RPMVSF_NEEDPAYLOAD) &&
  -	headerIsEntry(sigh, RPMSIGTAG_MD5))
  +	headerIsEntry(sigh, (rpmTag)RPMSIGTAG_MD5))
       {
  -	she->tag = RPMSIGTAG_MD5;
  +	she->tag = (rpmTag)RPMSIGTAG_MD5;
   	fdInitDigest(fd, PGPHASHALGO_MD5, 0);
   	opx = RPMTS_OP_DIGEST;
       }
  @@ -237,7 +237,7 @@
       xx = pgpSetSig(dig, she->tag, she->t, she->p.ptr, she->c);
   /*@=noeffect@*/
   
  -    switch (she->tag) {
  +    switch ((rpmSigTag)she->tag) {
       default:	/* XXX keep gcc quiet. */
   assert(0);
   	/*@notreached@*/ break;
  @@ -314,7 +314,7 @@
   	(void) rpmDigestUpdate(dig->hdrsha1ctx, uh, uhc);
   	dig->nbytes += uhc;
   	(void) rpmswExit(op, dig->nbytes);
  -	if (she->tag == RPMSIGTAG_SHA1)
  +	if ((rpmSigTag)she->tag == RPMSIGTAG_SHA1)
   	    op->count--;	/* XXX one too many */
   	uh = _free(uh);
       }	break;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmchecksig.c
  ============================================================================
  $ cvs diff -u -r1.201 -r1.202 rpmchecksig.c
  --- rpm/lib/rpmchecksig.c	26 Nov 2007 02:03:09 -0000	1.201
  +++ rpm/lib/rpmchecksig.c	26 Nov 2007 21:05:56 -0000	1.202
  @@ -184,7 +184,7 @@
       FD_t fd = NULL;
       FD_t ofd = NULL;
       struct rpmlead *lead = NULL;
  -    uint32_t sigtag;
  +    rpmSigTag sigtag;
       const char *sigtarget = NULL;
       char tmprpm[1024+1];
       Header sigh = NULL;
  @@ -296,36 +296,36 @@
   
   if (sigh != NULL) {
   	/* Eliminate broken digest values. */
  -	he->tag = RPMSIGTAG_LEMD5_1;
  +	he->tag = (rpmTag)RPMSIGTAG_LEMD5_1;
   	xx = headerDel(sigh, he, 0);
  -	he->tag = RPMSIGTAG_LEMD5_2;
  +	he->tag = (rpmTag)RPMSIGTAG_LEMD5_2;
   	xx = headerDel(sigh, he, 0);
  -	he->tag = RPMSIGTAG_BADSHA1_1;
  +	he->tag = (rpmTag)RPMSIGTAG_BADSHA1_1;
   	xx = headerDel(sigh, he, 0);
  -	he->tag = RPMSIGTAG_BADSHA1_2;
  +	he->tag = (rpmTag)RPMSIGTAG_BADSHA1_2;
   	xx = headerDel(sigh, he, 0);
   
   	/* Toss and recalculate header+payload size and digests. */
  -	he->tag = RPMSIGTAG_SIZE;
  +	he->tag = (rpmTag)RPMSIGTAG_SIZE;
   	xx = headerDel(sigh, he, 0);
   	xx = rpmAddSignature(sigh, sigtarget, RPMSIGTAG_SIZE, qva->passPhrase);
  -	he->tag = RPMSIGTAG_MD5;
  +	he->tag = (rpmTag)RPMSIGTAG_MD5;
   	xx = headerDel(sigh, he, 0);
   	xx = rpmAddSignature(sigh, sigtarget, RPMSIGTAG_MD5, qva->passPhrase);
  -	he->tag = RPMSIGTAG_SHA1;
  +	he->tag = (rpmTag)RPMSIGTAG_SHA1;
   	xx = headerDel(sigh, he, 0);
   	xx = rpmAddSignature(sigh, sigtarget, RPMSIGTAG_SHA1, qva->passPhrase);
   
   	if (deleting) {	/* Nuke all the signature tags. */
  -	    he->tag = RPMSIGTAG_GPG;
  +	    he->tag = (rpmTag)RPMSIGTAG_GPG;
   	    xx = headerDel(sigh, he, 0);
  -	    he->tag = RPMSIGTAG_PGP5;
  +	    he->tag = (rpmTag)RPMSIGTAG_PGP5;
   	    xx = headerDel(sigh, he, 0);
  -	    he->tag = RPMSIGTAG_PGP;
  +	    he->tag = (rpmTag)RPMSIGTAG_PGP;
   	    xx = headerDel(sigh, he, 0);
  -	    he->tag = RPMSIGTAG_DSA;
  +	    he->tag = (rpmTag)RPMSIGTAG_DSA;
   	    xx = headerDel(sigh, he, 0);
  -	    he->tag = RPMSIGTAG_RSA;
  +	    he->tag = (rpmTag)RPMSIGTAG_RSA;
   	    xx = headerDel(sigh, he, 0);
   	} else {		/* If gpg/pgp is configured, replace the signature. */
   	  int addsig = 0;
  @@ -340,26 +340,28 @@
   	    xx = getSignid(sigh, sigtag, oldsignid);
   
   	    switch (sigtag) {
  +	    default:
  +		/*@switchbreak@*/ break;
   	    case RPMSIGTAG_DSA:
  -		he->tag = RPMSIGTAG_GPG;
  +		he->tag = (rpmTag)RPMSIGTAG_GPG;
   		xx = headerDel(sigh, he, 0);
   		/*@switchbreak@*/ break;
   	    case RPMSIGTAG_RSA:
  -		he->tag = RPMSIGTAG_PGP;
  +		he->tag = (rpmTag)RPMSIGTAG_PGP;
   		xx = headerDel(sigh, he, 0);
   		/*@switchbreak@*/ break;
   	    case RPMSIGTAG_GPG:
  -		he->tag = RPMSIGTAG_DSA;
  +		he->tag = (rpmTag)RPMSIGTAG_DSA;
   		xx = headerDel(sigh, he, 0);
   		/*@fallthrough@*/
   	    case RPMSIGTAG_PGP5:
   	    case RPMSIGTAG_PGP:
  -		he->tag = RPMSIGTAG_RSA;
  +		he->tag = (rpmTag)RPMSIGTAG_RSA;
   		xx = headerDel(sigh, he, 0);
   		/*@switchbreak@*/ break;
   	    }
   
  -	    he->tag = sigtag;
  +	    he->tag = (rpmTag)sigtag;
   	    xx = headerDel(sigh, he, 0);
   	    xx = rpmAddSignature(sigh, sigtarget, sigtag, qva->passPhrase);
   
  @@ -943,16 +945,16 @@
   	/* Grab a hint of what needs doing to avoid duplication. */
   	she->tag = 0;
   	if (she->tag == 0 && !nosignatures) {
  -	    if (headerIsEntry(sigh, RPMSIGTAG_DSA))
  -		she->tag = RPMSIGTAG_DSA;
  -	    else if (headerIsEntry(sigh, RPMSIGTAG_RSA))
  -		she->tag = RPMSIGTAG_RSA;
  +	    if (headerIsEntry(sigh, (rpmTag) RPMSIGTAG_DSA))
  +		she->tag = (rpmTag) RPMSIGTAG_DSA;
  +	    else if (headerIsEntry(sigh, (rpmTag) RPMSIGTAG_RSA))
  +		she->tag = (rpmTag) RPMSIGTAG_RSA;
   	}
   	if (she->tag == 0 && !nodigests) {
  -	    if (headerIsEntry(sigh, RPMSIGTAG_MD5))
  -		she->tag = RPMSIGTAG_MD5;
  -	    else if (headerIsEntry(sigh, RPMSIGTAG_SHA1))
  -		she->tag = RPMSIGTAG_SHA1;	/* XXX never happens */
  +	    if (headerIsEntry(sigh, (rpmTag) RPMSIGTAG_MD5))
  +		she->tag = (rpmTag) RPMSIGTAG_MD5;
  +	    else if (headerIsEntry(sigh, (rpmTag) RPMSIGTAG_SHA1))
  +		she->tag = (rpmTag) RPMSIGTAG_SHA1;	/* XXX never happens */
   	}
   
   	dig = rpmtsDig(ts);
  @@ -960,14 +962,14 @@
   	sigp = pgpGetSignature(dig);
   
   	/* XXX RSA needs the hash_algo, so decode early. */
  -	if (she->tag == RPMSIGTAG_RSA) {
  +	if ((rpmSigTag) she->tag == RPMSIGTAG_RSA) {
   	    he->tag = she->tag;
   	    xx = headerGet(sigh, he, 0);
   	    xx = pgpPrtPkts(he->p.ptr, he->c, dig, 0);
   	    he->p.ptr = _free(he->p.ptr);
   	}
   
  -	if (headerIsEntry(sigh, RPMSIGTAG_MD5))
  +	if (headerIsEntry(sigh, (rpmTag)RPMSIGTAG_MD5))
   	    fdInitDigest(fd, PGPHASHALGO_MD5, 0);
   
   	/* Read the file, generating digest(s) on the fly. */
  @@ -1000,7 +1002,7 @@
   	    xx = pgpSetSig(dig, she->tag, she->t, she->p.ptr, she->c);
   /*@=noeffect@*/
   
  -	    switch (she->tag) {
  +	    switch ((rpmSigTag)she->tag) {
   	    case RPMSIGTAG_RSA:
   	    case RPMSIGTAG_DSA:
   		if (nosignatures)
  @@ -1020,7 +1022,7 @@
   		if (nodigests)
   		     continue;
   		/* XXX Don't bother with header sha1 if header dsa. */
  -		if (!nosignatures && she->tag == RPMSIGTAG_DSA)
  +		if (!nosignatures && (rpmSigTag)she->tag == RPMSIGTAG_DSA)
   		    continue;
   		/*@switchbreak@*/ break;
   	    case RPMSIGTAG_MD5:
  @@ -1040,7 +1042,7 @@
   		    b = stpcpy(b, result);
   		    res2 = 1;
   		} else {
  -		    switch (she->tag) {
  +		    switch ((rpmSigTag)she->tag) {
   		    case RPMSIGTAG_SIZE:
   			b = stpcpy(b, "SIZE ");
   			res2 = 1;
  @@ -1072,7 +1074,7 @@
   		    b = stpcpy(b, "    ");
   		    b = stpcpy(b, result);
   		} else {
  -		    switch (she->tag) {
  +		    switch ((rpmSigTag)she->tag) {
   		    case RPMSIGTAG_SIZE:
   			b = stpcpy(b, "size ");
   			/*@switchbreak@*/ break;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmgi.c
  ============================================================================
  $ cvs diff -u -r2.45 -r2.46 rpmgi.c
  --- rpm/lib/rpmgi.c	26 Nov 2007 05:16:50 -0000	2.45
  +++ rpm/lib/rpmgi.c	26 Nov 2007 21:05:56 -0000	2.46
  @@ -673,7 +673,9 @@
   	    Header h = NULL;
   	    const char item[] = "Header";
   	    const char * msg = NULL;
  +/*@+voidabstract@*/
   	    rpmrc = rpmpkgRead(item, gi->fd, &h, &msg);
  +/*@=voidabstract@*/
   	    if (rpmrc != RPMRC_OK) {
   		rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerRead", item, msg);
   		h = NULL;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/Makefile.am
  ============================================================================
  $ cvs diff -u -r1.92 -r1.93 Makefile.am
  --- rpm/rpmdb/Makefile.am	26 Nov 2007 05:16:52 -0000	1.92
  +++ rpm/rpmdb/Makefile.am	26 Nov 2007 21:05:57 -0000	1.93
  @@ -84,6 +84,8 @@
   	@echo '#include <rpmtag.h>' >> $@
   	@echo '#include "debug.h"' >> $@
   	@echo '' >> $@
  +	@echo '/*@access headerTagTableEntry @*/' >> $@
  +	@echo '' >> $@
   	@echo '/*@observer@*/ /*@unchecked@*/' >> $@
   	@echo 'static const struct headerTagTableEntry_s _rpmTagTable[] = {' >> $@
   	${AWK} '/[ \t](RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ {tt = "NULL"; ta = "ANY"; if ($$5 == "c") {tt = "UINT8"; ta = "SCALAR"} if ($$5 == "c[]") {tt = "UINT8"; ta = "ARRAY"} if ($$5 == "h") {tt = "UINT16"; ta = "SCALAR"} if ($$5 == "h[]") {tt = "UINT16"; ta = "ARRAY"} if ($$5 == "i") {tt = "UINT32"; ta = "SCALAR"} if ($$5 == "i[]") {tt = "UINT32"; ta = "ARRAY"} if ($$5 == "l") {tt = "UINT64"; ta = "SCALAR"} if ($$5 == "l[]") {tt = "UINT64"; ta = "ARRAY"} if ($$5 == "s") {tt = "STRING"; ta = "SCALAR"} if ($$5 == "s[]") {tt = "STRING_ARRAY"; ta = "ARRAY"} if ($$5 == "s{}") {tt = "I18NSTRING"; ta = "SCALAR"} if ($$5 == "x") {tt = "BIN"; ta = "SCALAR"} if ($$2 == "=") { printf("\t{ \"%s\",	%s	RPM_%s_TYPE + RPM_%s_RETURN_TYPE },\n", $$1, $$3, tt, ta) } else { printf("\t{ \"%s\",	%s,	RPM_%s_TYPE + RPM_%s_RETURN_TYPE  },\n", $$2, $$3, tt, ta) } }' < ${top_srcdir}/rpmdb/rpmtag.h | sort >> $@
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/hdrfmt.c
  ============================================================================
  $ cvs diff -u -r1.46 -r1.47 hdrfmt.c
  --- rpm/rpmdb/hdrfmt.c	26 Nov 2007 06:52:52 -0000	1.46
  +++ rpm/rpmdb/hdrfmt.c	26 Nov 2007 21:05:57 -0000	1.47
  @@ -23,8 +23,7 @@
   /*@access pgpDig @*/
   /*@access pgpDigParams @*/
   /*@access headerSprintfExtension @*/
  -/*@access sprintfTag @*/
  -/*@access sprintfToken @*/
  +/*@access headerTagTableEntry @*/
   
   /**
    * Convert tag data representation.
  @@ -1065,6 +1064,7 @@
   
       he->freeData = 0;
   
  +/*@-compmempass@*/
       _he->tag = RPMTAG_TRIGGERNAME;
       xx = headerGet(h, _he, 0);
       names.argv = _he->p.argv;
  @@ -1094,6 +1094,7 @@
       s.argv = _he->p.argv;
       numScripts = _he->c;
       if (!xx) goto exit;
  +/*@=compmempass@*/
   
       _he->tag = he->tag;
       _he->t = RPM_UINT32_TYPE;
  @@ -1117,6 +1118,7 @@
   		/*@innercontinue@*/ continue;
   
   	    item = xmalloc(strlen(names.argv[j]) + strlen(versions.argv[j]) + 20);
  +/*@-compmempass@*/
   	    if (flags.ui32p[j] & RPMSENSE_SENSEMASK) {
   		_he->p.ui32p = &flags.ui32p[j];
   		flagsStr = depflagsFormat(_he);
  @@ -1124,6 +1126,7 @@
   		flagsStr = _free(flagsStr);
   	    } else
   		strcpy(item, names.argv[j]);
  +/*@=compmempass@*/
   
   	    chptr = xrealloc(chptr, strlen(chptr) + strlen(item) + 5);
   	    if (*chptr != '\0') strcat(chptr, ", ");
  @@ -1166,6 +1169,7 @@
   
       he->freeData = 0;
   
  +/*@-compmempass@*/
       _he->tag = RPMTAG_TRIGGERINDEX;
       xx = headerGet(h, _he, 0);
       indices.ui32p = _he->p.ui32p;
  @@ -1182,6 +1186,7 @@
       s.argv = _he->p.argv;
       numScripts = _he->c;
       if (!xx) goto exit;
  +/*@=compmempass@*/
   
       he->t = RPM_STRING_ARRAY_TYPE;
       he->c = numScripts;
  @@ -1561,6 +1566,7 @@
   	return;		/* programmer error */
       }
   
  +/*@-compmempass@*/
       he->tag = tagN;
       xx = headerGet(h, he, 0);
       baseNames.argv = he->p.argv;
  @@ -1580,6 +1586,7 @@
       xx = headerGet(h, he, 0);
       dirIndexes.ui32p = he->p.ui32p;
       count = he->c;
  +/*@=compmempass@*/
   
       size = sizeof(*fileNames.argv) * count;
       for (i = 0; i < (unsigned)count; i++) {
  @@ -1712,14 +1719,14 @@
   	_rpmHeaderFormats = headerCompoundFormats;
   
       for (t = _rpmTagTable; t && t->name; t++) {
  +	/*@observer@*/
  +	static const char * tagtypes[] = {
  +		"", "char", "uint8", "uint16", "uint32", "uint64",
  +		"string", "octets", "argv", "i18nstring",
  +	};
   	uint32_t ttype;
   
   	if (rpmIsVerbose()) {
  -	    /*@observer@*/
  -	    static const char * tagtypes[] = {
  -		"", "char", "uint8", "uint16", "uint32", "uint64",
  -		"string", "octets", "argv", "i18nstring",
  -	    };
   	    fprintf(fp, "%-20s %6d", t->name + 7, t->val);
   	    ttype = t->type & RPM_MASK_TYPE;
   	    if (ttype < RPM_MIN_TYPE || ttype > RPM_MAX_TYPE)
  @@ -1832,7 +1839,7 @@
   
   /** \ingroup header
    */
  -typedef struct headerSprintfArgs_s * headerSprintfArgs;
  +typedef /*@abstract@*/ struct headerSprintfArgs_s * headerSprintfArgs;
   
   /** \ingroup header
    */
  @@ -1858,6 +1865,10 @@
       size_t i;
   };
   
  +/*@access sprintfTag @*/
  +/*@access sprintfToken @*/
  +/*@access headerSprintfArgs @*/
  +
   /**
    */
   static char escapedChar(const char ch)	/*@*/
  @@ -2547,7 +2558,6 @@
   /*@observer@*/ /*@null@*/
   static char * formatValue(headerSprintfArgs hsa, sprintfTag tag,
   		uint32_t element)
  -	/*@globals headerCompoundFormats @*/
   	/*@modifies hsa, tag @*/
   {
       HE_t vhe = memset(alloca(sizeof(*vhe)), 0, sizeof(*vhe));
  @@ -2693,7 +2703,6 @@
   /*@observer@*/
   static char * singleSprintf(headerSprintfArgs hsa, sprintfToken token,
   		uint32_t element)
  -	/*@globals headerCompoundFormats @*/
   	/*@modifies hsa, token @*/
   {
       char numbuf[64];	/* XXX big enuf for "Tag_0x01234567" */
  @@ -2981,10 +2990,10 @@
    
       hsa->h = headerLink(h);
       hsa->fmt = xstrdup(fmt);
  -/*@-dependenttrans@*/
  +/*@-assignexpose -dependenttrans@*/
       hsa->exts = exts;
       hsa->tags = tags;
  -/*@=dependenttrans@*/
  +/*@=assignexpose =dependenttrans@*/
       hsa->errmsg = NULL;
   
       if (parseFormat(hsa, hsa->fmt, &hsa->format, &hsa->numTokens, NULL, PARSER_BEGIN))
  @@ -3055,5 +3064,7 @@
   /*@=dependenttrans =observertrans @*/
       hsa->h = headerFree(hsa->h);
       hsa->fmt = _free(hsa->fmt);
  +/*@-retexpose@*/
       return hsa->val;
  +/*@=retexpose@*/
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header.c
  ============================================================================
  $ cvs diff -u -r1.138 -r1.139 header.c
  --- rpm/rpmdb/header.c	26 Nov 2007 06:52:52 -0000	1.138
  +++ rpm/rpmdb/header.c	26 Nov 2007 21:05:57 -0000	1.139
  @@ -10,8 +10,6 @@
   
   #include "system.h"
   
  -#define	__HEADER_PROTOTYPES__
  -
   #include <rpmio.h>
   #define	_RPMTAG_INTERNAL
   #include <header_internal.h>
  @@ -26,13 +24,12 @@
   
   /*@access Header @*/
   /*@access HeaderIterator @*/
  +/*@access headerSprintfExtension @*/
   /*@access headerTagTableEntry @*/
   
   /*@access entryInfo @*/
   /*@access indexEntry @*/
   
  -/*@access FD_t @*/		/* XXX void * arg headerRead/headerWrite */
  -
   /** \ingroup header
    */
   /*@-type@*/
  @@ -42,14 +39,14 @@
   };
   /*@=type@*/
   
  +#if 0
   /*@-type@*/
   /*@observer@*/ /*@unchecked@*/
  -#if 0
   static unsigned char sigh_magic[8] = {
   	0x8e, 0xad, 0xe8, 0x3e, 0x00, 0x00, 0x00, 0x00
   };
  -#endif
   /*@=type@*/
  +#endif
   
   /*@-type@*/
   /*@observer@*/ /*@unchecked@*/
  @@ -1748,7 +1745,9 @@
   	he->t = RPM_I18NSTRING_TYPE;
   	he->p.ptr = p.ptr;
   	he->c = langNum + 1;
  +/*@-compmempass@*/
   	return headerAddEntry(h, he);
  +/*@=compmempass@*/
       } else if (langNum >= entry->info.count) {
   	ghosts = langNum - entry->info.count;
   	
  @@ -2068,11 +2067,13 @@
   /*@=modfilesys@*/
   #endif
   
  +/*@-modfilesys@*/
       if (!((rc == 0 && he->freeData == 0 && he->p.ptr == NULL) ||
   	  (rc == 1 && he->freeData == 1 && he->p.ptr != NULL)))
       {
   fprintf(stderr, "==> %s(%u) %u %p[%u] free %u rc %d\n", name, (unsigned) he->tag, (unsigned) he->t, he->p.ptr, (unsigned) he->c, he->freeData, rc);
       }
  +/*@=modfilesys@*/
   
       return rc;
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/pkgio.c
  ============================================================================
  $ cvs diff -u -r1.61 -r1.62 pkgio.c
  --- rpm/rpmdb/pkgio.c	26 Nov 2007 06:15:34 -0000	1.61
  +++ rpm/rpmdb/pkgio.c	26 Nov 2007 21:05:57 -0000	1.62
  @@ -37,7 +37,6 @@
   /*@access pgpDig @*/
   /*@access pgpDigParams @*/
   /*@access Header @*/            /* XXX compared with NULL */
  -/*@access HV_t @*/
   /*@access entryInfo @*/
   /*@access indexEntry @*/
   /*@access FD_t @*/              /* XXX stealing digests */
  @@ -536,7 +535,9 @@
       l->signature_type = (unsigned short) ntohs(l->signature_type);
   
       if (memcmp(l->magic, lead_magic, sizeof(l->magic))) {
  +/*@+charint@*/
   	(void) snprintf(buf, sizeof(buf), _("lead magic: BAD, read %02x%02x%02x%02x"), l->magic[0], l->magic[1], l->magic[2], l->magic[3]);
  +/*@=charint@*/
   	rc = RPMRC_NOTFOUND;
   	goto exit;
       }
  @@ -708,7 +709,9 @@
   
   	if (memcmp(block, hmagic, nmagic)) {
   	    unsigned char * x = (unsigned char *)block;
  +/*@+charint@*/
   	    (void) snprintf(buf, sizeof(buf), _("sigh magic: BAD, read %02x%02x%02x%02x%02x%02x%02x%02x"), x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
  +/*@=charint@*/
   	    goto exit;
   	}
       }
  @@ -1271,7 +1274,9 @@
       (void) headerGetMagic(NULL, &b, &nb);
       if (memcmp(block, b, nb)) {
   	unsigned char * x = (unsigned char *) block;
  +/*@+charint@*/
   	(void) snprintf(buf, sizeof(buf), _("hdr magic: BAD, read %02x%02x%02x%02x%02x%02x%02x%02x"), x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
  +/*@=charint@*/
   	goto exit;
       }
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmdb.c
  ============================================================================
  $ cvs diff -u -r1.222 -r1.223 rpmdb.c
  --- rpm/rpmdb/rpmdb.c	26 Nov 2007 02:03:10 -0000	1.222
  +++ rpm/rpmdb/rpmdb.c	26 Nov 2007 21:05:57 -0000	1.223
  @@ -835,7 +835,8 @@
    * @return		header query string
    */
   static inline /*@null@*/ const char * queryHeader(Header h, const char * qfmt)
  -	/*@globals headerDefaultFormats @*/
  +	/*@globals headerCompoundFormats @*/
  +	/*@modifies h @*/
   {
       const char * errstr = "(unkown error)";
       const char * str;
  @@ -856,9 +857,9 @@
    * @return		0 on success
    */
   static int rpmdbExportInfo(/*@unused@*/ rpmdb db, Header h, int adding)
  -	/*@globals headerDefaultFormats, rpmGlobalMacroContext, h_errno,
  +	/*@globals headerCompoundFormats, rpmGlobalMacroContext, h_errno,
   		fileSystem, internalState @*/
  -	/*@modifies rpmGlobalMacroContext,
  +	/*@modifies h, rpmGlobalMacroContext,
   		fileSystem, internalState @*/
   {
       HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
  @@ -3136,7 +3137,9 @@
   	he->p.ui32p = &tid;
   	he->c = 1;
   	if (!headerIsEntry(h, he->tag))
  +/*@-compmempass@*/
   	   xx = headerPut(h, he, 0);
  +/*@=compmempass@*/
       }
   
       /* Add the package color if not present. */
  @@ -3146,14 +3149,20 @@
   	he->t = RPM_UINT32_TYPE;
   	he->p.ui32p = &hcolor;
   	he->c = 1;
  +/*@-compmempass@*/
   	xx = headerPut(h, he, 0);
  +/*@=compmempass@*/
       }
   
       he->tag = RPMTAG_DIRNAMES;
  +/*@-compmempass@*/
       xx = headerGet(h, he, 0);
  +/*@=compmempass@*/
       dirNames = he->p.argv;
       he->tag = RPMTAG_DIRINDEXES;
  +/*@-compmempass@*/
       xx = headerGet(h, he, 0);
  +/*@=compmempass@*/
       dirIndexes = he->p.ui32p;
   
       (void) blockSignals(db, &signalMask);
  @@ -3321,13 +3330,19 @@
   		/*@notreached@*/ /*@switchbreak@*/ break;
   	    case RPMTAG_REQUIRENAME:
   		he->tag = RPMTAG_REQUIREFLAGS;
  +/*@-compmempass@*/
   		xx = headerGet(h, he, 0);
  +/*@=compmempass@*/
   		requireFlags.ptr = he->p.ptr;
   		he->tag = RPMTAG_REQUIRENAME;
  +/*@-compmempass@*/
   		xx = headerGet(h, he, 0);
  +/*@=compmempass@*/
   		/*@switchbreak@*/ break;
   	    default:
  +/*@-compmempass@*/
   		xx = headerGet(h, he, 0);
  +/*@=compmempass@*/
   		/*@switchbreak@*/ break;
   	    }
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmtag.h
  ============================================================================
  $ cvs diff -u -r1.17 -r1.18 rpmtag.h
  --- rpm/rpmdb/rpmtag.h	26 Nov 2007 06:52:52 -0000	1.17
  +++ rpm/rpmdb/rpmtag.h	26 Nov 2007 21:05:57 -0000	1.18
  @@ -67,6 +67,7 @@
       uint16_t * ui16p;		/*!< RPM_UINT16_TYPE */
       uint32_t * ui32p;		/*!< RPM_UINT32_TYPE */
       uint64_t * ui64p;		/*!< RPM_UINT64_TYPE */
  +/*@relnull@*/
       const char * str;		/*!< RPM_STRING_TYPE */
       unsigned char * blob;	/*!< RPM_BIN_TYPE */
       const char ** argv;		/*!< RPM_STRING_ARRAY_TYPE */
  @@ -607,18 +608,14 @@
   /** \ingroup header
    * Supported default header tag output formats.
    */
  -/*@-redecl@*/
  -/*@observer@*/
  +/*@unchecked@*/ /*@observer@*/
   extern headerSprintfExtension headerDefaultFormats;
  -/*@=redecl@*/
   
   /** \ingroup header
    * Supported default header extension/tag output formats.
    */
  -/*@-redecl@*/
  -/*@observer@*/
  +/*@unchecked@*/ /*@observer@*/
   extern headerSprintfExtension headerCompoundFormats;
  -/*@=redecl@*/
   
   /**
    * Display list of tags that can be used in --queryformat.
  @@ -661,7 +658,6 @@
    * @return		1 on success, 0 on failure
    */
   int headerGet(Header h, HE_t he, unsigned int flags)
  -	/*@globals headerCompoundFormats @*/
   	/*@modifies he @*/;
   #define	HEADERGET_NOEXTENSION	(1 << 0) /*!< Extension search disabler. */
   
  @@ -705,6 +701,7 @@
    * @param hi		header tag container iterator
    * @return		NULL always
    */
  +/*@null@*/
   HeaderIterator headerFini(/*@only@*/ HeaderIterator hi)
   	/*@modifies hi @*/;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmwf.c
  ============================================================================
  $ cvs diff -u -r1.21 -r1.22 rpmwf.c
  --- rpm/rpmdb/rpmwf.c	24 Nov 2007 17:18:58 -0000	1.21
  +++ rpm/rpmdb/rpmwf.c	26 Nov 2007 21:05:57 -0000	1.22
  @@ -259,17 +259,23 @@
   static void rpmwfDumpItem(const char * item, unsigned char * b, size_t bsize)
   	/*@*/
   {
  +/*@+charint -modfilesys @*/
       fprintf(stderr, "\t%s:\t%p[%u]\t%02x%02x%02x%02x%02x%02x%02x%02x\n", item, b, (unsigned)bsize, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]);
  +/*@=charint =modfilesys @*/
   }
   
   static void rpmwfDump(rpmwf wf, const char * msg, const char * fn)
   	/*@*/
   {
  +/*@-modfilesys @*/
       fprintf(stderr, "==> %s(%s) wf %p\n", msg, fn, wf);
  +/*@=modfilesys @*/
  +/*@-noeffect@*/
       rpmwfDumpItem("     Lead", (unsigned char *)wf->l, wf->nl);
       rpmwfDumpItem("Signature", (unsigned char *)wf->s, wf->ns);
       rpmwfDumpItem("   Header", (unsigned char *)wf->h, wf->nh);
       rpmwfDumpItem("  Payload", (unsigned char *)wf->p, wf->np);
  +/*@=noeffect@*/
   }
   
   rpmwf rdRPM(const char * rpmfn)
  @@ -285,7 +291,9 @@
   	return NULL;
       }
   
  +/*@-noeffect@*/
   if (_rpmwf_debug) rpmwfDump(wf, "rdRPM", rpmfn);
  +/*@=noeffect@*/
   
       return wf;
   }
  @@ -308,7 +316,9 @@
   	rc = rpmwfPullXAR(wf, NULL);
       wf->xar = rpmxarFree(wf->xar);
   
  +/*@-noeffect@*/
   if (_rpmwf_debug) rpmwfDump(wf, "rdXAR", xarfn);
  +/*@=noeffect@*/
   
       return wf;
   }
  @@ -317,7 +327,9 @@
   {
       rpmRC rc;
   
  +/*@-noeffect@*/
   if (_rpmwf_debug) rpmwfDump(wf, "wrXAR", xarfn);
  +/*@=noeffect@*/
   
       wf->xar = rpmxarNew(xarfn, "w");
       if (wf->xar == NULL)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/signature.c
  ============================================================================
  $ cvs diff -u -r1.34 -r1.35 signature.c
  --- rpm/rpmdb/signature.c	24 Nov 2007 23:15:33 -0000	1.34
  +++ rpm/rpmdb/signature.c	26 Nov 2007 21:05:57 -0000	1.35
  @@ -451,7 +451,9 @@
   	he->t = RPM_UINT32_TYPE;
   	he->p.ui32p = &pktlen;
   	he->c = 1;
  +/*@-compmempass@*/
   	xx = headerPut(sigh, he, 0);
  +/*@=compmempass@*/
   	if (!xx)
   	    break;
   	ret = 0;
  @@ .
Received on Mon Nov 26 22:05:57 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.