Univention Bugzilla – Bug 16966
Löschen einer Richtlinie entfernt Referenz an Benutzerobjekt nicht
Last modified: 2022-03-23 14:14:28 CET
Es wurde eine UDM-Ansicht-Policy im UDM gelöscht, die mit einem Benutzer verknüpft war. Nach dem Löschen war die Referenz weiterhin am Benutzerobjekt vorhanden. Eine Fehlermeldung/Warnung ist im UDM nicht erschienen.
univention-policy-result und den WebUDM scheint dies nicht zu stören.
Das gleiche Verhalten habe ich an einem OU-Objekt beobachtet, an dem bereits eine UCR-Richtlinie verknüpft war und an das zusätzlich eine LDAP-Server-Richtlinie verknüpft wurde. Beim späteren Löschen der LDAP-Server-Richtlinie wurde diese nicht vom OU-Objekt entfernt.
Es gibt dadurch aber kein echtes Problem, oder?
Ich habe bisher keine Probleme feststellen können, es ist nur verwirrend, dass es so ist.
(In reply to Stefan Gohmann from comment #3) > Es gibt dadurch aber kein echtes Problem, oder? Legt man danach eine Policy mit gleichen Namen erneut an, ist diese dann auch automatisch wieder aktiviert! Ticket#: 2013061221001009 UCS Training video
Created attachment 9255 [details] patch (branch fbest/16966-remove-referencing-policy-entries) Nothing simpler than that. The patch removes all univentionPolicyReference which match the DN of the removed policy. As all policies cannot be moved or renamed no action is required for these operations.
Just encountered the problem in a 4.2 customer system. UDM and univention-ldapsearch show the reference to a non-existing policy, UMC does not. Please consider Florians patch
We can probably alternatively also solve this via the refint LDAP overlay module.
Policy references are now removed when removing a policy. univention-directory-manager-modules.yaml 5d516cb8c501 | Bug #16966: Merge branch 'fbest/16966-remove-referencing-policy-entries' into 5.0-1 f329c34bdb7d | Bug #16966: remove referencing policy entries when removing policy univention-directory-manager-modules (15.0.11-36) 5d516cb8c501 | Bug #16966: Merge branch 'fbest/16966-remove-referencing-policy-entries' into 5.0-1 f329c34bdb7d | Bug #16966: remove referencing policy entries when removing policy
# udm policies/pwhistory create --set name=pwhistory WARNING: The object is not going to be created underneath of its default containers. Object created: cn=pwhistory,dc=ucs,dc=intranet # udm users/user create --set username=foo --set password=univention --set lastname=foo --policy-reference cn=pwhistory,dc=ucs,dc=intranet WARNING: The object is not going to be created underneath of its default containers. Object created: uid=foo,dc=ucs,dc=intranet # univention-ldapsearch -LLLb uid=foo,dc=ucs,dc=intranet univentionPolicyReference dn: uid=foo,dc=ucs,dc=intranet univentionPolicyReference: cn=pwhistory,dc=ucs,dc=intranet # udm policies/pwhistory remove --dn cn=pwhistory,dc=ucs,dc=intranet Object removed: cn=pwhistory,dc=ucs,dc=intranet # univention-ldapsearch -LLLb uid=foo,dc=ucs,dc=intranet univentionPolicyReference dn: uid=foo,dc=ucs,dc=intranet
Functionality tested: - created policy - attached policy to a container object - deleted policy - checked for policy entry on container object OK code review OK yaml, changelog OK log files OK
<https://errata.software-univention.de/#/?erratum=5.0x259>