Bug 89006

Summary: Manifest files do not work
Product: [Retired] Red Hat Linux Reporter: James Olin Oden <james.oden>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: high    
Version: 9CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-04-16 17:45:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 87937    

Description James Olin Oden 2003-04-16 14:26:52 UTC
Description of problem:
You cannot provide rpm 4.2-0.69 with a manifest file.  It will complain
that the manifest file cannot be installed.

Version-Release number of selected component (if applicable): 4.2-0.69


How reproducible: Always


Steps to Reproduce:
1.  Create a manifest file.  Here is an example one:
       
      /tmp/test-rpm-1.0-1.noarch.rpm

2.  Run rpm using the manifest file:

      rpm -Uvh --package /tmp/list

   
Actual results:

   error: /tmp/list cannot be installed   


Expected results:

I expected it to install the rpm (well upgrade it (-;).

Additional info:

I have tried various options and nothing seems to work;
Also, I tried simply adding a comment to the file to make it
even more conspicously not an rpm (of course I would imagine the
fact that it did not have an rpm header would have made it so, but
want do I know (-;).

Comment 1 Jeff Johnson 2003-04-16 17:45:58 UTC
Yup, return codes got broken during an audit.

The important change is in lib/packages.c:
 /*@=boundswrite@*/
        (void) fstat(Fileno(fd), &st);
        /* if fd points to a socket, pipe, etc, st.st_size is *always* zero */
-       if (S_ISREG(st.st_mode) && st.st_size < sizeof(*l))
+       if (S_ISREG(st.st_mode) && st.st_size < sizeof(*l)) {
+           rc = RPMRC_NOTFOUND;
            goto exit;
+       }

but I've checked a larger change into CVS.

Comment 2 James Olin Oden 2003-04-16 17:59:57 UTC
I know this is after your fix, but I just found out it works fine if there
is more than one package in the manifest.  If it has one, though, bad things 
occur.

Thanks for the fix.


Comment 3 Jeff Johnson 2003-04-16 18:06:22 UTC
Adding 96 bytes of white space probably works then too, the
check is that the file is at least the size of a lead (96b).