Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-28767

redhat-rpm-config: Auto-generated dependencies from rpmbuild are inconsistent for links to libraries

    • redhat-rpm-config-208-1.el9
    • None
    • None
    • rhel-sst-cs-software-management
    • ssg_core_services
    • 21
    • 23
    • None
    • No
    • CentOS Stream
    • None
    • Hide

      AC: No requirements are listed while running /usr/lib/rpm/rpmdeps --requires for 2 libraries generated by gcc:

      • gcc -shared -Wl,-soname,libechosounder2.so -o libechosounder2.so; ln -s libechosounder2.so libechosounder.so
      • gcc -shared -Wl,-soname,libdepth2.so -o libdepth2.so ; ln -s libdepth2.so libdepth.so

      Test: available

      Show
      AC: No requirements are listed while running /usr/lib/rpm/rpmdeps --requires for 2 libraries generated by gcc: gcc -shared -Wl,-soname,libechosounder2.so -o libechosounder2.so; ln -s libechosounder2.so libechosounder.so gcc -shared -Wl,-soname,libdepth2.so -o libdepth2.so ; ln -s libdepth2.so libdepth.so Test: available
    • Pass
    • Automated
    • Release Note Not Required
    • None

      What were you trying to do that didn't work?

      Auto-generated dependencies from rpmbuild are inconsistent for links to libraries. When there is a link to a library with a name that ends in .so (and doesn't have a version number suffix or similar), then most of the time, nothing is added to Requires, but in some cases, the "target" library is listed after all. More specifically, this generally happens when the actual library name contains the text "so".

      I seems to me that the intention is never to generate dependencies for these links, but the match logic for "magic" data gets confused due to an issue with a pattern in /usr/lib/rpm/fileattrs/libsymlink.attr. I suspect that the data is expanded twice, so that to escape special characters, you need \\ and not just \ - or in this case, a "literal dot" should be written as \\., because \. is actually interpreted as regexp symbol for "any character".

      Please provide the package NVR for which bug is seen: redhat-rpm-config-207-1.el9 (as well as various older releases.)

      How reproducible: Every time

      Steps to reproduce

      1. gcc -shared -Wl,-soname,libechosounder2.so -o libechosounder2.so; ln -s libechosounder2.so libechosounder.so
      2. gcc -shared -Wl,-soname,libdepth2.so -o libdepth2.so ; ln -s libdepth2.so libdepth.so
      3. Use /usr/lib/rpm/rpmdeps to list requirements for libechosounder.so and libdepth.so

      Expected results

      No requirements are listed

      Actual results

      $ /usr/lib/rpm/rpmdeps --requires --rpmfcdebug libechosounder.so libdepth.so
        0 libdepth.so     [none]
        1 libechosounder.so     [libsymlink]
          R libechosounder2.so()(64bit)
      libechosounder2.so()(64bit)

            [RHEL-28767] redhat-rpm-config: Auto-generated dependencies from rpmbuild are inconsistent for links to libraries

            Errata Tool added a comment -

            Since the problem described in this issue should be resolved in a recent advisory, it has been closed.

            For information on the advisory (redhat-rpm-config bug fix and enhancement update), and where to find the updated files, follow the link below.

            If the solution does not work for you, open a new bug report.
            https://access.redhat.com/errata/RHBA-2024:9246

            Errata Tool added a comment - Since the problem described in this issue should be resolved in a recent advisory, it has been closed. For information on the advisory (redhat-rpm-config bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2024:9246

            Michal Domonkos added a comment - - edited

            Indeed, this is a bug in the libsymlink.attr file (the backslashes need to be escaped twice), as you noted. The file is shipped with redhat-rpm-config so reassigning there.

            Michal Domonkos added a comment - - edited Indeed, this is a bug in the libsymlink.attr file (the backslashes need to be escaped twice), as you noted. The file is shipped with redhat-rpm-config so reassigning there.

            In the description, I wanted to change my first sentence to

            Auto-generated dependencies from rpmbuild are inconsistent for links to libraries.

            In other words, remove "is inconsistent for automatic dependency search on rpmbuild." And the text should also refer to backslashes instead of curly brackets, so as to speak.

            I'm not sure what you mean about the reproduction steps. The gcc commands are meant to create "dummy" libraries, just to have something to link to. The libraries themselves aren't expected to have any dependencies, but the symbolic links to the library files might. You could use other libs for testing, but the names matter. (That's the whole point.)

            Toralf Lund (Inactive) added a comment - In the description, I wanted to change my first sentence to Auto-generated dependencies from rpmbuild are inconsistent for links to libraries. In other words, remove "is inconsistent for automatic dependency search on rpmbuild." And the text should also refer to backslashes instead of curly brackets, so as to speak. I'm not sure what you mean about the reproduction steps. The gcc commands are meant to create "dummy" libraries, just to have something to link to. The libraries themselves aren't expected to have any dependencies, but the symbolic links to the library files might. You could use other libs for testing, but the names matter. (That's the whole point.)

            There is a web application firewall that prevents using certain strings. What do you want to use as the description?

            Would you please double-check the reproduction steps? The current gcc invocations do not result in any dependencies besides glibc, so I'm not sure if they are the ones you meant to include? Thanks.

            Florian Weimer added a comment - There is a web application firewall that prevents using certain strings. What do you want to use as the description? Would you please double-check the reproduction steps? The current gcc invocations do not result in any dependencies besides glibc, so I'm not sure if they are the ones you meant to include? Thanks.

            Toralf Lund (Inactive) added a comment - - edited

            Won't you let me edit the description?? Initial text got confusing because I left it half-way rewritten by mistake. Also,

            }} and not just {{

            is the result of some type of incorrect transformation. The "}}" should be two backslashes and "{{" just one.

            Toralf Lund (Inactive) added a comment - - edited Won't you let me edit the description?? Initial text got confusing because I left it half-way rewritten by mistake. Also, }} and not just {{ is the result of some type of incorrect transformation. The "}}" should be two backslashes and "{{" just one.

              mdomonko@redhat.com Michal Domonkos
              toralf.lund Toralf Lund (Inactive)
              packaging-team-maint packaging-team-maint
              Jan Blazek Jan Blazek
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: