user_enabled_invert does not properly handle string values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Medium
|
Nathan Kinder |
Bug Description
The user_enabled_invert setting is supposed to invert the meaning of True/False for the user enabled attribute. This makes "lock" attributes useful, where "False" indicates that an account is not locked.
The invert logic expects that we have a bool type that we then invert using 'not' in this snippet of code from UserApi.
-------
elif self.enabled_invert and not self.enabled_
enabled = obj.get('enabled', self.enabled_
-------
The problem is that we get a string type from the default value, and a bool type from LDAP. Evaluating a string with 'not' will be False for any non-empty string. This means that we will fail to invert a string of "False" that is inherited from the default setting if no value is returned from LDAP, leading to accounts being inadvertently disabled. This code needs to handle converting a str type to bool before inverting the value.
tags: | added: juno-rc-candidate |
Changed in keystone: | |
assignee: | nobody → Nathan Kinder (nkinder) |
status: | New → In Progress |
summary: |
- user_enabled_invert does notproperly handle string values + user_enabled_invert does not properly handle string values |
tags: |
added: juno-rc-potential removed: juno-rc-candidate |
Changed in keystone: | |
importance: | Undecided → Medium |
Changed in keystone: | |
assignee: | Nathan Kinder (nkinder) → Morgan Fainberg (mdrnstm) |
assignee: | Morgan Fainberg (mdrnstm) → Nathan Kinder (nkinder) |
assignee: | Nathan Kinder (nkinder) → Morgan Fainberg (mdrnstm) |
Changed in keystone: | |
assignee: | Morgan Fainberg (mdrnstm) → Nathan Kinder (nkinder) |
description: | updated |
Changed in keystone: | |
milestone: | none → juno-rc2 |
status: | Fix Committed → Fix Released |
tags: | removed: juno-rc-potential |
Changed in keystone: | |
milestone: | juno-rc2 → 2014.2 |
Fix proposed to branch: master /review. openstack. org/125243
Review: https:/