RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/ rpmqv.c

From: Jeff Johnson <n3npq@mac.com>
Date: Tue 05 Aug 2008 - 21:51:03 CEST
Message-id: <F28A2EF3-FDD2-47E0-8962-A70CED3232BC@mac.com>
Sorry.

I've always been embarassed by rpmioSlurp(), never quite
known where to hide the silly (but useful) method. I
had hoped to quietly nuke the sucker, but its usage
has spread like kudzu.

And my vetting is usually
     grep rpmioSlurp */*.c
which invariably misses rpmqv.c.

BTW, rpmio/rpmku.c is about to be born, rpmnsProbeSignature()
is likely to end up there soonishly.

73 de Jeff


On Aug 5, 2008, at 3:00 PM, Ralf S. Engelschall wrote:

>   RPM Package Manager, CVS Repository
>   http://rpm5.org/cvs/
>    
> ______________________________________________________________________ 
> ______
>
>   Server: rpm5.org                         Name:   Ralf S. Engelschall
>   Root:   /v/rpm/cvs                       Email:  rse@rpm5.org
>   Module: rpm                              Date:   05-Aug-2008  
> 21:00:27
>   Branch: HEAD                             Handle: 2008080519002700
>
>   Modified files:
>     rpm                     rpmqv.c
>
>   Log:
>     fix RPM_VENDOR_OPENPKG wrapped code after recent rpmioSlurp to
>     rpmiobSlurp change
>
>   Summary:
>     Revision    Changes     Path
>     1.151       +13 -10     rpm/rpmqv.c
>    
> ______________________________________________________________________ 
> ______
>
>   patch -p0 <<'@@ .'
>   Index: rpm/rpmqv.c
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r1.150 -r1.151 rpmqv.c
>   --- rpm/rpmqv.c	31 Jul 2008 16:58:53 -0000	1.150
>   +++ rpm/rpmqv.c	5 Aug 2008 19:00:27 -0000	1.151
>   @@ -14,6 +14,7 @@
>    #endif
>
>    #if defined(RPM_VENDOR_OPENPKG) /* integrity-checking */
>   +#define _RPMIOB_INTERNAL /* XXX rpmiobSlurp */
>    #include "rpmio_internal.h"
>    #endif
>
>   @@ -220,6 +221,8 @@
>        char *pkey_fn = NULL;
>        char *spec = NULL;
>        char *proc = NULL;
>   +    rpmiob spec_iob = NULL;
>   +    rpmiob proc_iob = NULL;
>        const char *result = NULL;
>        const char *error = NULL;
>        int xx;
>   @@ -265,22 +268,22 @@
>        }
>
>        /* load integrity configuration specification file */
>   -    spec = NULL;
>   -	xx = rpmioSlurp(spec_fn, (uint8_t **)&spec, NULL);
>   -	if (!(xx == 0 && spec != NULL)) {
>   +    xx = rpmiobSlurp(spec_fn, &spec_iob);
>   +    if (!(xx == 0 && spec_iob != NULL)) {
>            integrity_check_message("ERROR: Unable to load Integrity  
> Configuration Specification file.\n"
>                "rpm: HINT: Check file \"%s\".\n", spec_fn);
>            goto failure;
>        }
>   +    spec = rpmiobStr(spec_iob);
>
>        /* load integrity validation processor file */
>   -    proc = NULL;
>   -	xx = rpmioSlurp(proc_fn, (uint8_t **)&proc, NULL);
>   -	if (!(xx == 0 && proc != NULL)) {
>   +    xx = rpmiobSlurp(proc_fn, &proc_iob);
>   +    if (!(xx == 0 && proc_iob != NULL)) {
>            integrity_check_message("ERROR: Unable to load Integrity  
> Validation Processor file.\n"
>                "rpm: HINT: Check file \"%s\".\n", proc_fn);
>            goto failure;
>        }
>   +    proc = rpmiobStr(proc_iob);
>
>        /* provision program name and mode */
>        if (progname == NULL || progname[0] == '\0')
>   @@ -354,10 +357,10 @@
>            rpmluaFree(lua);
>        if (ts != NULL)
>            ts = rpmtsFree(ts);
>   -    if (spec != NULL)
>   -        spec = _free(spec);
>   -    if (proc != NULL)
>   -        proc = _free(proc);
>   +    if (spec_iob != NULL)
>   +        spec_iob = rpmiobFree(spec_iob);
>   +    if (proc_iob != NULL)
>   +        proc_iob = rpmiobFree(proc_iob);
>
>        /* final result handling */
>        if (rc != INTEGRITY_OK) {
>   @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-cvs@rpm5.org
Received on Tue Aug 5 21:52:23 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.