Skip to content

ldap.dn.escape_dn_chars problem with a single space character #252

@eriklax

Description

@eriklax

This may be a very minor problem, but the ldap.dn.escape_dn_chars function does not handle strings containing only one space character properly. As both the first and the last characters is a space in such a string.

>>> ldap.dn.escape_dn_chars(' ');
'\\\\ '

if s[0]=='#' or s[0]==' ':
s = ''.join(('\\',s))
if s[-1]==' ':
s = ''.join((s[:-1],'\\ '))

I believe the quickest fix would be if the s[-1] check were done before the s[0],

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy