Patch for HUE-1428

Review Request #3386 - Created July 29, 2013 and submitted

Chris Conner
old-hue
Master
HUE-1428
abec, enricoberti, romain
Patch for HUE-1428.  The issue is with how "ldap.filter.escape_filter_chars" handles a DN like "cn=Last, First, cn=users, dc=test, dc=com".  Since it's python method that's causing the issue.  I worked around it as I couldn't find a better method.
I tested against AD and OpenDS and in both cases it worked correctly.
  • 1
  • 0
  • 0
  • 0
  • 1
Description From Last Updated
You might be able to use the 'escape' kwarg in escape_filter_chars. IE: ldap.filter.escape_filter_chars(username_pattern, 1).replace(r'\2a', r'*') Abraham Elmahrek
  1. 
      
    1. Hey Abe, 
      
      I tried again to confirm and we get:
      
      CN=User2\5c\2c\20Test\2CCN=Users\2CDC=test\2CDC=org\2CDC=lab
      
      So the problem child "\5c" is still there and even if I remove that "\5c" it totally wigs out.  I also tried (username_patter, 2), but that didn't work either.
      
      Any other thoughts?
  2. apps/useradmin/src/useradmin/ldap_access.py (Diff revision 1)
     
     
     
     
    You might be able to use the 'escape' kwarg in escape_filter_chars. IE: ldap.filter.escape_filter_chars(username_pattern, 1).replace(r'\2a', r'*')
    1. I tried this once, but I will double check one more time to be on the safe side.  I'd like that solution much better:-)
  3. 
      
  1. So escape_filter_chars above does not escape properly?
    
    The solution is a bit dirty but works for me.
  2. 
      
  1. Works for me :).
  2. 
      
Review request changed

Status: Closed (submitted)

Loading...