Bug 1243771

Summary: realm fails to join domain names with underscore in name
Product: Red Hat Enterprise Linux 7 Reporter: Kaushik Banerjee <kbanerje>
Component: realmdAssignee: Stef Walter <stefw>
Status: CLOSED ERRATA QA Contact: Kaushik Banerjee <kbanerje>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: ebenes, jhrozek, kbanerje, lslebodn, pkis, sbose, stefw
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: realmd-0.16.1-3.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 03:44:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kaushik Banerjee 2015-07-16 09:32:49 UTC
Description of problem:
realm fails to connect to non-root ad domains

Version-Release number of selected component (if applicable):
realmd-0.16.0-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. realm join fails to join/discover non-root domains.
    # realm discover -v sssdad_tree.com
    * Resolving: _ldap._tcp.sssdad_tree.com
    * Performing LDAP DSE lookup on: 10.65.206.94
    ! Received invalid or unsupported Netlogon data from server sssdad_tree.com
     type: kerberos
     realm-name: SSSDAD_TREE.COM
     domain-name: sssdad_tree.com
     configured: no

2. I verified that ldapsearch from the same client is able to query netlogon data:
# ldapsearch -LLL -h 10.65.206.94 -x -b '' -s base
"(&(NtVer=\06\00\00\00)(AAC=\00\00\00\00))" NetLogon
dn:
netlogon::
FwAAAP1xAACJRakZcUWGTpPs9+FhGVnUBnNzc2RhZANjb20AC3Nzc2RhZF90cmVlwB8
 FZWFnbGXAJAtTU1NEQURfVFJFRQAFRUFHTEUAABdEZWZhdWx0LUZpcnN0LVNpdGUtTmFtZQDATwUA
 AAD/////


Actual results:
realm fails to join

Expected results:
realm join should work

Additional info:

Comment 7 Stef Walter 2015-07-31 10:57:12 UTC
The issue here is the underscore which is erroneously flaged as a bad character.

Comment 8 Stef Walter 2015-07-31 11:06:33 UTC
Fixed upstream:

commit e368c5a42656a687e6b726978752eb4abf6503d0
Author: Stef Walter <stefw>
Date:   Fri Jul 31 12:53:04 2015 +0200

    Be more liberal on what we accept as a domain name
    
    Make the checks on what we accept as a domain name more liberal
    for values coming in from the network.
    
    DNS Domain names are pretty liberal (internet domain names
    are more restrictive) See RFC 2181 section 11
    
    http://www.ietf.org/rfc/rfc2181.txt
    
    However we cannot consume names with whitespace and problematic
    punctuation, due to the various programs that parse the
    configuration files we set up.

Comment 10 Kaushik Banerjee 2015-08-04 11:04:06 UTC
Verified with realmd-0.16.1-3.el7.x86_64

# realm discover -v sssdad_tree.com
 * Resolving: _ldap._tcp.sssdad_tree.com
 * Performing LDAP DSE lookup on: X.X.X.X
 * Successfully discovered: sssdad_tree.com
sssdad_tree.com
  type: kerberos
  realm-name: SSSDAD_TREE.COM
  domain-name: sssdad_tree.com
  configured: no
  server-software: active-directory
  client-software: sssd
  required-package: oddjob
  required-package: oddjob-mkhomedir
  required-package: sssd
  required-package: adcli
  required-package: samba-common

Comment 11 errata-xmlrpc 2015-11-19 03:44:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-2184.html