Allows the use of dollar sign in usernames to allow

for windows computer authentication in an active
directory environment

Change-Id: I4b119e9e97262282d17a85911eb4b3b8f45ab521
Closes-Bug: 1715769
This commit is contained in:
Daniel Russell 2017-09-08 10:16:54 +10:00
parent 561d1ab23b
commit c615ebbb6b
3 changed files with 7 additions and 3 deletions
manilaclient
releasenotes/notes

@ -371,7 +371,7 @@ class SharesTest(utils.TestCase):
'action_name': 'os-allow_access', 'microversion': '2.0'},
{'access_to': '1' * 255, 'access_type': 'user',
'action_name': 'os-allow_access', 'microversion': '2.0'},
{'access_to': 'fake\\]{.-_\'`;}[', 'access_type': 'user',
{'access_to': 'fake$\\]{.-_\'`;}[', 'access_type': 'user',
'action_name': 'os-allow_access', 'microversion': '2.0'},
{'access_to': 'MYDOMAIN\\Administrator', 'access_type': 'user',
'action_name': 'os-allow_access', 'microversion': '2.0'},

@ -449,12 +449,12 @@ class ShareManager(base.ManagerWithFind):
@staticmethod
def _validate_username(access):
valid_username_re = '[\w\.\-_\`;\'\{\}\[\]\\\\]{4,255}$'
valid_username_re = '[\w\$\.\-_\`;\'\{\}\[\]\\\\]{4,255}$'
username = access
if not re.match(valid_username_re, username):
exc_str = ('Invalid user or group name. Must be 4-255 characters '
'and consist of alphanumeric characters and '
'special characters ]{.-_\'`;}[\\')
'special characters $]{.-_\'`;}[\\')
raise exceptions.CommandError(exc_str)
@staticmethod

@ -0,0 +1,4 @@
---
fixes:
- Usernames can contain the $ symbol to allow for windows computer
authentication in an Active Directory environment