Skip to content

Commit

Permalink
Fix LDAP dn splitting issue in get-password-policy handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Apr 30, 2024
1 parent 32f52a4 commit 46bf007
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions imageroot/actions/get-password-policy/50get_password_policy
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ ppolicy = {
"complexity_check": False,
}
}

for line in ldapsearch_proc.stdout.split("\n"):
# In case of long LDAP dn we could have a \n inside the dn, so we can't split
# split only if we got a line that ends with a \n$, which is the separator
for line in ldapsearch_proc.stdout.split("\n$"):
if not line:
continue

Expand Down
5 changes: 3 additions & 2 deletions imageroot/api-moduled/handlers/get-configuration/post
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ ppolicy = {
"complexity_check": False,
}
}

for line in ldapsearch_proc.stdout.split("\n"):
# In case of long LDAP dn we could have a \n inside the dn, so we can't split
# split only if we got a line that ends with a \n$, which is the separator
for line in ldapsearch_proc.stdout.split("\n$"):
if not line:
continue

Expand Down
5 changes: 3 additions & 2 deletions imageroot/api-moduled/handlers/get-password-policy/post
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ ppolicy = {
"complexity_check": False,
}
}

for line in ldapsearch_proc.stdout.split("\n"):
# In case of long LDAP dn we could have a \n inside the dn, so we can't split
# split only if we got a line that ends with a \n$, which is the separator
for line in ldapsearch_proc.stdout.split("\n$"):
if not line:
continue

Expand Down

0 comments on commit 46bf007

Please sign in to comment.