<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>35667</bug_id>
          
          <creation_ts>2018-11-29 10:08:26 +0300</creation_ts>
          <short_desc>FreeIPA installation fails</short_desc>
          <delta_ts>2018-11-29 13:21:50 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>libkrb5</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Stanislav Levin">slev</reporter>
          <assigned_to name="Ivan A. Melnikov">iv</assigned_to>
          <cc>iv</cc>
    
    <cc>shaba</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>176165</commentid>
    <comment_count>0</comment_count>
    <who name="Stanislav Levin">slev</who>
    <bug_when>2018-11-29 10:08:26 +0300</bug_when>
    <thetext>Symptom: 389-ds crashes on FreeIPA installation:
```
Done configuring DNS key synchronization service (ipa-dnskeysyncd).
Restarting ipa-dnskeysyncd
Restarting named
Named service failed to start (CalledProcessError(Command [&apos;/sbin/systemctl&apos;, &apos;restart&apos;, &apos;bind.service&apos;] returned non-zero exit status 1: &apos;Job for bind.service failed because the control process exited with error code.\nSee &quot;systemctl status bind.service&quot; and &quot;journalctl -xe&quot; for details.\n&apos;))
named service failed to start
```

Name debug log:
```
29-Nov-2018 09:50:34.015 trying to establish LDAP connection to ldapi://%2fvar%2frun%2fslapd-IPASL-IPATEST.socket
29-Nov-2018 09:50:34.015 Using default keytab file name: FILE:/etc/named.keytab
29-Nov-2018 09:50:34.015 Credentials are not present in cache (Matching credential not found)
29-Nov-2018 09:50:34.015 Attempting to acquire new Kerberos credentials
Missing separate debuginfo for /usr/lib64/krb5/plugins/libkrb5/sssd_krb5_locator_plugin.so
Try to install the hash file /usr/lib/debug/.build-id/70/8f27e90579e8a1bb44d9ada32e82f61438f694.debug
29-Nov-2018 09:50:34.047 trying interactive bind using &apos;GSSAPI&apos; mechanism
29-Nov-2018 09:50:34.047 doing interactive bind
29-Nov-2018 09:50:34.047 got request for SASL_CB_USER
k5_mutex_lock: Received error 22 (Invalid argument)
named: ../../../include/k5-thread.h:376: k5_mutex_lock: Assertion `r == 0&apos; failed.

