Skip to content

Commit

Permalink
fix(users): force user name to lower case (#81)
Browse files Browse the repository at this point in the history
Users inside a remote LDAP are usually matched in case-insenstive
mode.

Make sure to always force the username to lower case to avoid
mismatch when the remote LDAP has names in uppercase (like AD):
this change will fix access for OpenVPN users using the external
LDAP.

NethServer/nethsecurity#966

Note that such users are already imported in lower case inside
the users db.
  • Loading branch information
gsanchietti authored Dec 10, 2024
1 parent 21ed827 commit 1506384
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nethsec/users/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ def ldif2users(ldif_data, user_attr="uid", display_attr="cn"):
for dn, record in parser.parse():
if user_attr in record:
user = {}
user["name"] = record[user_attr][0]
user["name"] = record[user_attr][0].lower()
if display_attr in record:
user["description"] = record[display_attr][0]
else:
Expand Down

0 comments on commit 1506384

Please sign in to comment.