This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 1293 - Bug in genhdlist with non-RPM files
Bug in genhdlist with non-RPM files
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: basesystem (Show other bugs)
5.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-02-23 06:37 EST by mok
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-02-23 10:38:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description mok 1999-02-23 06:37:29 EST
There is a bug in the genhdlist program, that makes it fail
if it meets a non-RPM file, thereby generating an empty
hdlist file. This is a problem because many ftp mirrors seem
to keep ls-lR files in every directory. Here is a patch to
fix it:

*** genhdlist.c.orig    Fri Nov 27 12:08:13 1998
--- genhdlist.c Fri Nov 27 12:08:20 1998
***************
*** 12,23 ****
--- 12,26 ----

  #define FILENAME_TAG 1000000

+ /* Not used apparently...
+
  int tags[] =  { RPMTAG_NAME, RPMTAG_VERSION,
RPMTAG_RELEASE,
RPMTAG_SERIAL,
                RPMTAG_FILENAMES, RPMTAG_FILESIZES,
RPMTAG_GROUP,
                RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME,
RPMTAG_REQUIREVERSION,
                RPMTAG_DESCRIPTION, RPMTAG_SUMMARY,
RPMTAG_PROVIDES,
                RPMTAG_SIZE, RPMTAG_OBSOLETES };
  int numTags = sizeof(tags) / sizeof(int);
+ */

  int main(int argc, char ** argv) {
      char buf[300];
***************
*** 26,34 ****
--- 29,39 ----
      struct dirent * ent;
      int fd, rc, isSource;
      Header h;
+     /* not used
      int count, type;
      int i;
      void * ptr;
+     */

      if (argc != 2) {
        fprintf(stderr, "usage: genhdlist <dir>\n");
***************
*** 74,79 ****
--- 79,85 ----

            rc = rpmReadPackageHeader(fd, &h, &isSource,
NULL, NULL);

+           if (!rc) {
            headerRemoveEntry(h, RPMTAG_POSTIN);
            headerRemoveEntry(h, RPMTAG_POSTUN);
            headerRemoveEntry(h, RPMTAG_PREIN);
***************
*** 110,115 ****
--- 116,122 ----
            headerWrite(outfd, h, HEADER_MAGIC_YES);
            headerFree(h);
            close(fd);
+           }
        }

        errno = 0;
Comment 1 Bill Nottingham 1999-02-23 10:38:59 EST
this has been fixed, as of some point after RHL 5.2 was released.

Note You need to log in before you can comment on or make changes to this bug.