Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 421463

Summary: net-nds/openldap[gnutls] fails to build with net-libs/gnutls-3
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: New packagesAssignee: Gentoo LDAP project <ldap-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: andriy155, ansla80, anton.kochkov, aoyu93, as.gentoo, cctsurf, cJ-gentoo, cornicx, da5id2001, Dan.Johansson, dschridde+gentoobugs, eugene.shalygin, eXt, follettoonip, gabemarcano, gentoo, grozin, harrisl, ibuyandtrade0+bugs.gentoo.org, jkomar, jospezial, jwbraun, kamensky.fb, kkrizka, kripton, manschwetus, mark+gentoobugs, Martin.vGagern, nixphoeni, optiluca, order+gentoo, pageexec, patrick, patriellabork, pokstar, polidevk.polidevk, qbasicer, rose, rzubaly, silvio.gerli, skrattaren, thev00d00, Timewulf, travisghansen, tsdh, u.plate, undrwater, vityokster
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://tinderboxlogs.s3.amazonaws.com/tbamd64.excelsior.flameeyes.eu/net-nds%3Aopenldap-2.4.31-r1%3A20120616-174623.html
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 421391    
Attachments: patch to support gnutls-3
ebuild including provided patch to support gnutls-3
update after reading manpages
Another patch without return in case no CA

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2012-06-16 17:53:46 UTC
Portage 2.2.0_alpha110 (default/linux/amd64/10.0, gcc-4.7.1, glibc-2.15-r2, 3.4.2-hardened x86_64)
=================================================================
System uname: Linux-3.4.2-hardened-x86_64-AMD_Opteron-TM-_Processor_6272-with-gentoo-2.1
Timestamp of tree: Sat, 16 Jun 2012 07:30:01 +0000
app-shells/bash:          4.2_p29
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3-r1
dev-util/cmake:           2.8.8-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.10.3
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.5, 1.12.1
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2, 4.7.1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo
Installed sets: 
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -ggdb -march=native -ftracer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -ggdb -march=native -ftracer"
DISTDIR="/var/cache/portage/distfiles"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict test test-fail-continue unknown-features-warn unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j24"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/tmp"
PORTDIR="/var/cache/portage/tree"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowex acl amd64 berkdb bzip2 cli cracklib crypt cups cxx dri ffmpeg fortran gdbm gpm iconv ipv6 mmx modules mudflap multilib ncurses nls nptl openmp pam pcre pppd qt3support readline session sse sse2 sse3 sse4 ssl ssse3 tcpd unicode vhosts xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 jruby ruby19 ree18" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Martin Samek 2012-06-22 08:45:12 UTC
I can confirm this also. It fails with net-libs/gnutls-2.12.18 too.

tls_g.c:46:20: fatal error: gcrypt.h: No such file or directory
compilation terminated.
Comment 2 Olaf Leidinger 2012-10-19 08:53:06 UTC
@Martin: No, I think your problem is a different one. Have a look at my bug #438890
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-11-02 02:48:39 UTC
*** Bug 440748 has been marked as a duplicate of this bug. ***
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-11-02 05:07:48 UTC
*** Bug 440902 has been marked as a duplicate of this bug. ***
Comment 5 Lee Trager 2012-11-02 06:52:05 UTC
Yeah I'm getting the same thing.
Comment 6 Travis Hansen 2012-11-03 20:16:22 UTC
I filed an issue upstream.

