Bug 27706 - Überschreiben von SRV Records
Überschreiben von SRV Records
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: S4 Connector
UCS 3.0
Other Linux
: P5 enhancement (vote)
: UCS 3.0-2
Assigned To: Stefan Gohmann
Arvid Requate
: interim-2
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-21 11:20 CEST by Stefan Gohmann
Modified: 2012-07-20 15:25 CEST (History)
0 users

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Patch für dns.py (2.38 KB, patch)
2012-07-03 19:03 CEST, Arvid Requate
Details | Diff
Testscript für den Spezialfall SRV record in S4 aber nicht in UDM (2.83 KB, text/plain)
2012-07-04 13:01 CEST, Arvid Requate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2012-06-21 11:20:50 CEST
Für Bug #27935 ist es notwendig, dass die SRV Records auf einem selektiven DC Slave nicht den SRV Records des Masters entsprechen.
Comment 1 Stefan Gohmann univentionstaff 2012-06-28 09:20:49 CEST
Die Anpassungen aus dem UCS@school errata wurden übernommen:

root@master811:~# cat test.sh 
eval $(ucr shell)
host -t SRV _kerberos._tcp.$(dnsdomainname)
ucr set connector/s4/mapping/dns/srv_record/_kerberos._tcp.$(dnsdomainname)/location="100 0 88 server1.$(dnsdomainname). 100 0 88 server2.$(dnsdomainname)."
/etc/init.d/univention-s4-connector restart
udm dns/srv_record modify --dn "relativeDomainName=_kerberos._tcp,zoneName=$(dnsdomainname),cn=dns,$ldap_base" --append location="0 100 88 x.$(dnsdomainname)."
sleep 5
host -t SRV _kerberos._tcp.$(dnsdomainname)
root@master811:~# ./test.sh 
_kerberos._tcp.deadlock81.local has SRV record 0 100 88 master811.deadlock81.local.
Create connector/s4/mapping/dns/srv_record/_kerberos._tcp.deadlock81.local/location
Stopping univention-s4-connector daemon.
done.
Starting univention-s4-connector daemon.
done.
Object modified: relativeDomainName=_kerberos._tcp,zoneName=deadlock81.local,cn=dns,dc=deadlock81,dc=local
_kerberos._tcp.deadlock81.local has SRV record 100 0 88 server1.deadlock81.local.
_kerberos._tcp.deadlock81.local has SRV record 100 0 88 server2.deadlock81.local.
Comment 2 Arvid Requate univentionstaff 2012-07-03 19:03:37 CEST
Created attachment 4494 [details]
Patch für dns.py

Ein copy+paste Fehler in der Funktion ucs_srv_record_create in modules/univention/s4connector/s4/dns.py +623 verhindert aktuell, dass die UCR-Variable beim Sync von Samba4 nach UCS ausgewertet wird:

>>> relativeDomainName="_ldap._tcp"
>>> zoneName="domain.local"
>>> print 'connector/s4/mapping/dns/srv_record/%s.%s/location' % (relativeDomainName[0].lower(),zoneName[0].lower())
connector/s4/mapping/dns/srv_record/_.d/location

Mit dem obigen test.sh fällt das im Endergebnis nicht auf, weil die Funktion s4_srv_record_create beim Sync von UCS nach S4 die UCS Variable korrekt auswertet wird und dann in der Rückrichtung die Werte einfach ungemapped übernommen werden.
Comment 3 Stefan Gohmann univentionstaff 2012-07-04 07:22:03 CEST
Typo ist behoben. Zusätzlich gab es noch ein Problem, wenn der SRV Record auf UCS noch nicht existiert, dann kann der SRV Record nicht angelegt werden, da  locations in UCS benötigt wird.

Jetzt ist es wie folgt:

- UCR Variable nicht gesetzt → die Daten werden normal synchronisiert

- UCR Variable gesetzt
  - UCS nach S4
    - Wert aus der UCR Variable wird in den SRV Record geschrieben
  - S4 nach UCS
    - SRV Eintrag existiert in UCS
      - locations wird nicht geändert
    - SRV Eintrag existiert nicht in UCS
      - locations aus S4 wird übernommen

Das bedeutet für den letzten Fall, Objekt wird in S4 mit location X erzeugt, beim Synchronisieren nach UCS wird X in die location geschrieben, beim Zurücksynchronisieren wird der Wert aus UCS (Y) nach S4 geschrieben.
Comment 4 Arvid Requate univentionstaff 2012-07-04 13:01:43 CEST
Created attachment 4498 [details]
Testscript für den Spezialfall SRV record in S4 aber nicht in UDM

Testscript für den Spezialfall UCR-Variable gesetzt, SRV record nicht in UDM, dann Sync von S4 nach UCS usw.

Alle Fälle Ok.
Comment 5 Stefan Gohmann univentionstaff 2012-07-20 15:25:21 CEST
UCS 3.0-2 has been released: 
  http://forum.univention.de/viewtopic.php?f=54&t=1905

If this error occurs again, please use "Clone This Bug".