Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gplazma: fix NPE if gPlazma is rejecting all logins
Motivation: If gPlazma configuration is broken or a plugin has rejected its configuration then gPlazma will NOT attempt to log in a user; in particular, the AUTH phase is not attempted. There is a bug when handling such requests. The code that logs unsuccessful login attempts needs to know the door-supplied information (credentials and principals, if any). This information is used to suppress logging additional failed attempts from that user. The door-supplied principals are currently only available if the AUTH phase is attempted. In the above case, this does not happen, resulting in a NPE, as described in issue dCache#7490. This bug hides a further bug, where the code for logging failed login attempts assumes that the validation error is available, even when the validation phase has not taken place. Modification: Minor improvements to the error message describing how a plugin failured to initialise. As a general safety point, ensure that the principals SetDiff values are non-null by initialising them to a safe default value. Provide an alternative route to inject the door-supplied information into the AUTH phase result. This is a temporary solution that is low-risk for back-porting. A better solution would involve more code-refactoring. In addition, the failure to configure gPlazma is recorded as a validation error for the login. Again, this is an approach to reduce the risk for back-porting. A more general (or "correct") approach would introduce unnecessary risk when back-porting. Result: A bug is fixed in gPlazma that is triggered when users attempt to authenticate with broken gPlazma configuration or a gPlazma plugin's configuration is broken. Target: master Fixes: dCache#7490 Requires-notes: yes Requires-book: no Request: 9.2 Patch: https://rb.dcache.org/r/14198/ Acked-by: Tigran Mkrtchyan
- Loading branch information