Thread 2 &quot;isc-worker0000&quot; received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff4e53700 (LWP 14531)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
```

bt
```
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff60ae371 in __GI_abort () at abort.c:79
#2  0x00007ffff60a5b1a in __assert_fail_base (
    fmt=0x7ffff61f8e88 &quot;%s%s%s:%u: %s%sAssertion `%s&apos; failed.\n%n&quot;, 
    assertion=assertion@entry=0x7ffff1429da5 &quot;r == 0&quot;, 
    file=file@entry=0x7ffff1429d88 &quot;../../../include/k5-thread.h&quot;, line=line@entry=376, 
    function=function@entry=0x7ffff1429e70 &lt;__PRETTY_FUNCTION__.5551&gt; &quot;k5_mutex_lock&quot;)
    at assert.c:92
#3  0x00007ffff60a5b92 in __GI___assert_fail (
    assertion=assertion@entry=0x7ffff1429da5 &quot;r == 0&quot;, 
    file=file@entry=0x7ffff1429d88 &quot;../../../include/k5-thread.h&quot;, line=line@entry=376, 
    function=function@entry=0x7ffff1429e70 &lt;__PRETTY_FUNCTION__.5551&gt; &quot;k5_mutex_lock&quot;)
    at assert.c:101
#4  0x00007ffff13cd143 in k5_mutex_lock (m=0x7fffec36e358) at ../../../include/k5-thread.h:376
#5  0x00007ffff13d386f in k5_mutex_lock (m=0x7fffec36e358) at /usr/include/bits/stdio2.h:97
#6  k5_cc_mutex_lock (context=context@entry=0x7fffec3715c0, m=m@entry=0x7fffec36e358)
    at ccbase.c:460
#7  0x00007ffff13db5d8 in krb5_mcc_close (context=0x7fffec3715c0, id=&lt;optimized out&gt;)
    at cc_memory.c:212
#8  0x00007ffff13d647b in realm_choose (context=0x7fffec3715c0, data=&lt;optimized out&gt;, 
    server=0x7fffec371370, cache_out=0x7ffff4e503e0, princ_out=0x7ffff4e503f8)
    at ccselect_realm.c:69
#9  0x00007ffff13d579e in krb5_cc_select (context=context@entry=0x7fffec3715c0, 
    server=0x7fffec371370, cache_out=cache_out@entry=0x7fffec371a78, 
    princ_out=princ_out@entry=0x7ffff4e50448) at ccselect.c:171
#10 0x00007fffea3e7edb in kg_cred_resolve (minor_status=minor_status@entry=0x7ffff4e508d8, 
    context=0x7fffec3715c0, cred_handle=cred_handle@entry=0x7fffec371a20, 
    target_name=target_name@entry=0x7fffec371570) at acquire_cred.c:959
#11 0x00007fffea3ef945 in krb5_gss_init_sec_context_ext (
    minor_status=minor_status@entry=0x7ffff4e508d8, claimant_cred_handle=0x7fffec371a20, 
    claimant_cred_handle@entry=0x0, context_handle=context_handle@entry=0x7fffec36f630, 
    target_name=0x7fffec371570, mech_type=0x7fffea60e5c0 &lt;krb5_gss_oid_array&gt;, 
    req_flags=req_flags@entry=58, time_req=0, input_chan_bindings=0x0, input_token=0x0, 
    actual_mech_type=0x0, output_token=0x7ffff4e508f0, ret_flags=0x7ffff4e508dc, 
    time_rec=0x0, exts=0x7ffff4e50790) at init_sec_context.c:976
#12 0x00007fffea3f0b42 in krb5_gss_init_sec_context (
    minor_status=minor_status@entry=0x7ffff4e508d8, 
    claimant_cred_handle=claimant_cred_handle@entry=0x0, 
    context_handle=context_handle@entry=0x7fffec36f630, target_name=&lt;optimized out&gt;, 
    mech_type=&lt;optimized out&gt;, req_flags=req_flags@entry=58, time_req=0, 
    input_chan_bindings=0x0, input_token=0x0, actual_mech_type=0x0, 
    output_token=0x7ffff4e508f0, ret_flags=0x7ffff4e508dc, time_rec=0x0)
    at init_sec_context.c:1089
#13 0x00007fffea3dbfc8 in gss_init_sec_context (minor_status=0x7ffff4e508d8, 
    claimant_cred_handle=&lt;optimized out&gt;, context_handle=0x7fffec36c2a8, 
    target_name=0x7fffec370090, req_mech_type=&lt;optimized out&gt;, req_flags=58, time_req=0, 
    input_chan_bindings=0x0, input_token=0x0, actual_mech_type=0x0, 
    output_token=0x7ffff4e508f0, ret_flags=0x7ffff4e508dc, time_rec=0x0)
    at g_init_sec_context.c:215
--Type &lt;RET&gt; for more, q to quit, c to continue without paging--
#14 0x00007fffe9d88c83 in ?? () from /usr/lib64/sasl2-3/libgssapiv2.so
#15 0x00007ffff04e04fd in sasl_client_step (conn=conn@entry=0x7fffec376b90, 
    serverin=serverin@entry=0x0, serverinlen=serverinlen@entry=0, 
    prompt_need=prompt_need@entry=0x7ffff4e50aa0, clientout=clientout@entry=0x7ffff4e50ab8, 
    clientoutlen=clientoutlen@entry=0x7ffff4e50a90) at client.c:922
#16 0x00007ffff04e0686 in sasl_client_start (conn=conn@entry=0x7fffec376b90, 
    mechlist=mechlist@entry=0x7ffff7fcb2d8 &quot;GSSAPI&quot;, 
    prompt_need=prompt_need@entry=0x7ffff4e50aa0, clientout=clientout@entry=0x7ffff4e50ab8, 
    clientoutlen=clientoutlen@entry=0x7ffff4e50a90, mech=mech@entry=0x7ffff4e50a98)
    at client.c:868
#17 0x00007ffff1171ab7 in ldap_int_sasl_bind (ld=ld@entry=0x7fffec36dc20, dn=dn@entry=0x0, 
    mechs=mechs@entry=0x7ffff7fcb2d8 &quot;GSSAPI&quot;, sctrls=sctrls@entry=0x0, 
    cctrls=cctrls@entry=0x0, flags=2, interact=0x7ffff189de20 &lt;ldap_sasl_interact&gt;, 
    defaults=0x7ffff7fbe448, result=0x0, rmech=0x7ffff4e50c60, msgid=0x7ffff4e50c5c)
    at cyrus.c:501
#18 0x00007ffff1174f0b in ldap_sasl_interactive_bind (ld=ld@entry=0x7fffec36dc20, 
    dn=dn@entry=0x0, mechs=mechs@entry=0x7ffff7fcb2d8 &quot;GSSAPI&quot;, 
    serverControls=serverControls@entry=0x0, clientControls=clientControls@entry=0x0, 
    flags=flags@entry=2, interact=0x7ffff189de20 &lt;ldap_sasl_interact&gt;, 
    defaults=0x7ffff7fbe448, result=0x0, rmech=0x7ffff4e50c60, msgid=0x7ffff4e50c5c)
    at sasl.c:487
#19 0x00007ffff11750ab in ldap_sasl_interactive_bind_s (ld=0x7fffec36dc20, dn=dn@entry=0x0, 
    mechs=0x7ffff7fcb2d8 &quot;GSSAPI&quot;, serverControls=serverControls@entry=0x0, 
    clientControls=clientControls@entry=0x0, flags=flags@entry=2, 
    interact=0x7ffff189de20 &lt;ldap_sasl_interact&gt;, defaults=0x7ffff7fbe448) at sasl.c:521
#20 0x00007ffff189b13b in ldap_reconnect (force=isc_boolean_false, ldap_conn=0x7ffff7fa4640, 
    ldap_inst=0x7ffff7fbe448) at ldap_helper.c:2894
#21 ldap_connect (ldap_inst=ldap_inst@entry=0x7ffff7fbe448, 
    ldap_conn=ldap_conn@entry=0x7ffff7fa4640, force=force@entry=isc_boolean_false)
    at ldap_helper.c:2794
#22 0x00007ffff18a6336 in ldap_pool_connect (ldap_inst=0x7ffff7fbe448, pool=0x7ffff7fc5358)
    at ldap_helper.c:3664
#23 new_ldap_instance (mctx=mctx@entry=0x6bf6d0, db_name=db_name@entry=0x7ffff7fba1c8 &quot;ipa&quot;, 
    parameters=parameters@entry=0x7ffff7fbe298 &quot;\n\turi \&quot;ldapi://%2fvar%2frun%2fslapd-IPASL-IPATEST.socket\&quot;;\n\tbase \&quot;cn=dns, dc=ipasl,dc=ipatest\&quot;;\n\tserver_id \&quot;dcsl.ipasl.ipatest\&quot;;\n\tauth_method \&quot;sasl\&quot;;\n\tsasl_mech \&quot;GSSAPI\&quot;;\n\tsasl_user \&quot;DNS/dcsl.ipasl.ip&quot;..., 
    file=file@entry=0x7ffff7fcb1e0 &quot;/etc/named.conf&quot;, line=line@entry=59, 
    dctx=dctx@entry=0x7ffff7fa4448, ldap_instp=&lt;optimized out&gt;) at ldap_helper.c:661
#24 0x00007ffff18989ac in dyndb_init (mctx=0x6bf6d0, name=0x7ffff7fba1c8 &quot;ipa&quot;, 
    parameters=0x7ffff7fbe298 &quot;\n\turi \&quot;ldapi://%2fvar%2frun%2fslapd-IPASL-IPATEST.socket\&quot;;\n\tbase \&quot;cn=dns, dc=ipasl,dc=ipatest\&quot;;\n\tserver_id \&quot;dcsl.ipasl.ipatest\&quot;;\n\tauth_method \&quot;sasl\&quot;;\n\tsasl_mech \&quot;GSSAPI\&quot;;\n\tsasl_user \&quot;DNS/dcsl.ipasl.ip&quot;..., 
    file=0x7ffff7fcb1e0 &quot;/etc/named.conf&quot;, line=59, dctx=0x7ffff7fa4448, instp=0x7ffff7fd63f8)
    at ldap_driver.c:1075
#25 0x00007ffff78120f2 in dns_dyndb_load (
    libname=libname@entry=0x7ffff7fa67c0 &quot;/usr/lib64/bind/ldap.so&quot;, 
    name=name@entry=0x7ffff7fba1c8 &quot;ipa&quot;, 
    parameters=0x7ffff7fbe298 &quot;\n\turi \&quot;ldapi://%2fvar%2frun%2fslapd-IPASL-IPATEST.socket\&quot;;\n\tbase \&quot;cn=dns, dc=ipasl,dc=ipatest\&quot;;\n\tserver_id \&quot;dcsl.ipasl.ipatest\&quot;;\n\tauth_method \&quot;s--Type &lt;RET&gt; for more, q to quit, c to continue without paging--
asl\&quot;;\n\tsasl_mech \&quot;GSSAPI\&quot;;\n\tsasl_user \&quot;DNS/dcsl.ipasl.ip&quot;..., 
    file=file@entry=0x7ffff7fcb1e0 &quot;/etc/named.conf&quot;, line=line@entry=59, 
    mctx=mctx@entry=0x6bf6d0, dctx=0x7ffff7fa4448) at dyndb.c:372
#26 0x000000000042234f in configure_dyndb (dctx=0x7ffff7fa4448, mctx=0x6bf6d0, 
    dyndb=&lt;optimized out&gt;) at ./server.c:1490
#27 configure_view (view=0x7fffec128cf0, viewlist=viewlist@entry=0x7ffff4e529c0, 
    config=0x7ffff7fd87e0, vconfig=vconfig@entry=0x0, 
    cachelist=cachelist@entry=0x7ffff4e529e0, bindkeys=0x7ffff7fde588, mctx=0x6bf6d0, 
    actx=0x7ffff7fa7090, need_hints=&lt;optimized out&gt;) at ./server.c:4741
#28 0x00000000004624be in load_configuration (filename=&lt;optimized out&gt;, 
    server=server@entry=0x7ffff7fb1010, first_time=first_time@entry=isc_boolean_true)
    at ./server.c:7994
#29 0x00000000004638e3 in run_server (task=&lt;optimized out&gt;, event=&lt;optimized out&gt;)
    at ./server.c:8734
#30 0x00007ffff6ca0e79 in dispatch (manager=0x7ffff7fa9010) at task.c:1141
#31 run (uap=0x7ffff7fa9010) at task.c:1313
#32 0x00007ffff643959a in start_thread (arg=0x7ffff4e53700) at pthread_create.c:463
#33 0x00007ffff616efaf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
```
Versions:
freeipa-server-4.7.1-alt3.x86_64
bind-9.11.4.P2-alt1.x86_64
libkrb5-1.16.2-alt1.x86_64

