Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 924684 - sys-apps/shadow-4.14.5 fails configure stage with readpassphrase missing
Summary: sys-apps/shadow-4.14.5 fails configure stage with readpassphrase missing
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-16 07:36 UTC by Rob MacKinnon
Modified: 2024-02-28 20:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild with versioned dep (shadow-4.14.5-r1.ebuild,8.10 KB, text/plain)
2024-02-16 07:36 UTC, Rob MacKinnon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rob MacKinnon 2024-02-16 07:36:58 UTC
Created attachment 885091 [details]
ebuild with versioned dep

While updating from the latest stage3, I hit a failure to configure the `shadow` package.  The failure message states there is no provider of `readpassphrase()`.

Build log:
```
buildhost /var/db/repos/gentoo/sys-apps/shadow # ebuild shadow-4.14.5.ebuild configure
>>> Existing ${T}/environment for 'shadow-4.14.5' will be sourced. Run
>>> 'clean' to start with a fresh environment.
>>> Checking shadow-4.14.5.tar.xz's mtime...
>>> WORKDIR is up-to-date, keeping...
>>> It appears that 'pretend' has already executed for 'shadow-4.14.5'; skipping.
>>> Remove '/var/tmp/portage/sys-apps/shadow-4.14.5/.pretended' to force pretend.
>>> It appears that 'setup' has already executed for 'shadow-4.14.5'; skipping.
>>> Remove '/var/tmp/portage/sys-apps/shadow-4.14.5/.setuped' to force setup.
>>> It appears that 'unpack' has already executed for 'shadow-4.14.5'; skipping.
>>> Remove '/var/tmp/portage/sys-apps/shadow-4.14.5/.unpacked' to force unpack.
>>> It appears that 'prepare' has already executed for 'shadow-4.14.5'; skipping.
>>> Remove '/var/tmp/portage/sys-apps/shadow-4.14.5/.prepared' to force prepare.
>>> Configuring source in /var/tmp/portage/sys-apps/shadow-4.14.5/work/shadow-4.14.5 ...
 * econf: updating shadow-4.14.5/config.sub with /usr/share/gnuconfig/config.sub
 * econf: updating shadow-4.14.5/config.guess with /usr/share/gnuconfig/config.guess
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --datarootdir=/usr/share --disable-dependency-tracking --disable-silent-rules --disable-static --docdir=/usr/share/doc/shadow-4.14.5 --htmldir=/usr/share/doc/shadow-4.14.5/html --with-sysroot=/ --libdir=/usr/lib64 --enable-lastlog --disable-account-tools-setuid --disable-static --with-btrfs --with-libbsd --without-group-name-max-length --without-tcb --with-bcrypt --with-yescrypt --enable-nls --enable-logind --with-acl --with-audit --without-libcrack --with-nscd --with-libpam --without-selinux --without-skey --without-su --with-attr
checking for a BSD-compatible install... /usr/lib/portage/python3.11/ebuild-helpers/xattr/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for x86_64-pc-linux-gnu-gcc option to enable C11 features... none needed
checking whether x86_64-pc-linux-gnu-gcc understands -c and -o together... yes
checking dependency style of x86_64-pc-linux-gnu-gcc... none
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for utime.h... yes
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking for x86_64-pc-linux-gnu-gcc... (cached) x86_64-pc-linux-gnu-gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... (cached) yes
checking for x86_64-pc-linux-gnu-gcc option to enable C11 features... (cached) none needed
checking whether x86_64-pc-linux-gnu-gcc understands -c and -o together... (cached) yes
checking dependency style of x86_64-pc-linux-gnu-gcc... (cached) none
checking whether ln -s works... yes
checking for bison... bison -y
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by x86_64-pc-linux-gnu-gcc... /usr/libexec/gcc/x86_64-pc-linux-gnu/ld
checking if the linker (/usr/libexec/gcc/x86_64-pc-linux-gnu/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/x86_64-pc-linux-gnu-nm -B
checking the name lister (/usr/bin/x86_64-pc-linux-gnu-nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/libexec/gcc/x86_64-pc-linux-gnu/ld option to reload object files... -r
checking for x86_64-pc-linux-gnu-file... no
checking for file... file
checking for x86_64-pc-linux-gnu-objdump... x86_64-pc-linux-gnu-objdump
checking how to recognize dependent libraries... pass_all
checking for x86_64-pc-linux-gnu-dlltool... x86_64-pc-linux-gnu-dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for x86_64-pc-linux-gnu-ar... x86_64-pc-linux-gnu-ar
checking for archiver @FILE support... @
checking for x86_64-pc-linux-gnu-strip... x86_64-pc-linux-gnu-strip
checking for x86_64-pc-linux-gnu-ranlib... x86_64-pc-linux-gnu-ranlib
checking command to parse /usr/bin/x86_64-pc-linux-gnu-nm -B output from x86_64-pc-linux-gnu-gcc object... ok
checking for sysroot... /
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for x86_64-pc-linux-gnu-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if x86_64-pc-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
checking for x86_64-pc-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
checking if x86_64-pc-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
checking if x86_64-pc-linux-gnu-gcc static flag -static works... yes
checking if x86_64-pc-linux-gnu-gcc supports -c -o file.o... yes
checking if x86_64-pc-linux-gnu-gcc supports -c -o file.o... (cached) yes
checking whether the x86_64-pc-linux-gnu-gcc linker (/usr/libexec/gcc/x86_64-pc-linux-gnu/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for x86_64-pc-linux-gnu-gcc options needed to detect all undeclared functions... (cached) none needed
checking for library containing dlopen... none required
checking for dlerror... yes
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dld_link in -ldld... no
checking for crypt.h... yes
checking for utmp.h... yes
checking for termio.h... yes
checking for sgtty.h... yes
checking for sys/ioctl.h... yes
checking for paths.h... yes
checking for sys/capability.h... yes
checking for sys/random.h... yes
checking for gshadow.h... yes
checking for lastlog.h... yes
checking for rpc/key_prot.h... no
checking for acl/libacl.h... yes
checking for attr/libattr.h... yes
checking for attr/error_context.h... yes
checking for shadow.h... yes
checking for arc4random_buf... yes
checking for futimes... yes
checking for getentropy... yes
checking for getrandom... yes
checking for getspnam... yes
checking for getusershell... yes
checking for initgroups... yes
checking for lckpwdf... yes
checking for lutimes... yes
checking for mempcpy... yes
checking for setgroups... yes
checking for updwtmp... yes
checking for updwtmpx... yes
checking for innetgr... yes
checking for getspnam_r... yes
checking for rpmatch... yes
checking for memset_explicit... no
checking for explicit_bzero... yes
checking for stpecpy... no
checking for stpeprintf... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for struct utmp.ut_type... yes
checking for struct utmp.ut_id... yes
checking for struct utmp.ut_name... yes
checking for struct utmp.ut_user... yes
checking for struct utmp.ut_host... yes
checking for struct utmp.ut_syslen... no
checking for struct utmp.ut_addr... yes
checking for struct utmp.ut_addr_v6... yes
checking for struct utmp.ut_time... yes
checking for struct utmp.ut_xtime... yes
checking for struct utmp.ut_tv... yes
checking how to run the C preprocessor... x86_64-pc-linux-gnu-gcc -E
checking for uid_t in sys/types.h... yes
checking type of array argument to getgroups... gid_t
checking whether utime accepts a null argument... yes
checking for putgrent... yes
checking for putpwent... yes
checking for putspent... yes
checking for sgetgrent... no
checking for sgetpwent... no
checking for sgetspent... yes
checking for setpgrp... yes
checking for secure_getenv... yes
checking for working shadow group support... yes
checking location of shared mail directory... /var/mail
checking location of user mail file... none
checking location of utmp... /var/run
checking location of faillog/lastlog/wtmp... /var/log
checking location of the passwd program... /usr/bin
checking for posix_spawn... yes
checking for posix_spawn... (cached) yes
checking for library containing gethostbyname... none required
checking for econf_readDirs in -leconf... no
checking size of uid_t... 4
checking size of gid_t... 4
checking for ll_host in struct lastlog... yes
checking for sd_session_get_remote_host in -lsystemd... yes
checking for crypt in -lcrypt... yes
checking for crypt in -lcrypt... (cached) yes
checking for library containing readpassphrase... no
configure: error: readpassphrase() is missing, either from libc or libbsd

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/sys-apps/shadow-4.14.5/work/shadow-4.14.5/config.log
 * ERROR: sys-apps/shadow-4.14.5::gentoo failed (configure phase):
 *   econf failed
 * 
 * Call stack:
 *               ebuild.sh, line  136:  Called src_configure
 *             environment, line 1786:  Called econf '--enable-lastlog' '--disable-account-tools-setuid' '--disable-static' '--with-btrfs' '--with-libbsd' '--without-group-name-max-length' '--without-tcb' '--with-bcrypt' '--with-yescrypt' '--enable-nls' '--enable-logind' '--with-acl' '--with-audit' '--without-libcrack' '--with-nscd' '--with-libpam' '--without-selinux' '--without-skey' '--without-su' '--with-attr'
 *        phase-helpers.sh, line  732:  Called __helpers_die 'econf failed'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *   		die "$@"
 * 
 * If you need support, post the output of `emerge --info '=sys-apps/shadow-4.14.5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-apps/shadow-4.14.5::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-apps/shadow-4.14.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/shadow-4.14.5/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-apps/shadow-4.14.5/work/shadow-4.14.5'
 * S: '/var/tmp/portage/sys-apps/shadow-4.14.5/work/shadow-4.14.5'
