Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adtrust: make sure that runtime hostname result is consistent with the configuration #629

Closed
wants to merge 1 commit into from

Conversation

abbra
Copy link
Contributor

@abbra abbra commented Mar 20, 2017

FreeIPA's ipasam module to Samba uses gethostname() call to identify
own server's host name. This value is then used in multiple places,
including construction of cifs/host.name principal. ipasam module
always uses GSSAPI authentication when talking to LDAP, so Kerberos
keys must be available in the /etc/samba/samba.keytab. However, if
the principal was created using non-FQDN name but system reports
FQDN name, ipasam will fail to acquire Kerberos credentials.
Same with FQDN principal and non-FQDN hostname.

Also host name and principal name must have the same case.

Report an error when configuring ADTrust instance with inconsistent
runtime hostname and configuration. This prevents errors like this:

[20/21]: starting CIFS services
ipa         : CRITICAL CIFS services failed to start

where samba logs have this:

[2017/03/20 06:34:27.385307,  0] ipa_sam.c:4193(bind_callback_cleanup)
  kerberos error: code=-1765328203, message=Keytab contains no suitable keys for cifs/ipatrust@EXAMPLE.COM
[2017/03/20 06:34:27.385476,  1] ../source3/lib/smbldap.c:1206(get_cached_ldap_connect)
  Connection to LDAP server failed for the 16 try!

Fixes https://pagure.io/freeipa/issue/6786

@MartinBasti
Copy link
Contributor

************* Module ipaserver.install.adtrustinstance

ipaserver/install/adtrustinstance.py:693: [E0602(undefined-variable), ADTRUSTInstance.__validate_server_hostname] Undefined variable 'socket')

PEP-8 errors:
./ipaserver/install/adtrustinstance.py:695:77: E502 the backslash is redundant between brackets
./ipaserver/install/adtrustinstance.py:696:73: E502 the backslash is redundant between brackets
./ipaserver/install/adtrustinstance.py:697:72: E502 the backslash is redundant between brackets
./ipaserver/install/adtrustinstance.py:698:79: E502 the backslash is redundant between brackets

@MartinBasti MartinBasti self-assigned this Mar 27, 2017
@abbra
Copy link
Contributor Author

abbra commented Mar 29, 2017

Removed backslashes and also moved the check to be the first step when creating an instance.

…e configuration

FreeIPA's `ipasam` module to Samba uses gethostname() call to identify
own server's host name. This value is then used in multiple places,
including construction of cifs/host.name principal. `ipasam` module
always uses GSSAPI authentication when talking to LDAP, so Kerberos
keys must be available in the /etc/samba/samba.keytab. However, if
the principal was created using non-FQDN name but system reports
FQDN name, `ipasam` will fail to acquire Kerberos credentials.
Same with FQDN principal and non-FQDN hostname.

Also host name and principal name must have the same case.

Report an error when configuring ADTrust instance with inconsistent
runtime hostname and configuration. This prevents errors like this:

    [20/21]: starting CIFS services
    ipa         : CRITICAL CIFS services failed to start

    where samba logs have this:

    [2017/03/20 06:34:27.385307,  0] ipa_sam.c:4193(bind_callback_cleanup)
      kerberos error: code=-1765328203, message=Keytab contains no suitable keys for cifs/ipatrust@EXAMPLE.COM
    [2017/03/20 06:34:27.385476,  1] ../source3/lib/smbldap.c:1206(get_cached_ldap_connect)
      Connection to LDAP server failed for the 16 try!

Fixes https://pagure.io/freeipa/issue/6786
@MartinBasti MartinBasti added ack Pull Request approved, can be merged pushed Pull Request has already been pushed labels Mar 30, 2017
@MartinBasti
Copy link
Contributor

master:

  • 0d817ae adtrust: make sure that runtime hostname result is consistent with the configuration

ipa-4-5:

  • e430699 adtrust: make sure that runtime hostname result is consistent with the configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
2 participants