The issue happens on libkrb5-1.16.2, after applying
https://github.com/krb5/krb5/commit/6d784809fe07c2d5f60c1a692bcac08b0d40f0a7.

Ivan Melnikov(ALTLinux maintainer of krb5) suggests to check https://github.com/krb5/krb5/commit/49bb627fed70c5258c151c5135ac3d95ed1ee55d.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>176166</commentid>
    <comment_count>1</comment_count>
    <who name="Stanislav Levin">slev</who>
    <bug_when>2018-11-29 10:12:50 +0300</bug_when>
    <thetext>There is a typo: 389-ds crashes =&gt; named (bind-dyndb-ldap plugin) crashes.

Let me check the suggestion against this issue and https://bugzilla.altlinux.org/show_bug.cgi?id=35597 one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>176168</commentid>
    <comment_count>2</comment_count>
    <who name="Stanislav Levin">slev</who>
    <bug_when>2018-11-29 12:12:56 +0300</bug_when>
    <thetext>There is a typo: 389-ds crashes =&gt; named (bind-dyndb-ldap plugin) crashes.

Let me check the suggestion against this issue and https://bugzilla.altlinux.org/show_bug.cgi?id=35597 one.(В ответ на комментарий №1)
&gt; There is a typo: 389-ds crashes =&gt; named (bind-dyndb-ldap plugin) crashes.
&gt; 
&gt; Let me check the suggestion against this issue and
&gt; https://bugzilla.altlinux.org/show_bug.cgi?id=35597 one.
I confirm the bug 35597 on libkrb5-1.16.2-alt1. 

