Bug 31916 - Policy tab does not show merged values if a policy is connected directly
Policy tab does not show merged values if a policy is connected directly
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Policies
UCS 3.1
Other Linux
: P5 normal (vote)
: UCS 3.1-1-errata
Assigned To: Alexander Kläser
Florian Best
:
: 32109 32209 (view as bug list)
Depends on:
Blocks: 32271
  Show dependency treegraph
 
Reported: 2013-07-08 14:47 CEST by Stefan Gohmann
Modified: 2014-07-08 12:45 CEST (History)
4 users (show)

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 for erroneous policy evaluation in UDM UMC module. (5.79 KB, patch)
2013-08-19 18:50 CEST, Alexander Kläser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2013-07-08 14:47:27 CEST
The policy tab does not show the merged values if a policy is connected directly.

For example, I have two Master packages policies:

root@master111:~# univention-ldapsearch -LLL cn=m1 | egrep "(dn|univentionMasterPackages)"
dn: cn=m1,cn=policies,dc=deadlock11,dc=local
univentionMasterPackages: autoconf
root@master111:~# univention-ldapsearch -LLL cn=m2 | egrep "(dn|univentionMasterPackages)"
dn: cn=m2,cn=policies,dc=deadlock11,dc=local
univentionMasterPackagesRemove: automake
root@master111:~# 

Next I connect m1 with the ldap base. After that I connect m2 with computers container, only the m2 result is displayed on the policies tab of the computers container.

On the DC master the merged values are displayed.
Comment 1 Alexander Kläser univentionstaff 2013-07-09 10:08:51 CEST
AFAIR merging is only done for UCR variable policies.
Comment 2 Stefan Gohmann univentionstaff 2013-07-15 14:39:55 CEST
(In reply to Alexander Kläser from comment #1)
> AFAIR merging is only done for UCR variable policies.

No, as discussed, the policies are merged by default.
Comment 3 Stefan Gohmann univentionstaff 2013-08-05 10:48:34 CEST
*** Bug 32109 has been marked as a duplicate of this bug. ***
Comment 4 Alexander Kläser univentionstaff 2013-08-19 18:50:28 CEST
Created attachment 5381 [details]
Patch for erroneous policy evaluation in UDM UMC module.

The attached patch fixes the erroneous behaviour w.r.t. the evaluation of policies in the UDM UMC module.

There are 2x2x2 (=8) cases that may occur:
(1) 
  [edit] editing an existing UDM object
  -> the existing UDM object itself is loaded
  [new]  virtually edit non-existing (=new) UDM object
  -> the parent container UDM object is loaded
(2)
  [w/pol]   UDM object has assigend policies in LDAP directory
  [w/o_pol] UDM object has no policies assigend in LDAP directory
(3)
  [inherit] user request to (virtually) change the policy to 'inherited'
  [set_pol] user request to (virtually) assign a particular policy

The code needs to check for three different conditions:

case: [edit; w/pol; inherit]
→ current policy is (virtually) overwritten with 'None'

cases:
* [new; w/pol; inherit]
* [new; w/pol; set_pol]
→ old + temporary policy are both (virtually) set at the parent container

(other) cases:
* [new; w/o_pol; inherit]
* [new; w/o_pol; set_pol]
* [edit; w/pol; set_pol]
* [edit; w/o_pol; inherit]
* [edit; w/o_pol; set_pol]
→ simple set of the temporary policy or None
Comment 5 Alexander Kläser univentionstaff 2013-08-20 12:06:06 CEST
@QA: Please create a test script for Bug 32271.
Comment 6 Alexander Kläser univentionstaff 2013-08-20 18:10:18 CEST
Added YAML files:

  2013-08-20-univention-directory-manager-modules.yaml
  2013-08-20-univention-management-console-module-udm.yaml

Built packages for scope ucs_3.1-0-errata3.1-1.

Merged changes into UCS 3.2 branch:

 univention-directory-manager-modules (9.0.15-1) unstable; urgency=low
 .
   * Bug #31916: allow a list of policy DNs for simplePolicy.policy_result()
     as well as a single policy DN reference.

 univention-management-console-module-udm (4.0.13-1) unstable; urgency=low
 .
   * Bug #31916: fixed erroneous evaluation of policies in udm/object/policies
Comment 7 Florian Best univentionstaff 2013-08-22 10:40:52 CEST
Fix: OK (tested with UCR and Master packages policy)
YAML: OK

3.2 Changelog is missing

3.2 Error:
univention-management-console-module-udm
Depends: univention-directory-manager-tools (>> 9.0.16-1)

should be:
Depends: univention-directory-manager-tools (>= 9.0.16-1)

I wonder why it was installable?!
Comment 8 Alexander Kläser univentionstaff 2013-08-22 18:11:00 CEST
(In reply to Florian Best from comment #7)
> Fix: OK (tested with UCR and Master packages policy)
> YAML: OK
> 
> 3.2 Changelog is missing

→ I added the changelog entry.

> 3.2 Error:
> univention-management-console-module-udm
> Depends: univention-directory-manager-tools (>> 9.0.16-1)
> 
> should be:
> Depends: univention-directory-manager-tools (>= 9.0.16-1)
> 
> I wonder why it was installable?!

→ I corrected the version dependency. Good question, though :) .

 univention-management-console-module-udm (4.0.13-2) unstable; urgency=low
 .
   * Bug #31916: fixed version dependency to univention-directory-manager-tools
Comment 9 Alexander Kläser univentionstaff 2013-08-22 18:28:49 CEST
*** Bug 32209 has been marked as a duplicate of this bug. ***
Comment 10 Stefan Gohmann univentionstaff 2013-08-22 18:57:43 CEST
(In reply to Florian Best from comment #7)
> 3.2 Error:
> univention-management-console-module-udm
> Depends: univention-directory-manager-tools (>> 9.0.16-1)
> 
> should be:
> Depends: univention-directory-manager-tools (>= 9.0.16-1)
> 
> I wonder why it was installable?!

We append a timestamp during the build, e.g. 9.0.16-456-2013...
Comment 11 Florian Best univentionstaff 2013-08-23 12:36:52 CEST
Changelog: OK
Version: OK
Comment 12 Moritz Muehlenhoff univentionstaff 2013-08-28 13:42:07 CEST
http://errata.univention.de/ucs/3.1/174.html
Comment 13 Moritz Muehlenhoff univentionstaff 2013-08-28 13:42:31 CEST
http://errata.univention.de/ucs/3.1/174.html