```

After some digging I discovered that the issue stems from an unset minimum package version of `dev-libs/libbsd` in the ebuild.  The version that came the my downloaded stage3 is v0.9.1, but was not at a require version to provide `readpassphrase()`, and at the writing of this bug report v0.11.8 is available via portage.  

The fix being to install `>=dev-libs/libbsd-0.11.8`.  I'm unsure at what version of libbsd `readpassphrase` was added, but at this version everything goes great. Attached is an updated ebuild with a versioned `dev-libs/libbsd`. 

Note: there is a comment in the ebuild along the lines to revisit libbsd dep once glibc has reached a stable v2.28.  I would say we have exceeded that and removed the comment in my submitted ebuild.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-16 11:37:42 UTC
We should fix the dep for correctness, of course, but...

>After some digging I discovered that the issue stems from an unset minimum >package version of `dev-libs/libbsd` in the ebuild.  The version that came the >my downloaded stage3 is v0.9.1, but was not at a require version to provide >`readpassphrase()`, and at the writing of this bug report v0.11.8 is available >via portage.  

... what stage3 was this? Can you give the URL you got it from & its full filename? Any remotely modern stage3 should have a newer version already.
Comment 2 Rob MacKinnon 2024-02-17 08:52:43 UTC
Pulled from: https://distfiles.gentoo.org/releases/amd64/autobuilds/current-stage3-amd64-nomultilib-systemd/stage3-amd64-nomultilib-systemd-20231210T170356Z.tar.xz

Agreed. I sorta figure that would be the case and thought it was weird.
Comment 3 Mike Gilbert gentoo-dev 2024-02-18 05:38:45 UTC
We should drop the dev-libs/libbsd dep and pass --without-libbsd to configure. That should cause it to use bundled code for any needed functions.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-18 07:06:15 UTC
(In reply to Rob MacKinnon from comment #2)
> Pulled from:
> https://distfiles.gentoo.org/releases/amd64/autobuilds/current-stage3-amd64-
> nomultilib-systemd/stage3-amd64-nomultilib-systemd-20231210T170356Z.tar.xz
> 
> Agreed. I sorta figure that would be the case and thought it was weird.

Are you sure that's the one you used? libbsd-0.9.1 was dropped from ::gentoo in 8cf8369dccd5dfbca05b5cbf6286e95552426552 (December 2019).

I just downloaded that tarball you linked and it doesn't contain libbsd.
Comment 5 Rob MacKinnon 2024-02-21 05:20:29 UTC
Turns out the path I was expanding too was dirty, and contained a few things (libbsd being one of them). A confirmed clean install with the link stage3 does indeed build clean.  Though I would like to throw in a case to leave the dep in there as samba, elfutils, and a handful of other libs depend on it. Seems silly to not use the system library and rely on the built-in. Though a use flag of 'system-libbsd' might fit the bill better and allow the user to make a more informed decision.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-21 05:29:39 UTC
Yeah, I tend to agree. I'd rather use libbsd than the bundled versions, I think.
Comment 7 Mike Gilbert gentoo-dev 2024-02-28 15:07:32 UTC
(In reply to Sam James from comment #6)
> Yeah, I tend to agree. I'd rather use libbsd than the bundled versions, I
> think.

We are talking about a single function to read a passphrase from a file descriptor. Pulling in an external library for this seems silly to me.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-28 15:17:13 UTC
For some reason, I was convinced there were other misc. functions it wanted, but nope, you're right - it's just readpassphrase and formerly strlcpy.

"bundled" is fine then ofc
Comment 9 Rob MacKinnon 2024-02-28 20:36:21 UTC
@Mike correct the reference in libbsd (which is forked locally to the package) is for the single function. But if I already have libbsd installed, shouldn't the package make use of the system shared library over burning in a function from the package, or at least giving the user the option to side that way?
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-28 20:49:58 UTC
(In reply to Rob MacKinnon from comment #9)
> @Mike correct the reference in libbsd (which is forked locally to the
> package) is for the single function. But if I already have libbsd installed,
> shouldn't the package make use of the system shared library over burning in
> a function from the package, or at least giving the user the option to side
> that way?

shadow is a @system package, and requiring libbsd means you have libmd as well, which feels a shame for something so tiny with a single function.

The fact that libbsd also has an implementation of this should be seen as kind of tangential.