Bug 14406 - Fix adding msDS-AdditionalDnsHostName to keytab with Windows DC
Summary: Fix adding msDS-AdditionalDnsHostName to keytab with Windows DC
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-11 07:55 UTC by Isaac Boukris
Modified: 2020-06-25 07:18 UTC (History)
7 users (show)

See Also:


Attachments
patch for v4-12-test branch (7.32 KB, patch)
2020-06-19 08:09 UTC, Isaac Boukris
iboukris: review+
iboukris: ci-passed+
Details
patch for v4-12-test branch (8.55 KB, patch)
2020-06-22 13:02 UTC, Isaac Boukris
iboukris: review+
asn: review+
iboukris: ci-passed+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Isaac Boukris 2020-06-11 07:55:34 UTC
In bug #14396 we added msDS-AdditionalDnsHostName entries to the keytab with tests for it, but it still does not work against Windows DCs.

I turns out that every time you add an entry to msDS-AdditionalDnsHostName, Windows DC adds another short entry (up to the first dot if any) with a strange '\0$' suffix. The binary null at 'entry[entry_len-2]' causes ldap_get_values() to fail parsing it as a string, so we need to use ldap_get_values_len().

Since samba-dc currently doesn't add these short names I think we should just ignore them so the keytab looks the same.
Comment 1 Isaac Boukris 2020-06-15 13:27:27 UTC
> Since samba-dc currently doesn't add these short names I think we should just ignore them so the keytab looks the same.

Not sure if samba-dc should add it the same way (as binary), it maybe a bug in Windows I'll ask dochelp.
Comment 2 Isaac Boukris 2020-06-15 13:49:01 UTC
BTW, it looks like Windows also updates the SPN list on the server side when the msDS-AdditionalDnsHostName is modified similar to the triggers we have for dNSHostName changes in samldb_service_principal_names_change().
Comment 3 Isaac Boukris 2020-06-16 10:59:56 UTC
Sent a question to dochelp about the DC handling:
https://lists.samba.org/archive/cifs-protocol/2020-June/003460.html
Comment 4 Isaac Boukris 2020-06-19 08:09:42 UTC
Created attachment 16060 [details]
patch for v4-12-test branch
Comment 5 Isaac Boukris 2020-06-19 08:11:58 UTC
Pipeline for v4.12 branch:
https://gitlab.com/samba-team/devel/samba/-/commits/iboukris-v4-12-test
Comment 6 Isaac Boukris 2020-06-22 13:00:49 UTC
(In reply to Isaac Boukris from comment #5)

Updated pipeline:
https://gitlab.com/samba-team/devel/samba/-/commits/iboukris-v4-12-test
Comment 7 Isaac Boukris 2020-06-22 13:02:09 UTC
Created attachment 16062 [details]
patch for v4-12-test branch
Comment 8 Isaac Boukris 2020-06-22 13:03:01 UTC
Comment on attachment 16062 [details]
patch for v4-12-test branch

updated patch.
Comment 9 Andreas Schneider 2020-06-23 09:31:05 UTC
Karolin, please add the patchset to 4.12. Thanks.
Comment 10 Karolin Seeger 2020-06-24 09:54:54 UTC
(In reply to Andreas Schneider from comment #9)
Pushed to autobuild-v4-12-test.
Comment 11 Karolin Seeger 2020-06-25 07:18:59 UTC
(In reply to Karolin Seeger from comment #10)
Pushed to v4-12-test.
Closing out bug report.

Thanks!