RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/lib/ manifest.c query.c

From: Jeff Johnson <jbj@rpm5.org>
Date: Thu 11 Oct 2007 - 04:04:39 CEST
Message-Id: <20071011020439.07C9C348457@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:   11-Oct-2007 04:04:39
  Branch: HEAD                             Handle: 2007101103043800

  Modified files:
    rpm                     CHANGES
    rpm/lib                 manifest.c query.c

  Log:
    - fail empty and non-printable manifests.

  Summary:
    Revision    Changes     Path
    1.1663      +1  -0      rpm/CHANGES
    2.19        +2  -2      rpm/lib/manifest.c
    2.185       +5  -2      rpm/lib/query.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1662 -r1.1663 CHANGES
  --- rpm/CHANGES	8 Oct 2007 06:50:02 -0000	1.1662
  +++ rpm/CHANGES	11 Oct 2007 02:04:38 -0000	1.1663
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - jbj: fail empty and non-printable manifests.
       - jbj: headerGetExtension: handle lookup failure cases too.
       - jbj: headerGetExtension: include \0 when dup'ing string.
       - jbj: start converting rpmdb.c to use headerGetExtension instead.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/manifest.c
  ============================================================================
  $ cvs diff -u -r2.18 -r2.19 manifest.c
  --- rpm/lib/manifest.c	30 Sep 2007 20:38:25 -0000	2.18
  +++ rpm/lib/manifest.c	11 Oct 2007 02:04:38 -0000	2.19
  @@ -119,7 +119,7 @@
   
   	/* Insure that file contains only ASCII */
   	if (*s < 32) {
  -	    rpmrc = RPMRC_NOTFOUND;
  +	    rpmrc = RPMRC_FAIL;	/* XXX reject non-printable manifests. */
   	    goto exit;
   	}
   
  @@ -133,7 +133,7 @@
   	s = getStringBuf(sb);
   
       if (!(s && *s)) {
  -	rpmrc = RPMRC_NOTFOUND;
  +	rpmrc = RPMRC_FAIL;	/* XXX force manifests to have content. */
   	goto exit;
       }
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/query.c
  ============================================================================
  $ cvs diff -u -r2.184 -r2.185 query.c
  --- rpm/lib/query.c	30 Sep 2007 20:38:25 -0000	2.184
  +++ rpm/lib/query.c	11 Oct 2007 02:04:38 -0000	2.185
  @@ -398,9 +398,10 @@
           /*@modifies qva, rpmGlobalMacroContext, h_errno, internalState @*/
   {
       rpmgi gi = qva->qva_gi;
  +    rpmRC rpmrc = RPMRC_NOTFOUND;
       int ec = 0;
   
  -    while (rpmgiNext(gi) == RPMRC_OK) {
  +    while ((rpmrc = rpmgiNext(gi)) == RPMRC_OK) {
   	Header h;
   	int rc;
   
  @@ -413,6 +414,8 @@
   	if (qva->qva_source == RPMQV_DBOFFSET)
   	    break;
       }
  +    if (ec == 0 && rpmrc == RPMRC_FAIL)
  +	ec++;
       return ec;
   }
   
  @@ -804,7 +807,7 @@
   	qva->qva_gi = rpmgiNew(ts, RPMDBI_ARGLIST, NULL, 0);
   	qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, ftsOpts,
   		(giFlags | (RPMGI_NOGLOB|RPMGI_NOHEADER)));
  -	while (rpmgiNext(qva->qva_gi) == RPMRC_OK) {
  +	while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) {
   	    const char * path;
   	    path = rpmgiHdrPath(qva->qva_gi);
   assert(path != NULL);
  @@ .
Received on Thu Oct 11 04:04:39 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.