From 7a21a4578129ddc3797cf387d73a5f3551036269 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Wed, 20 Sep 2017 15:53:08 -0400 Subject: [PATCH] properly encode LDAP DN values on validation see: https://github.com/ansible/ansible-tower/issues/7554 --- awx/sso/validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/sso/validators.py b/awx/sso/validators.py index 172c21593c..dd1086a426 100644 --- a/awx/sso/validators.py +++ b/awx/sso/validators.py @@ -22,7 +22,7 @@ def validate_ldap_dn(value, with_user=False): else: dn_value = value try: - ldap.dn.str2dn(dn_value) + ldap.dn.str2dn(dn_value.encode('utf-8')) except ldap.DECODING_ERROR: raise ValidationError(_('Invalid DN: %s') % value)