But both issues are gone away with @49bb627fed.
I pushed a task #216877.
Please review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>176169</commentid>
    <comment_count>3</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2018-11-29 12:29:37 +0300</bug_when>
    <thetext>&gt; But both issues are gone away with @49bb627fed.
&gt; I pushed a task #216877.

Awesome! And thank you for the great work.

I&apos;ve approved the subtask 200.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>176170</commentid>
    <comment_count>4</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2018-11-29 13:21:50 +0300</bug_when>
    <thetext>krb5-1.16.2-alt2 -&gt; sisyphus:

Thu Nov 29 2018 Stanislav Levin &lt;slev@altlinux&gt; 1.16.2-alt2
- Fixed yield of cache from MEMORY ccache (closes #35597, #35667).

Wed Aug 29 2018 Alexey Shabalin &lt;shaba@altlinux&gt; 1.16.1-alt2
- rebuild with openssl-1.1

Mon Aug 27 2018 Ivan A. Melnikov &lt;iv@altlinux&gt; 1.16.1-alt1
- 1.16.1 (CVE-2018-5729, CVE-2018-5730)

Mon Jan 22 2018 Evgeny Sinelnikov &lt;sin@altlinux&gt; 1.16-alt1
- Update to latest stable release 1.16

Fri Nov 03 2017 Evgeny Sinelnikov &lt;sin@altlinux&gt; 1.15.2-alt2
- Fix build-pdf on Sisyphus
- Add noport, nss_wrapper and socket_wrapper for tests running

Wed Nov 01 2017 Evgeny Sinelnikov &lt;sin@altlinux&gt; 1.15.2-alt1
- Update to latest stable release 1.15.2 with kdcpreauth from 1.16.x

Sun Aug 20 2017 Evgeny Sinelnikov &lt;sin@altlinux.ru&gt; 1.15.1-alt1
- Update to latest stable release 1.15.1 with kdcpreauth from 1.16.x

Fri Mar 24 2017 Evgeny Sinelnikov &lt;sin@altlinux.ru&gt; 1.14.5-alt1
- Update to first spring release 1.14.5

Tue Feb 28 2017 Evgeny Sinelnikov &lt;sin@altlinux.ru&gt; 1.14.4-alt2
- Add _keytab group for default keytab /etc/krb5.keytab

Wed Feb 15 2017 Evgeny Sinelnikov &lt;sin@altlinux.ru&gt; 1.14.4-alt1
- 1.14.4
- fixed CVE-2016-3120</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>