Bug 846623
Summary: | Group Alert Definition with CLI Script Notification throws NullPointerException when Myself is set for User To Run The Script As | ||
---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Lukas Krejci <lkrejci> |
Component: | Resource Grouping, Alerts | Assignee: | RHQ Project Maintainer <rhq-maint> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4.5 | CC: | hrupp, loleary |
Target Milestone: | --- | ||
Target Release: | RHQ 4.5.0 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 836388 | Environment: | |
Last Closed: | 2013-09-01 10:10:27 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: | |||
Bug Depends On: | 836388, 836390 | ||
Bug Blocks: | 853170, 853407 |
Description
Lukas Krejci
2012-08-08 09:34:04 UTC
Similar workflow also fails when creating an alert definition with a cli script on templates. master http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=581324eeb3d32f4d8879d4749423fbde0f76de8c Author: Lukas Krejci <lkrejci> Date: Wed Aug 8 13:41:26 2012 +0200 [BZ 846623] - When creating the "child" alert definitions of group or template alert definitions, pass the real user that creates the alert def and circumvent authz. This behaves exactly the same as before but instead of bypassing the authz by passing the overlord when creating the child alert, a new local SLSB method is used that doesn't perform the authz checks and can therefore receive the original user that request the creation of the group/template alert def. This is good for the CLI alert sender that, when creating an alert script to be run as "myself", checks if the user creating the alert def is the same as the one set to run it. Reopening, the fix is not complete at all. See https://bugzilla.redhat.com/show_bug.cgi?id=836388#c5 for details of one of the use cases that didn't get covered. Investigation is ongoing on what other use cases could trigger the erroneous behavior described by this bug. I will list the use cases in here once I am done with that. The partial fix that was applied by commit http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=581324eeb3d32f4d8879d4749423fbde0f76de8c opened up new areas where this bug manifests itself: 1) Updating any data on a alert definition with a cli script notification set to run as different user than the currently authenticated. This applies to all resource, group or template alert definition. (I.e. create a alert def with cli script notif set to run as "Myself", save, logout, login as different user, try to edit the alert def). 2) Adding a member to a group that has an alert definition with a CLI script notification (applies to both "simple" compatible groups and compat groups generated by a dynagroup expression). 3) Discovering a new resource of a type that has an template alert definition with a CLI script notification. Note that I raise a separate bug 853170 for the issue 1) from the above list. *** Bug 836390 has been marked as a duplicate of this bug. *** master http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=e95b37895324937307723862c6ea229c2f91f375 Author: Lukas Krejci <lkrejci> Date: Thu Sep 13 10:10:24 2012 +0200 [BZ 846623] - Finishing the fix: 1) Make sure the UI doesn't contain stale data after an update of a alert def. 2) Provide a "copy-creation" of alert definition used for syncing the defs on a resource with the corresponding group and template alert defs (this is done by adding a "validateNotificationConfiguration boolean to the AlertDefinitionManagerLocal.createAlertDefinition()). 3) A new method for updating dependent alert defs (similar to previously added method for creating dependent alert defs) 4) Make sure conditions and notifications are loaded before leaving the update methods so that lazy load exceptions don't occur. 5) Only perform validation and finalization on new or changed notifications. 6) Marking several methods that supported the old JSF UI and are unused as deprecated. 7) new integration tests to check the behavior of alert senders that modify the notification configuration. Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since. |