http://www.openldap.org/its/index.cgi/Incoming?id=7430
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-11-04 16:10:04 UTC
*** Bug 441606 has been marked as a duplicate of this bug. ***
Comment 8 Juergen Rose 2012-11-06 12:08:29 UTC
As a workaround, to avoid a broken openldap, I emerged openldap with USE=-gnutls.
Comment 9 Nikolaj Šujskij 2012-11-09 08:40:03 UTC
(In reply to comment #6)
> I filed an issue upstream.
> 
> http://www.openldap.org/its/index.cgi/Incoming?id=7430

Those guys are strange: http://www.openldap.org/its/index.cgi/Incoming?id=6359
Comment 10 Rafał Mużyło 2012-11-11 09:51:23 UTC
(In reply to comment #9)
> (In reply to comment #6)
> > I filed an issue upstream.
> > 
> > http://www.openldap.org/its/index.cgi/Incoming?id=7430
> 
> Those guys are strange:
> http://www.openldap.org/its/index.cgi/Incoming?id=6359

Perhaps they need to be notified about the upstream status of gnutls 2.x ?
Sometimes even such projects aren't good at tracking the other projects (just note how long it took wine to use udisks instead of hal).
Comment 11 Ikujam 2012-11-17 19:26:45 UTC
Created attachment 329746 [details, diff]
patch to support gnutls-3

#if on GNUTLS_VERSION_MAJOR in libraries/libldap/tls_g.c

Source : 
https://www.gnu.org/software/gnutls/manual/html_node/Upgrading-from-previous-versions.html
Comment 12 Ikujam 2012-11-17 19:27:53 UTC
Created attachment 329748 [details]
ebuild including provided patch to support gnutls-3
Comment 13 Brandon Penglase 2012-11-17 20:03:03 UTC
This works for me, against GnuTLS-3.1.4. Thanks!
Comment 14 Rafał Mużyło 2012-11-17 23:00:11 UTC
(In reply to comment #11)
> Created attachment 329746 [details, diff] [details, diff]
> patch to support gnutls-3
> 
> #if on GNUTLS_VERSION_MAJOR in libraries/libldap/tls_g.c
> 
> Source : 
> https://www.gnu.org/software/gnutls/manual/html_node/Upgrading-from-previous-
> versions.html

Did you bother to read the manpages for these two functions ?
This is not gtk2 -> gtk3 porting - the arguments have a significantly different meaning.
Comment 15 Ikujam 2012-11-18 00:42:04 UTC
Created attachment 329782 [details, diff]
update after reading manpages

Ouch, indeed, just checked for the "new" parameter called flags and assumed everything else business as usual, sorry for that...

so here is a new patch, after reading man pages, sources, and this post : 

http://comments.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/5066

It does compile fine here, but I don't have an environment set up right now to test and validate this - so this still needs testings.
 

Sorry again and thanks for banging my head ~
Comment 16 Brandon Penglase 2012-11-18 01:56:44 UTC
Patch reapplied and compiles fine here. Both Server and Client (running LDAPS) seems to be working fine, thus far.
Comment 17 Fabio Coatti 2012-11-27 10:53:32 UTC
Confirmed here, latest patch compiles fine and (it seems :D) works fine.
Comment 18 Geoff Madden 2012-11-28 12:38:10 UTC
can confirm that the patch works for 2.4.33
Comment 19 Rafał Mużyło 2012-11-28 16:41:47 UTC
Do any of 'the patch works' come from somebody, who looked at that block of code, understood what it does and ran a test that would trigger the required conditions ?
Cause "it builds" is nearly meaningless in this case.
Comment 20 Kamen Dokov 2012-12-02 22:06:12 UTC
net-nds/openldap-2.4.33-r1 still fails with:

./.libs/libldap.so: undefined reference to `gnutls_certificate_get_x509_cas'     │* kde-misc/krunner-kopete-contacts
collect2: ld returned 1 exit status                                              │     Available versions:  (4) (~)0.4
make[2]: *** [apitest] Error 1    

:(
Comment 21 Christophe Philemotte 2012-12-11 14:57:44 UTC
the patch works for 2.4.33-r1
Comment 22 Rafał Mużyło 2012-12-11 20:01:53 UTC
(In reply to comment #21)
> the patch works for 2.4.33-r1

:roll: Once again, what's your definition of "works" ? The proper or the meaningless one ?
Comment 23 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2012-12-24 04:46:31 UTC
*** Bug 448336 has been marked as a duplicate of this bug. ***
Comment 24 Jeroen Roovers (RETIRED) gentoo-dev 2012-12-24 15:54:25 UTC
*** Bug 448286 has been marked as a duplicate of this bug. ***
Comment 25 Petr Pisar 2012-12-31 22:01:34 UTC
Created attachment 333892 [details, diff]
Another patch without return in case no CA

Patch in attachment #329782 [details, diff] is not good because it will return if no issuer can be found. That's wrong.

Meaning of building the certificate array in order of issuers is to send this certificate chain by server when exchanging identity. This is to raise chance client will recognize at least one CA and find trust chain to the end-point certificate. 

If server does have complete chain to CA root, this is no tragedy, server will send just the part of chain he knows about.

Attached patch fixes this issue.

Also attached patch updates `max' variable for whatever reason the GnutTLS-2 branch does.

Notice for the maintainer: I did not test the patch.
Comment 26 Petr Pisar 2012-12-31 22:02:36 UTC
(In reply to comment #25)
> If server does have complete chain to CA root, this is no tragedy, server
> will send just the part of chain he knows about.
s/does have/does not have/
Comment 27 Rafał Mużyło 2013-01-12 23:22:30 UTC
*** Bug 451560 has been marked as a duplicate of this bug. ***
Comment 28 walt 2013-01-13 23:23:02 UTC
Using -gnutls allows openldap to install without errors.  Anybody know if ssl is an adequate substitute for gnutls in openldap?
Comment 29 Patrick Lauer gentoo-dev 2013-01-14 02:46:54 UTC
+  14 Jan 2013; Patrick Lauer <patrick@gentoo.org> openldap-2.3.43-r1.ebuild,
+  openldap-2.3.43-r2.ebuild, openldap-2.4.19-r1.ebuild, openldap-2.4.21.ebuild,
+  openldap-2.4.23.ebuild, openldap-2.4.24.ebuild, openldap-2.4.25-r1.ebuild,
+  openldap-2.4.25.ebuild, openldap-2.4.28-r1.ebuild, openldap-2.4.28.ebuild,
+  openldap-2.4.30.ebuild, openldap-2.4.31-r1.ebuild, openldap-2.4.31.ebuild,
+  openldap-2.4.32.ebuild, openldap-2.4.33-r1.ebuild, openldap-2.4.33.ebuild:
+  Fixing gnutls dep #421463

This at least avoids build failures. I don't have an opinion on the provided patches, so I've ignored them for now.
Comment 30 Jeroen Roovers (RETIRED) gentoo-dev 2013-02-07 02:58:38 UTC
*** Bug 455954 has been marked as a duplicate of this bug. ***
Comment 31 jospezial 2013-02-07 15:08:26 UTC
As my bug is a duplicate of this, I post my problem here:

jlgentoo ~ # emerge -va1 openldap

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     UD ] net-libs/gnutls-2.12.23 [3.1.7] USE="cxx lzo%* nettle%* nls zlib -bindist% -doc -examples -guile -pkcs11 -static-libs {-test} (-dane%)" LINGUAS="(-cs%) (-de%*) (-en%) (-fi%) (-fr%) (-it%) (-ms%) (-nl%) (-pl%) (-sv%) (-uk%) (-vi%) (-zh_CN%)" 7,109 kB
[ebuild  N     ] net-nds/openldap-2.4.33-r1  USE="berkdb crypt gnutls icu ipv6 samba ssl syslog tcpd -cxx -debug -experimental -iodbc -kerberos -minimal -odbc -overlays -perl -sasl (-selinux) -slp -smbkrb5passwd" 5,348 kB

Total: 2 packages (1 downgrade, 1 new), Size of downloads: 12,457 kB

!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:

net-libs/gnutls:0

  (net-libs/gnutls-3.1.7::gentoo, installed) pulled in by
    >=net-libs/gnutls-3.1 required by (net-ftp/filezilla-3.6.0.2::gentoo, installed)

  (net-libs/gnutls-2.12.23::gentoo, ebuild scheduled for merge) pulled in by
    <net-libs/gnutls-3 required by (net-nds/openldap-2.4.33-r1::gentoo, ebuild scheduled for merge)



I came to this problem when I wanted to emerge libreoffice-4.0.0.2 which depends on ldap.

Can gnutls be slotted?
Comment 32 James L. Hammons 2013-02-20 04:04:07 UTC
I'm running into the same problem as jospezial in post #31; why does libreoffice need ldap and why doesn't it have a use flag to tell it not to use it?

At this point, I'd say it's probably easier to set -gnutls on openldap and forget about it--at least for users like me who don't need or use ldap.
Comment 33 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-02-20 17:10:44 UTC
FYI, I'm testing Petr's patch, just setting up the SSL infrastructure to give it a good go.
Comment 34 Ian Whyman (thev00d00) (RETIRED) gentoo-dev 2013-03-29 10:41:51 UTC
(In reply to comment #33)
> FYI, I'm testing Petr's patch, just setting up the SSL infrastructure to
> give it a good go.

How is the patch testing going?
Comment 35 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-04-16 03:58:46 UTC
InCVS.