Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 560146 - net-fs/samba-4.3.0 - source4/kdc/db-glue.c requires HDB_ERR_WRONG_REALM which is unavailable in <app-crypt/heimdal-1.6.99
Summary: net-fs/samba-4.3.0 - source4/kdc/db-glue.c requires HDB_ERR_WRONG_REALM which...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
: 571886 572338 (view as bug list)
Depends on:
Blocks: CVE-2016-2119
  Show dependency tree
 
Reported: 2015-09-10 15:08 UTC by Denis Kaganovich
Modified: 2019-07-10 18:46 UTC (History)
12 users (show)

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


Attachments
forces systemwide /usr/include/krb5-types.h (heimdal-types.patch,496 bytes, patch)
2016-02-22 11:27 UTC, Christoph Polcin
Details | Diff
fix heimdal build dependencies (torture-compilefix.patch,397 bytes, patch)
2016-02-22 11:28 UTC, Christoph Polcin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Kaganovich 2015-09-10 15:08:40 UTC
Building net-fs/samba-4.3.0 with heimdal fails, as source4/kdc/db-glue.c use HDB_ERR_WRONG_REALM error code, added to external heimdal only in this year (authored on 10, abartlet committed on 31 Jul) in tree, versioned as 1.6.99: https://github.com/heimdal/heimdal/commit/078e6f5dd2fcf50b40ed32e9178afa7c708a19fa

Possible fix - to replace it by standard error code (this error code say entry is in another realm, IMHO to authentication logic similar to "NO"):
has_version '<app-crypt/heimdal-1.6.99' && sed -i -e 's:HDB_ERR_WRONG_REALM:HDB_ERR_NOENTRY:' source4/kdc/db-glue.c


Reproducible: Always
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2015-09-10 15:18:48 UTC
In case you don't want to do this kind of "hack", you can also try "system-mitkrb5" USE flag which enables compilation of samba against app-crypt/mit-krb5 instead of heimdal.
Comment 2 Georgy Kovtunov 2015-09-22 08:22:38 UTC
with the flag "system-mitkrb5" some binaries are not installed. Please see Bug 561052.
Comment 3 Timo Gurr (RETIRED) gentoo-dev 2015-09-24 15:19:03 UTC
(In reply to Denis Kaganovich from comment #0)
> Building net-fs/samba-4.3.0 with heimdal fails, as source4/kdc/db-glue.c use
> HDB_ERR_WRONG_REALM error code, added to external heimdal only in this year
> (authored on 10, abartlet committed on 31 Jul) in tree, versioned as 1.6.99:
> https://github.com/heimdal/heimdal/commit/
> 078e6f5dd2fcf50b40ed32e9178afa7c708a19fa
> 
> Possible fix - to replace it by standard error code (this error code say
> entry is in another realm, IMHO to authentication logic similar to "NO"):
> has_version '<app-crypt/heimdal-1.6.99' && sed -i -e
> 's:HDB_ERR_WRONG_REALM:HDB_ERR_NOENTRY:' source4/kdc/db-glue.c

I'm just a samba user, but I'm curious, did you manage to successfully build samba 4.3.0 in combination with heimdal-1.5.3 with your workaround/fix? Because I run into the following problem:

[...]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: default/source4/torture/rpc/backupkey_8.o: undefined reference to symbol 'hx509_cert_get_issuer_unique_id@@HEIMDAL_X509_1.2'
/usr/lib64/libhx509.so.5: error adding symbols: DSO missing from command line
[...]
Comment 4 Víctor Ostorga (RETIRED) gentoo-dev 2016-01-14 15:28:05 UTC
*** Bug 571886 has been marked as a duplicate of this bug. ***
Comment 5 Víctor Ostorga (RETIRED) gentoo-dev 2016-01-19 18:37:16 UTC
In Bug 572372 I have submitted a new ebuild for heimdal git , however samba spits more error when building against this new heimdal.
Comment 6 Víctor Ostorga (RETIRED) gentoo-dev 2016-01-19 19:16:00 UTC
*** Bug 572338 has been marked as a duplicate of this bug. ***
Comment 7 Christoph Polcin 2016-02-19 15:11:21 UTC
(In reply to Víctor Ostorga from comment #5)
> In Bug 572372 I have submitted a new ebuild for heimdal git , however samba
> spits more error when building against this new heimdal.

to get samba-4.3.4 compiled i need to delete source4/heimdal_build/krb5-types.h to force the installed types.

and add some dependencies to source4/torture/wscript_build

- heimdal_specific = dict(source='', deps='')
+ heimdal_specific = dict(source='', deps='hx509 hcrypto')
Comment 8 Christoph Polcin 2016-02-22 11:27:11 UTC
Created attachment 426178 [details, diff]
forces systemwide /usr/include/krb5-types.h
Comment 9 Christoph Polcin 2016-02-22 11:28:50 UTC
Created attachment 426180 [details, diff]
fix heimdal build dependencies
Comment 10 Christoph Polcin 2016-02-22 11:38:56 UTC
mkdir -p /etc/portage/patches/net-fs/samba-4.3.4

curl https://bugs.gentoo.org/attachment.cgi?id=426178 -o /etc/portage/patches/net-fs/samba-4.3.4/heimdal-types.patch

curl https://bugs.gentoo.org/attachment.cgi?id=426180 -o /etc/portage/patches/net-fs/samba-4.3.4/torture-compilefix.patch