Bug 1984692 - gpgme: FTBFS due to incorrect use of closefrom (glibc 2.34 related)
Summary: gpgme: FTBFS due to incorrect use of closefrom (glibc 2.34 related)
Keywords:
Status: CLOSED DUPLICATE of bug 1938732
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: gpgme
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Jiri Kucera
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On: 1984691
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-21 22:01 UTC by Florian Weimer
Modified: 2021-07-27 05:19 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1984691
Environment:
Last Closed: 2021-07-27 05:19:08 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

Description Florian Weimer 2021-07-21 22:01:39 UTC
+++ This bug was initially created as a clone of Bug #1984691 +++

gpgme has this code:

#ifdef HAVE_CLOSEFROM
          {
            fd = -1;
            for (i = 0; fd_list[i].fd != -1; i++)
              if (fd_list[i].fd > fd)
                fd = fd_list[i].fd;
            fd++;
#if defined(__sun) || defined(__FreeBSD__)
            closefrom (fd);
            max_fds = fd;
#else /*!__sun */
            while ((i = closefrom (fd)) && errno == EINTR)
              ;
            if (!i || errno == EBADF)
              max_fds = fd;
#endif /*!__sun*/
          }
#endif /*HAVE_CLOSEFROM*/

closefrom is available in glibc 2.34, but it follows the Solaris and FreeBSD convention, so the return type of the function is void, and this code fails to compile:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../conf -I/usr/include/libassuan2 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wno-format-y2k -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-zero-length -Wno-format-truncation -Wno-sizeof-pointer-div -c posix-io.c  -fPIC -DPIC -o .libs/posix-io.o
posix-io.c: In function '_gpgme_io_spawn':
posix-io.c:577:23: error: void value not ignored as it ought to be
  577 |             while ((i = closefrom (fd)) && errno == EINTR)
      |                       ^

Comment 1 Florian Weimer 2021-07-27 05:19:08 UTC
This was fixed as part of bug 1938732.

*** This bug has been marked as a duplicate of bug 1938732 ***


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