GithubHelp home page GithubHelp logo

matrix-synapse-ldap3's Introduction

Synapse LDAP Auth Provider

Allows synapse to use LDAP as a password provider.

This allows users to log in to synapse with their username and password from an LDAP server. There is also ma1sd (3rd party) that offers more fully-featured integration.

Installation

  • Included as standard in the deb packages and docker images from matrix.org.
  • If you installed into a virtualenv:
    • Ensure pip is up-to-date: pip install -U pip.
    • Install the LDAP password provider: pip install matrix-synapse-ldap3.
  • For other installation mechanisms, see the documentation provided by the maintainer.

Usage

Example Synapse configuration:

modules:
 - module: "ldap_auth_provider.LdapAuthProviderModule"
   config:
     enabled: true
     uri: "ldap://ldap.example.com:389"
     start_tls: true
     base: "ou=users,dc=example,dc=com"
     attributes:
        uid: "cn"
        mail: "mail"
        name: "givenName"
     #bind_dn:
     #bind_password:
     #filter: "(objectClass=posixAccount)"
     # Additional options for TLS, can be any key from https://ldap3.readthedocs.io/en/latest/ssltls.html#the-tls-object
     #tls_options:
     #  validate: true
     #  local_certificate_file: foo.crt
     #  local_private_key_file: bar.pem
     #  local_private_key_password: secret

If you would like to specify more than one LDAP server for HA, you can provide uri parameter with a list. Default HA strategy of ldap3.ServerPool is employed, so first available server is used.

modules:
 - module: "ldap_auth_provider.LdapAuthProviderModule"
   config:
     enabled: true
     uri:
        - "ldap://ldap1.example.com:389"
        - "ldap://ldap2.example.com:389"
     start_tls: true
     base: "ou=users,dc=example,dc=com"
     attributes:
        uid: "cn"
        mail: "email"
        name: "givenName"
     #bind_dn:
     #bind_password:
     #filter: "(objectClass=posixAccount)"
     #tls_options:
     #  validate: true
     #  local_certificate_file: foo.crt
     #  local_private_key_file: bar.pem
     #  local_private_key_password: secret

If you would like to enable login/registration via email, or givenName/email binding upon registration, you need to enable search mode. An example config in search mode is provided below:

modules:
 - module: "ldap_auth_provider.LdapAuthProviderModule"
   config:
     enabled: true
     mode: "search"
     uri: "ldap://ldap.example.com:389"
     start_tls: true
     base: "ou=users,dc=example,dc=com"
     attributes:
        uid: "cn"
        mail: "mail"
        name: "givenName"
     # Search auth if anonymous search not enabled
     bind_dn: "cn=hacker,ou=svcaccts,dc=example,dc=com"
     bind_password: "ch33kym0nk3y"
     #filter: "(objectClass=posixAccount)"
     #tls_options:
     #  validate: true
     #  local_certificate_file: foo.crt
     #  local_private_key_file: bar.pem
     #  local_private_key_password: secret

Alternatively you can also put the bind_password of your service user into its own file to not leak secrets into your configuration:

modules:
 - module: "ldap_auth_provider.LdapAuthProviderModule"
   config:
     enabled: true
     # all the other options you need
     bind_password_file: "/var/secrets/synapse-ldap-bind-password"

Please note that every trailing \n in the password file will be stripped automatically.

Active Directory forest support

If the active_directory flag is set to true, an Active Directory forest will be searched for the login details. In this mode, the user enters their login details in one of the forms:

  • <login>/<domain>
  • <domain>\<login>

In either case, this will be mapped to the Matrix UID <login>/<domain> (The normal AD domain separators, @ and \, cannot be used in Matrix User Identifiers, so / is used instead.)

Let's say you have several domains in the example.com forest:

modules:
 - module: "ldap_auth_provider.LdapAuthProviderModule"
   config:
     enabled: true
     mode: "search"
     uri: "ldap://main.example.com:389"
     base: "dc=example,dc=com"
     # Must be true for this feature to work
     active_directory: true
     # Optional. Users from this domain may log in without specifying the domain part
     default_domain: main.example.com
     attributes:
        uid: "userPrincipalName"
        mail: "mail"
        name: "givenName"
     bind_dn: "cn=hacker,ou=svcaccts,dc=example,dc=com"
     bind_password: "ch33kym0nk3y"

With this configuration the user can log in with either main\someuser, main.example.com\someuser, someuser/main.example.com or someuser.

Users of other domains in the example.com forest can log in with domain\login or login/domain.

Please note that userPrincipalName or a similar-looking LDAP attribute in the format login@domain must be used when the active_directory option is enabled.

Troubleshooting and Debugging

matrix-synapse-ldap3 logging is included in the Synapse homeserver log (typically homeserver.log). The LDAP plugin log level can be increased to DEBUG for troubleshooting and debugging by making the following modifications to your Synapse server's logging configuration file:

  • Set the value for handlers.file.level to DEBUG:
handlers:
  file:
    # [...]
    level: DEBUG
  • Add the following to the loggers section:
loggers:
   # [...]
   ldap3:
     level: DEBUG
   ldap_auth_provider:
     level: DEBUG

Finally, restart your Synapse server for the changes to take effect:

synctl restart

matrix-synapse-ldap3's People

Contributors

14mrh4x0r avatar anoadragon453 avatar ara4n avatar army1349 avatar babolivier avatar clokep avatar dbkr avatar dmrobertson avatar dmsimard avatar erikjohnston avatar h-shay avatar half-shot avatar hellcp avatar jayvdb avatar jkolo avatar josue-t avatar kittykat avatar loganp avatar ma27 avatar mweinelt avatar ne0sight avatar photoninger avatar reivilibre avatar richvdh avatar smkent avatar sorunome avatar squahtx avatar thejj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matrix-synapse-ldap3's Issues

Don't block on main thread

Currently all the LDAP interactions happen in a synchronous fashion, which blocks the entire server while waiting for a response from the LDAP server. This will cause issues if the LDAP server takes a while to respond and/or a lot of LDAP logins happen at the same time.

A relatively simply fix for this should be to use the twisted deferToThread API every time we call a function on ldap3

Wrong format string in logs

Hi, setting up authentication against an Active Directory LDAP I got this:

2018-09-05 16:10:36,908 - twisted - 131 - ERROR -  - Traceback (most recent call last):
2018-09-05 16:10:36,909 - twisted - 131 - ERROR -  -   File "/usr/lib/python2.7/logging/handlers.py", line 76, in emit
2018-09-05 16:10:36,910 - twisted - 131 - ERROR -  -     if self.shouldRollover(record):
2018-09-05 16:10:36,911 - twisted - 131 - ERROR -  -   File "/usr/lib/python2.7/logging/handlers.py", line 156, in shouldRollover
2018-09-05 16:10:36,912 - twisted - 131 - ERROR -  -     msg = "%s\n" % self.format(record)
2018-09-05 16:10:36,912 - twisted - 131 - ERROR -  -   File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
2018-09-05 16:10:36,913 - twisted - 131 - ERROR -  -     return fmt.format(record)
2018-09-05 16:10:36,913 - twisted - 131 - ERROR -  -   File "/usr/lib/python2.7/logging/__init__.py", line 465, in format
2018-09-05 16:10:36,913 - twisted - 131 - ERROR -  -     record.message = record.getMessage()
2018-09-05 16:10:36,913 - twisted - 131 - ERROR -  -   File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage
2018-09-05 16:10:36,913 - twisted - 131 - ERROR -  -     msg = msg % self.args
2018-09-05 16:10:36,914 - twisted - 131 - ERROR -  - TypeError: %d format: a number is required, not unicode
2018-09-05 16:10:36,914 - twisted - 131 - ERROR -  - Logged from file ldap_auth_provider.py, line 202
2018-09-05 16:10:36,914 - twisted - 131 - ERROR -  - Traceback (most recent call last):
2018-09-05 16:10:36,914 - twisted - 131 - ERROR -  -   File "/usr/lib/python2.7/logging/__init__.py", line 861, in emit
2018-09-05 16:10:36,914 - twisted - 131 - ERROR -  -     msg = self.format(record)
2018-09-05 16:10:36,914 - twisted - 131 - ERROR -  -   File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
2018-09-05 16:10:36,915 - twisted - 131 - ERROR -  -     return fmt.format(record)
2018-09-05 16:10:36,915 - twisted - 131 - ERROR -  -   File "/usr/lib/python2.7/logging/__init__.py", line 465, in format
2018-09-05 16:10:36,915 - twisted - 131 - ERROR -  -     record.message = record.getMessage()
2018-09-05 16:10:36,915 - twisted - 131 - ERROR -  -   File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage
2018-09-05 16:10:36,915 - twisted - 131 - ERROR -  -     msg = msg % self.args
2018-09-05 16:10:36,915 - twisted - 131 - ERROR -  - TypeError: %d format: a number is required, not unicode
2018-09-05 16:10:36,915 - twisted - 131 - ERROR -  - Logged from file ldap_auth_provider.py, line 202

Which comes from this:

                    logger.info(
                        "Registration based on LDAP data was successful: "
                        "%d: %s (%s, %)",
                        user_id, localpart, name, mail
                    )

But user_id appears to be a string, changing %d to %s works, and what is logged is a string.

socket connection error: [Errno -2] Name or service not known

I've been trying to get LDAP authentication setup with my Matrix server. Using the config below I get the following error messages. I have verified that the ldap server name resolves and that I can hit the LDAP service from the Synapse server. I also see no logs on the LDAP server that show that matrix has tried to connect. Any help would be greatly appreciated.

Package: python-matrix-synapse-ldap3 v0.1.2.

password_providers:
    - module: "ldap_auth_provider.LdapAuthProvider"
      config:
        enabled: true
        uri: "ldap://<hostname or ip>:389"
        start_tls: false # I've tried with true as well.
        base: "<base>"
        attributes:
           uid: "uid"
           mail: "mail"
           name: "givenName"
        bind_dn: "<bind dn>"
        bind_password: "<bind pass>"
        filter: "(objectClass=posixAccount)"

handlers:
  file:
    level: DEBUG

loggers:
  ldap3:
    level: DEBUG
  ldap_auth_provider:
    level: DEBUG
2017-06-30 06:13:29,341 - synapse.handlers.auth - 66 - INFO -  - Extra password_
providers: [<ldap_auth_provider.LdapAuthProvider object at 0x7f25cbc0a250>]

2017-06-30 06:13:52,817 - ldap_auth_provider - 403 - WARNING - POST-1 - Error du
ring LDAP authentication: socket connection error: [Errno -2] Name or service no
t known

LDAP filter not been honored

I've a synapse server running matrix-synapse-ldap3 (0.1.3) along with matrix-synapse (1.2.1).

The LDAP configuration is as follows:

password_providers:
  - module: "synapse.util.ldap_auth_provider.LdapAuthProvider"
    config:
       enabled: true
       uri: "ldap.mydomain.com"
       start_tls: false
       base: "ou=People,dc=mydomain,dc=com"
       attributes:
           uid: "uid"
           mail: "mail"
           name: "givenName"
       filter: "(&(mail=*@mydomain.com)(!(loginShell=/bin/false))(|(employeeType=type1)(employeeType=type2)(employeeType=type3)))"

What is happening is that people with employeeType type4 is been able to login into the server and that shouldn't be the case at all, as the OR conditional part will be False, making the whole statement to be False.

Am I missing something? Is there something wrong on the module side?

Many thanks in advance for taking a look.

ldaps:// doesn't work

from #10

with uri: "ldaps://ldap.example.com" connection still goes to port 389 (not port 636 as ldaps should).

ldap auth doesn't seem to work at all

Here's the relevant part of my homeserver.yaml:

password_providers:
 - module: "ldap_auth_provider.LdapAuthProvider"
   config:
     enabled: true
     uri: "ldap://<>389"
     start_tls: true
     base: "ou=People,dc=<>"
     attributes:
        uid: "uid"
        mail: "mail"
        name: "cn"

homeserver.log:

2017-02-01 05:07:31,298 - synapse.handlers.auth - 460 - WARNING - POST-0- Attempted to login as @viderizer:<> but they do not exist
2017-02-01 05:07:31,304 - synapse.http.server - 123 - INFO - POST-0- <SynapseRequest at 0x7fe4439ce8c0 method=POST uri=/_matrix/client/r0/login clientproto=HTTP/1.1 site=8008> SynapseError: 403 - Invalid password
2017-02-01 05:07:31,305 - synapse.access.http.8008 - 91 - INFO - POST-0- 127.0.0.1 - 8008 - {None} Processed request: 31ms (0ms, 12ms) (0ms/1) 52B 403 "POST /_matrix/client/r0/login HTTP/1.1" "None"

versions:

$ dpkg -l | egrep 'synapse|ldap3'
ii  matrix-synapse                 0.18.7-1                         all          Reference Synapse Home Server
ii  python-ldap3                   0.9.4.2-1                        all          Pure Python LDAP client library
ii  python-matrix-synapse-ldap3    0.1.1-1                          all          An LDAP3 auth provider for Synapse

What I expect: an ldap error or a succesful login. Neither happen, it's like the auth provider doesn't exist at all. I patched auth.py of synapse to list providers and there it is. Nothing in the check_password function seems to be executed at all. Help wanted!

Can't seem to get the module working at all on Ubuntu 18.04

Hi,

I'm sorry for opening a ticket for what maybe a trivial problem but I'm stuck for hours now. Basically this is a testsetup and I'm trying to get it working against our Active Directory.

I've an Ubuntu 18.04 with these packages installed from the matrix repository: https://matrix.org/packages/debian/

ii  matrix-synapse-ldap3                  0.1.2-1                           all          LDAP auth provider for the Matrix homeserver
ii  matrix-synapse-py3                    1.1.0+bionic1                     amd64        Open federated Instant Messaging and VoIP server

The config looks like this

password_providers:
 - module: "ldap_auth_provider.LdapAuthProvider"
   config:
     enabled: true
     uri: "ldap://dc1.lab"
     start_tls: false
     mode: "search"
     base: "dc=lab"
     attributes:
       uid: "cn"
       mail: "userPrincipalName"
       name: "givenName"
     bind_dn: "CN=Matrix Synapse,OU=Service Accounts,DC=lab"
     bind_password: "xxx"

The log config

loggers:
    synapse:
        level: DEBUG

    synapse.storage.SQL:
        level: INFO
    ldap3:
        level: DEBUG
    ldap_auth_provider:
        level: DEBUG

However when I'm trying a login the module does not seem to kick in at all:

2019-07-15 16:23:13,638 - synapse.rest.client.v1.login - 175 - INFO - POST-3- Got login request with identifier: {'type': 'm.id.thirdparty', 'medium': 'email', 'address': 'test@lab'}, medium: 'email', address: 'test@lab', user: None
2019-07-15 16:23:13,639 - synapse.storage.txn - 394 - DEBUG - POST-3- [TXN START] {get_user_id_by_threepid-2d}
2019-07-15 16:23:13,642 - synapse.storage.txn - 456 - DEBUG - POST-3- [TXN END] {get_user_id_by_threepid-2d} 0.003613 sec
2019-07-15 16:23:13,643 - synapse.rest.client.v1.login - 224 - WARNING - POST-3- unknown 3pid identifier medium email, address 'test@lab'
2019-07-15 16:23:13,646 - synapse.http.server - 79 - INFO - POST-3- <XForwardedForRequest at 0x7f20b8608fd0 method='POST' uri='/_matrix/client/r0/login' clientproto='HTTP/1.0' site=8008> SynapseError: 403 -

Also I don't see any connections in the AD log.

Does anyone have any pointers?

Numeric sAMAccountName

My problem is that all of my AD users account names are numeric. When I attempt to login using sAMAccountName, I get a SynapseError: 400 - Numeric user IDs are reserved for guest users message in the logs.

Changing my user accounts isn't a possibility. I was able to login when I changed the uid property to mailNickname, but it will be difficult/impossible to train my users to login with that property when they are so used to logging in with sAMAccountName.

Is it possible to prepend a string the uid?

What I mean is, a user logs into the homeserver with

  • username: ######
  • Password: Password

ldap3 looks up #####, and verifies the password, and then logs them in as @user_#####:matrix.example.com?

Or, maybe there's a better solution?

password_providers:
 - module: "ldap_auth_provider.LdapAuthProvider"
   config:
     enabled: true
     uri: "ldap://ldap.example.com:389"
     start_tls: true
     base: "OU=ou,DC=example,DC=com"
     attributes:
        uid: "sAMAccountName"
        mail: "mail"
        name: "cn"
     bind_dn: "CN=bind,DC=example,DC=com"
     bind_password: "bindpassword"

Thanks,
--John

Document how to increase the plugin log level to debug

This is the synapse config I used to increase the log level for the LDAP plugin:

version: 1

formatters:
  precise:
   format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s'

filters:
  context:
    (): synapse.util.logcontext.LoggingContextFilter
    request: ""

handlers:
  file:
    class: logging.handlers.RotatingFileHandler
    formatter: precise
    filename: /path/to/synapse/homeserver.log
    maxBytes: 104857600
    backupCount: 10
    filters: [context]
    level: DEBUG
  console:
    class: logging.StreamHandler
    formatter: precise
    filters: [context]

loggers:
    synapse:
        level: INFO

    synapse.storage.SQL:
        level: INFO

    ldap3:
        level: DEBUG

    ldap_auth_provider:
        level: DEBUG

root:
    level: INFO
    handlers: [file, console]

List of changes from the default generated config:

  • Set handlers -> file -> level to DEBUG
  • Added the loggers -> ldap3 and loggers -> ldap_auth_provider sections, both with level: DEBUG

This should be documented in the repository somewhere, perhaps in the main README.

Cant login with LDAP after update

Hi there,
Today I updated synapse to version 0.18.5. I use debian8 package for both matrix-synapse and python-matrix-synapse-ldap3, however after update, I can't no longer authenticate. This is the traceback:

Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/synapse/http/server.py", line 116, in wrapped_request_handler yield request_handler(self, request, request_metrics) AttributeError: 'NoneType' object has no attribute 'bind'

Am I missing something?

Problem with LDAP Login

Dear Support

We newly installed your matrix synapse server. After that, we installed the LDAP3 Module.

But when we activate the plugin, we get the following Error-Message:

Traceback (most recent call last): Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main Oct 29 07:22:40 matrix-riot python[2661]: "__main__", fname, loader, pkg_name) Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/runpy.py", line 72, in _run_code Oct 29 07:22:40 matrix-riot python[2661]: exec code in run_globals Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 582, in <module> Oct 29 07:22:40 matrix-riot python[2661]: main() Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 577, in main Oct 29 07:22:40 matrix-riot python[2661]: hs = setup(sys.argv[1:]) Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 323, in setup Oct 29 07:22:40 matrix-riot python[2661]: config_options, Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/dist-packages/synapse/config/_base.py", line 341, in load_or_generate_config Oct 29 07:22:40 matrix-riot python[2661]: generate_keys=generate_keys, Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/dist-packages/synapse/config/_base.py", line 385, in read_config_files Oct 29 07:22:40 matrix-riot python[2661]: self.invoke_all("read_config", config) Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/dist-packages/synapse/config/_base.py", line 165, in invoke_all Oct 29 07:22:40 matrix-riot python[2661]: results.append(getattr(cls, name)(self, *args, **kargs)) Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/dist-packages/synapse/config/password_auth_providers.py", line 48, in read_config Oct 29 07:22:40 matrix-riot python[2661]: "config": provider['config'], Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/dist-packages/synapse/util/module_loader.py", line 32, in load_module Oct 29 07:22:40 matrix-riot python[2661]: module = importlib.import_module(module) Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module Oct 29 07:22:40 matrix-riot python[2661]: __import__(name) Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/local/lib/python2.7/dist-packages/ldap_auth_provider.py", line 19, in <module> Oct 29 07:22:40 matrix-riot python[2661]: import ldap3 Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/local/lib/python2.7/dist-packages/ldap3/__init__.py", line 138, in <module> Oct 29 07:22:40 matrix-riot python[2661]: from .core.connection import Connection Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/local/lib/python2.7/dist-packages/ldap3/core/connection.py", line 37, in <module> Oct 29 07:22:40 matrix-riot python[2661]: from ..extend import ExtendedOperationsRoot Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/local/lib/python2.7/dist-packages/ldap3/extend/__init__.py", line 45, in <module> Oct 29 07:22:40 matrix-riot python[2661]: from .standard.whoAmI import WhoAmI Oct 29 07:22:40 matrix-riot python[2661]: File "/usr/local/lib/python2.7/dist-packages/ldap3/extend/standard/whoAmI.py", line 27, in <module> Oct 29 07:22:40 matrix-riot python[2661]: from pyasn1.type.univ import NoValue Oct 29 07:22:40 matrix-riot python[2661]: ImportError: cannot import name NoValue

Here is the configuration of the ldap module (Line 572 till 585):
password_providers: - module: "ldap_auth_provider.LdapAuthProvider" config: enabled: true uri: "ldaps://server:7636" start_tls: true base: "dc=domain,dc=net" attributes: uid: "uid" mail: "mailPrimaryAddress" name: "displayName" bind_dn: "authenication_name" bind_password: "authentication_pass" filter: "(objectClass=posixAccount)"

Many thanks in advance for your help, solving that issue.

Kind Regards

STAR AG IT Department

Tests not compatible with python 3

Tests fail with the following:

tests ...                                                               [ERROR]

===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/twisted/trial/runner.py", line 803, in loadByName
    return self.suiteFactory([self.findByName(name, recurse=recurse)])
  File "/usr/lib/python3.6/site-packages/twisted/trial/runner.py", line 732, in findByName
    obj = reflect.namedAny(name)
  File "/usr/lib/python3.6/site-packages/twisted/python/reflect.py", line 308, in namedAny
    topLevelPackage = _importAndCheckStack(trialname)
  File "/usr/lib/python3.6/site-packages/twisted/python/reflect.py", line 255, in _importAndCheckStack
    reraise(excValue, excTraceback)
  File "/var/tmp/portage/dev-python/matrix-synapse-ldap3-0.1.3/work/matrix-synapse-ldap3-0.1.3/tests/__init__.py", line 8, in <module>
    from cStringIO import StringIO
builtins.ModuleNotFoundError: No module named 'cStringIO'

The cStringIO module has been removed in python 3: https://stackoverflow.com/a/28204760

Active Directory authentication on matrix sypnase

Guys, please give me procedure step by step how to make my matrix synapse users authenticated via Active Directory... i do not know how to connect my active directory on my matrix synapse server... My OS is CentOS 7... Please help me guys... thanks and God Bless...

Consider using ldaptor

The current ldap3 library isn't async by default, so we defer all blocking calls to a thread pool. This is not ideal.

ladptor is a twisted LDAP library that is async by default.

Do LDAP password change

One feature which would be important in our implementation of riot/matrix/synapse is that, whenever user changes her password in the client, the password be also changed in LDAP.

Synapse today only stores the change in datastore, but doesn't set password in LDAP auth provider.

In validate_login, inside auth.py, there is a loop through providers to make the login. Maybe something like this should be done in set_password.py.

Same issue as matrix-org/synapse#3379 in Synapse.

Is there interest in an implementation like that? If so, we'd be happy to make a proposal. Or is there a reason for not implementing it?

LDAP auth results in "SynapseError: 400 - Missing JSON keys."

I'm trying to set up matrix-synapse with a simple LDAP (FreeIPA) authentication backend. I've configured homeserver.yaml as described in the README.

I'm on Debian stretch with the matrix-synapse repo so the package versions are:
matrix-synapse 0.25.1-1
python-matrix-synapse-ldap3 0.1.2-1

2017-12-14 03:24:32,724 - synapse.access.http.8008 - 59 - INFO - POST-4- 127.0.0.1 - 8008 - Received request: POST /_matrix/client/r0
/login
2017-12-14 03:24:32,725 - synapse.rest.client.v1.login - 177 - INFO - POST-4- Got login request with identifier: {'type': 'm.id.user'
, 'user': 'mueslo'}, medium: None, address: None, user: 'mueslo'
2017-12-14 03:24:32,726 - ldap_auth_provider - 91 - DEBUG - POST-4- Attempting LDAP connection with ldap://ipa.mueslo.de:389
2017-12-14 03:24:32,726 - ldap_auth_provider - 332 - DEBUG - POST-4- Established LDAP connection in search mode: ldap://ipa.mueslo.de
:389 - cleartext - user: uid=readonly,cn=sysaccounts,cn=etc,dc=mueslo,dc=de - unbound - closed - <no socket> - tls not started - not 
listening - SyncStrategy - internal decoder
2017-12-14 03:24:32,772 - ldap_auth_provider - 365 - DEBUG - POST-4- LDAP search filter: (uid=mueslo)
2017-12-14 03:24:32,774 - ldap_auth_provider - 376 - DEBUG - POST-4- LDAP search found dn: uid=mueslo,cn=users,cn=accounts,dc=mueslo,
dc=de
2017-12-14 03:24:32,775 - ldap_auth_provider - 277 - DEBUG - POST-4- Established LDAP connection in simple bind mode: ldap://ipa.mues
lo.de:389 - cleartext - user: uid=mueslo,cn=users,cn=accounts,dc=mueslo,dc=de - unbound - closed - <no socket> - tls not started - no
t listening - SyncStrategy - internal decoder
2017-12-14 03:24:32,782 - ldap_auth_provider - 291 - DEBUG - POST-4- LDAP Bind successful in simple bind mode.
2017-12-14 03:24:32,782 - ldap_auth_provider - 119 - DEBUG - POST-4- LDAP auth method authenticated search returned: True (conn: ldap
://ipa.mueslo.de:389 - cleartext - user: uid=mueslo,cn=users,cn=accounts,dc=mueslo,dc=de - bound - open - <local: 192.168.1.3:60986 -
 remote: 192.168.1.4:389> - tls not started - listening - SyncStrategy - internal decoder)
2017-12-14 03:24:32,782 - ldap_auth_provider - 133 - INFO - POST-4- User authenticated against LDAP server: ldap://ipa.mueslo.de:389 
- cleartext - user: uid=mueslo,cn=users,cn=accounts,dc=mueslo,dc=de - bound - open - <local: 192.168.1.3:60986 - remote: 192.168.1.4:
389> - tls not started - listening - SyncStrategy - internal decoder
2017-12-14 03:24:32,783 - synapse.handlers.auth - 479 - WARNING - POST-4- Attempted to login as @mueslo:matrix.mueslo.de but they do 
not exist
2017-12-14 03:24:32,784 - ldap_auth_provider - 163 - DEBUG - POST-4- ldap registration filter: (uid=mueslo)
2017-12-14 03:24:32,790 - synapse.http.server - 123 - INFO - POST-4- <SynapseRequest at 0x7f9714396fc8 method=POST uri=/_matrix/clien
t/r0/login clientproto=HTTP/1.0 site=8008> SynapseError: 400 - Missing JSON keys.
2017-12-14 03:24:32,791 - synapse.access.http.8008 - 91 - INFO - POST-4- 127.0.0.1 - 8008 - {None} Processed request: 66ms (4ms, 0ms)
 (0ms/1) 67B 400 "POST /_matrix/client/r0/login HTTP/1.0" "Riot.im/0.7.06 (Linux; U; Android 7.1.2; A0001 Build/NJH47; Flavour GooglePlay; MatrixAndroidSDK 0.8.06)"

Yes, the user has a mail attribute. Yes, the LDAP bind can see it (manually verified via ldapsearch).

Fail to run test suite

Hi,
I’m in the process of packaging this for gentoo, while running tests to verify I integrate them correctly in the ebuild, I hit some failures.
Could you give me some suggestion in order to make them pass (assuming I did a mistake), or help fix whats causing them (if its a legit failure)?

ebuild (mostly to give you the python_test() phase)

EAPI=7
PYTHON_COMPAT=( python2_7 python3_{5,6} )
inherit distutils-r1
DESCRIPTION="LDAP server, client and utilities, using Twisted Python"
HOMEPAGE="https://github.com/twisted/ldaptor"
SRC_URI="https://github.com/twisted/ldaptor/archive/${PV}.tar.gz"
S="${WORKDIR}/ldaptor-${PV}"

LICENSE="MIT BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"

DEPEND="${PYTHON_DEPS}
	dev-python/pycrypto
	dev-python/twisted
	dev-python/pyopenssl
	dev-python/pyparsing
	dev-python/six
	dev-python/zope-interface"
DEPEND="${RDEPEND}
	test? ( dev-python/service_identity )"

python_test() {
	"${EPYTHON}" -m twisted.trial ldaptor || die "Failed tests with ${EPYTHON}"
}

Build.log

�[32;01m * �[39;49;00mPackage:    dev-python/twisted-ldaptor-16.0.0
�[32;01m * �[39;49;00mRepository: nado
�[32;01m * �[39;49;00mMaintainer: [email protected]
�[32;01m * �[39;49;00mUSE:        abi_x86_64 amd64 elibc_glibc kernel_linux python_targets_python2_7 python_targets_python3_6 test userland_GNU
�[32;01m * �[39;49;00mFEATURES:   preserve-libs sandbox test userpriv usersandbox
>>> Unpacking source...
>>> Unpacking 16.0.0.tar.gz to /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work
>>> Source unpacked in /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work
>>> Preparing source in /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0 ...
 �[32;01m*�[0m python2_7: running distutils-r1_run_phase distutils-r1_python_compile
python2.7 setup.py build
running build
running build_py
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/usage.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/testutil.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/schema.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/numberalloc.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/md4.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/ldiftree.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/ldapfilter.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/interfaces.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/insensitive.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/inmemory.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/generate_password.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/entryhelpers.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/entry.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/dns.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/delta.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/config.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/compat.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/checkers.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/attributeset.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
copying ldaptor/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols
copying ldaptor/protocols/pureldap.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols
copying ldaptor/protocols/pureber.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols
copying ldaptor/protocols/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/svcbindproxy.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/proxybase.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/proxy.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/merger.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldifprotocol.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldifdelta.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldif.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldapsyntax.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldapserver.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldaperrors.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldapconnector.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldapclient.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/fetchschema.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/distinguishedname.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap/autofill
copying ldaptor/protocols/ldap/autofill/sambaSamAccount.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap/autofill
copying ldaptor/protocols/ldap/autofill/sambaAccount.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap/autofill
copying ldaptor/protocols/ldap/autofill/posixAccount.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap/autofill
copying ldaptor/protocols/ldap/autofill/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/protocols/ldap/autofill
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/samba
copying ldaptor/samba/smbpassword.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/samba
copying ldaptor/samba/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/samba
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/util.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_svcbindproxy.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_smbpassword.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_server.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_schema.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_pureldap.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_pureber.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_proxybase.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_proxy.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_merger.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_match.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_ldiftree.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_ldifprotocol.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_ldifdelta.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_ldapsyntax.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_ldapfilter.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_ldapclient.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_inmemory.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_fetchschema.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_entry_diff.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_dns.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_distinguishedname.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_delta.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_connector.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_config.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_autofill_samba.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_autofill_posix.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_autofill.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/test_attributeset.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
copying ldaptor/test/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/lib/ldaptor/test
warning: build_py: byte-compiling is disabled, skipping.

running build_scripts
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-ldap2dhcpconf -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-ldap2maradns -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-ldap2dnszones -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-search -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-namingcontexts -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-passwd -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-ldap2passwd -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-getfreenumber -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-ldap2pdns -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-find-server -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-rename -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-fetchschema -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-ldifdiff -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
copying and adjusting bin/ldaptor-ldifpatch -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-ldap2dhcpconf from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-ldap2maradns from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-ldap2dnszones from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-search from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-namingcontexts from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-passwd from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-ldap2passwd from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-getfreenumber from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-ldap2pdns from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-find-server from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-rename from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-fetchschema from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-ldifdiff from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python2_7/scripts/ldaptor-ldifpatch from 644 to 755
 �[32;01m*�[0m python3_6: running distutils-r1_run_phase distutils-r1_python_compile
python3.6 setup.py build -j 3
running build
running build_py
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/usage.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/testutil.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/schema.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/numberalloc.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/md4.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/ldiftree.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/ldapfilter.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/interfaces.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/insensitive.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/inmemory.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/generate_password.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/entryhelpers.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/entry.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/dns.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/delta.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/config.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/compat.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/checkers.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/attributeset.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
copying ldaptor/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols
copying ldaptor/protocols/pureldap.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols
copying ldaptor/protocols/pureber.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols
copying ldaptor/protocols/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/svcbindproxy.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/proxybase.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/proxy.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/merger.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldifprotocol.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldifdelta.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldif.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldapsyntax.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldapserver.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldaperrors.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldapconnector.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/ldapclient.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/fetchschema.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/distinguishedname.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
copying ldaptor/protocols/ldap/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap/autofill
copying ldaptor/protocols/ldap/autofill/sambaSamAccount.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap/autofill
copying ldaptor/protocols/ldap/autofill/sambaAccount.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap/autofill
copying ldaptor/protocols/ldap/autofill/posixAccount.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap/autofill
copying ldaptor/protocols/ldap/autofill/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/protocols/ldap/autofill
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/samba
copying ldaptor/samba/smbpassword.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/samba
copying ldaptor/samba/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/samba
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/util.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_svcbindproxy.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_smbpassword.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_server.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_schema.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_pureldap.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_pureber.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_proxybase.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_proxy.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_merger.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_match.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_ldiftree.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_ldifprotocol.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_ldifdelta.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_ldapsyntax.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_ldapfilter.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_ldapclient.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_inmemory.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_fetchschema.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_entry_diff.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_dns.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_distinguishedname.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_delta.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_connector.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_config.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_autofill_samba.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_autofill_posix.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_autofill.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/test_attributeset.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
copying ldaptor/test/__init__.py -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/lib/ldaptor/test
warning: build_py: byte-compiling is disabled, skipping.

running build_scripts
creating /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-ldap2dhcpconf -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-ldap2maradns -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-ldap2dnszones -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-search -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-namingcontexts -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-passwd -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-ldap2passwd -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-getfreenumber -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-ldap2pdns -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-find-server -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-rename -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-fetchschema -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-ldifdiff -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
copying and adjusting bin/ldaptor-ldifpatch -> /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-ldap2dhcpconf from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-ldap2maradns from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-ldap2dnszones from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-search from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-namingcontexts from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-passwd from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-ldap2passwd from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-getfreenumber from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-ldap2pdns from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-find-server from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-rename from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-fetchschema from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-ldifdiff from 644 to 755
changing mode of /var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0-python3_6/scripts/ldaptor-ldifpatch from 644 to 755
>>> Source compiled.
>>> Test phase: dev-python/twisted-ldaptor-16.0.0
 �[32;01m*�[0m python2_7: running distutils-r1_run_phase python_test
ldaptor.test.test_attributeset
  TestComparison
    testEquality_False_Key ...                                             [OK]
    testEquality_False_Value ...                                           [OK]
    testEquality_True_List ...                                             [OK]
    testEquality_True_List_Ordering ...                                    [OK]
    testEquality_True_Set ...                                              [OK]
    testEquality_True_Set_Ordering ...                                     [OK]
  TestSetOperations
    testCopy ...                                                           [OK]
    testDeepCopy ...                                                       [OK]
    testDifference ...                                                     [OK]
    testIntersection ...                                                   [OK]
    testSymmetricDifference ...                                            [OK]
    testUnion ...                                                          [OK]
ldaptor.test.test_autofill
  LDAPAutoFill_Simple
    testSimpleSum ...                                                      [OK]
ldaptor.test.test_autofill_posix
  LDAPAutoFill_Posix
    testDefaultSetting ...                                                 [OK]
    testMustHaveObjectClass ...                                            [OK]
ldaptor.test.test_autofill_samba
  LDAPAutoFill_sambaAccount
    testDefaultSetting ...                                                 [OK]
    testMustHaveObjectClass ...                                            [OK]
    testPrimaryGroupId ...                                                 [OK]
    testRid ...                                                            [OK]
  LDAPAutoFill_sambaSamAccount
    testDefaultSetting ...                                                 [OK]
    testDefaultSetting_fixedPrimaryGroupSID ...                            [OK]
    testMustHaveObjectClass ...                                            [OK]
    testSambaPrimaryGroupSID ...                                           [OK]
    testSambaPrimaryGroupSID_notUpdatedWhenFixed ...                       [OK]
    testSambaPrimaryGroupSID_preExisting ...                               [OK]
    testSambaSID ...                                                       [OK]
    testSambaSID_preExisting ...                                           [OK]
ldaptor.test.test_config
  IdentitySearch
    testConfig ...                                                         [OK]
    testCopy ...                                                           [OK]
    testInitArg ...                                                        [OK]
  TestConfig
    testSomething ...                                                      [OK]
ldaptor.test.test_connector
  TestCallableOverride
    testFindOverride_plainString ...                                       [OK]
    testFindOverride_root ...                                              [OK]
    testSimple ...                                                         [OK]
ldaptor.test.test_delta
  TestAddOpLDIF
    testSimple ...                                                         [OK]
  TestDeleteOpLDIF
    testSimple ...                                                         [OK]
  TestModificationComparison
    testEquality_AddVsDelete_False ...                                     [OK]
    testEquality_Add_True ...                                              [OK]
    testEquality_AttributeSet_False ...                                    [OK]
    testEquality_List_False ...                                            [OK]
  TestModificationOpLDIF
    testAdd ...                                                            [OK]
    testDelete ...                                                         [OK]
    testDeleteAll ...                                                      [OK]
    testReplace ...                                                        [OK]
    testReplaceAll ...                                                     [OK]
  TestModifications
    testAddNew ...                                                         [OK]
    testAddOld ...                                                         [OK]
    testDelete ...                                                         [OK]
    testDeleteAll ...                                                      [OK]
    testDelete_FailOnNonExistingAttributeType_All ...                      [OK]
    testDelete_FailOnNonExistingAttributeType_OneValue ...                 [OK]
    testDelete_FailOnNonExistingAttributeValue ...                         [OK]
    testReplace_Add ...                                                    [OK]
    testReplace_Delete_Existing ...                                        [OK]
    testReplace_Delete_NonExisting ...                                     [OK]
    testReplace_Modify ...                                                 [OK]
  TestOperationLDIF
    testModify ...                                                         [OK]
  TestOperations
    testAddOp_DNExists ...                                                 [OK]
    testDeleteOp_DNNotFound ...                                            [OK]
    testModifyOp_DNNotFound ...                                            [OK]
ldaptor.test.test_distinguishedname
  DistinguishedName_Comparison
    testGT ...                                                             [OK]
  DistinguishedName_Init
    testDN ...                                                             [OK]
    testString ...                                                         [OK]
  LDAPDistinguishedName_DomainName
    testInterleaved_SubHostSubExampleCom ...                               [OK]
    testNonDc ...                                                          [OK]
    testNonTrailingDc ...                                                  [OK]
    testSimple_ExampleCom ...                                              [OK]
    testSimple_HostSubExampleCom ...                                       [OK]
    testSimple_SubExampleCom ...                                           [OK]
  LDAPDistinguishedName_Escaping
    testKnownValues ...                                                    [OK]
    testOpenLDAPEqualsEscape ...                                           [OK]
  LDAPDistinguishedName_InitialSpaces
    testKnownValues ...                                                    [OK]
  LDAPDistinguishedName_Malformed
    testMalformed ...                                                      [OK]
  LDAPDistinguishedName_Prettify
    testPrettifySpaces ...                                                 [OK]
  LDAPDistinguishedName_RFC2253_Examples
    testKnownValues ...                                                    [OK]
  LDAPDistinguishedName_contains
    test_nonContainment_nonParents ...                                     [OK]
    test_nonContainment_parents ...                                        [OK]
    test_realContainment ...                                               [OK]
    test_selfContainment ...                                               [OK]
  RelativeDistinguishedName_Init
    testRDN ...                                                            [OK]
    testString ...                                                         [OK]
  TestCaseWithKnownValues
    testKnownValues ...                                                    [OK]
ldaptor.test.test_dns
  NetmaskToNumbits
    test_CIDR ...                                                          [OK]
    test_classA ...                                                        [OK]
    test_classB ...                                                        [OK]
    test_classC ...                                                        [OK]
    test_host ...                                                          [OK]
    test_numbits ...                                                       [OK]
  PtrSoaName
    test_CIDR_12 ...                                                       [OK]
    test_CIDR_13 ...                                                       [OK]
    test_CIDR_15 ...                                                       [OK]
    test_CIDR_29 ...                                                       [OK]
    test_CIDR_30 ...                                                       [OK]
    test_CIDR_9 ...                                                        [OK]
    test_classA ...                                                        [OK]
    test_classB ...                                                        [OK]
    test_classC ...                                                        [OK]
ldaptor.test.test_entry_diff
  TestDiffEntry
    testAdd_Existing_OneType_ManyValues ...                                [OK]
    testAdd_Existing_OneType_OneValue ...                                  [OK]
    testAdd_NewAndExisting_ManyTypes ...                                   [OK]
    testAdd_New_ManyTypes ...                                              [OK]
    testAdd_New_OneType_ManyValues ...                                     [OK]
    testAdd_New_OneType_OneValue ...                                       [OK]
    testComplex ...                                                        [OK]
    testDelete_All_OneType ...                                             [OK]
    testDelete_Some_OneType ...                                            [OK]
    testEqual ...                                                          [OK]
ldaptor.test.test_fetchschema
  OnWire
    testSimple ...                                                         [OK]
ldaptor.test.test_inmemory
  FromLDIF
    test_missingNode ...                                                   [OK]
    test_single ...                                                        [OK]
    test_two ...                                                           [OK]
  TestDiff
    testAddChild ...                                                       [OK]
    testAddSubtree ...                                                     [OK]
    testChildChange_Add ...                                                [OK]
    testDeleteChild ...                                                    [OK]
    testDeleteSubtree ...                                                  [OK]
    testNoChange ...                                                       [OK]
    testRootChange_Add ...                                                 [OK]
  TestInMemoryDatabase
    testSearch_withCallback ...                                            [OK]
    testSearch_withoutCallback ...                                         [OK]
    test_addChild ...                                                      [OK]
    test_addChild_Exists ...                                               [OK]
    test_children_empty ...                                                [OK]
    test_children_oneChild ...                                             [OK]
    test_children_repeat ...                                               [OK]
    test_children_twoChildren ...                                          [OK]
    test_commit ...                                                        [OK]
    test_delete ...                                                        [OK]
    test_deleteChild ...                                                   [OK]
    test_deleteChild_NonExisting ...                                       [OK]
    test_delete_nonLeaf ...                                                [OK]
    test_delete_root ...                                                   [OK]
    test_lookup_deep ...                                                   [OK]
    test_lookup_fail ...                                                   [OK]
    test_lookup_fail_outOfTree ...                                         [OK]
    test_move_children_newSuperior ...                                     [OK]
    test_move_children_sameSuperior ...                                    [OK]
    test_move_noChildren_newSuperior ...                                   [OK]
    test_move_noChildren_sameSuperior ...                                  [OK]
    test_parent ...                                                        [OK]
    test_setPassword ...                                                   [OK]
    test_setPassword_noSalt ...                                            [OK]
    test_subtree_empty ...                                                 [OK]
    test_subtree_many ...                                                  [OK]
    test_subtree_many_cb ...                                               [OK]
    test_subtree_oneChild ...                                              [OK]
    test_subtree_oneChild_cb ...                                           [OK]
ldaptor.test.test_ldapclient
  ConnectionLost
    test_simple ...                                                        [OK]
ldaptor.test.test_ldapfilter
  RFC2254Examples
    test_and_or ...                                                        [OK]
    test_cn ...                                                            [OK]
    test_escape_asterisk ...                                               [OK]
    test_escape_backslash ...                                              [OK]
    test_escape_binary ...                                                 [OK]
    test_escape_parens ...                                                 [OK]
    test_escape_utf8 ...                                                   [OK]
    test_extensible_1 ...                                                  [OK]
    test_extensible_2 ...                                                  [OK]
    test_extensible_3 ...                                                  [OK]
    test_extensible_4 ...                                                  [OK]
    test_not_cn ...                                                        [OK]
    test_substrings ...                                                    [OK]
  TestInvalid
    test_closeParen_1 ...                                                  [OK]
    test_closeParen_2 ...                                                  [OK]
    test_closeParen_3 ...                                                  [OK]
    test_closeParen_4 ...                                                  [OK]
    test_openParen_1 ...                                                   [OK]
    test_openParen_2 ...                                                   [OK]
    test_openParen_3 ...                                                   [OK]
    test_openParen_4 ...                                                   [OK]
    test_whitespace_afterOpenParen ...                                     [OK]
    test_whitespace_beforeEq ...                                           [OK]
    test_whitespace_leading ...                                            [OK]
    test_whitespace_trailing ...                                           [OK]
  TestMaybeSubstring
    test_escape_simple ...                                                 [OK]
    test_item_present ...                                                  [OK]
    test_item_simple ...                                                   [OK]
    test_item_substring_aa ...                                             [OK]
    test_item_substring_aaf ...                                            [OK]
    test_item_substring_af ...                                             [OK]
    test_item_substring_any ...                                            [OK]
    test_item_substring_final ...                                          [OK]
    test_item_substring_ia ...                                             [OK]
    test_item_substring_iaa ...                                            [OK]
    test_item_substring_iaaf ...                                           [OK]
    test_item_substring_iaf ...                                            [OK]
    test_item_substring_if ...                                             [OK]
    test_item_substring_init ...                                           [OK]
  TestValid
    test_and_item ...                                                      [OK]
    test_andornot ...                                                      [OK]
    test_item_present ...                                                  [OK]
    test_item_simple ...                                                   [OK]
    test_item_substring_aa ...                                             [OK]
    test_item_substring_aaf ...                                            [OK]
    test_item_substring_af ...                                             [OK]
    test_item_substring_any ...                                            [OK]
    test_item_substring_final ...                                          [OK]
    test_item_substring_ia ...                                             [OK]
    test_item_substring_iaa ...                                            [OK]
    test_item_substring_iaaf ...                                           [OK]
    test_item_substring_iaf ...                                            [OK]
    test_item_substring_if ...                                             [OK]
    test_item_substring_init ...                                           [OK]
    test_not_item ...                                                      [OK]
    test_or_item ...                                                       [OK]
    test_whitespace_afterEq ...                                            [OK]
    test_whitespace_beforeCloseParen ...                                   [OK]
  TestWhitespace
    test_escape ...                                                        [OK]
ldaptor.test.test_ldapsyntax
  Bind
    test_err ...                                                           [OK]
    test_fail ...                                                          [OK]
    test_ok ...                                                            [OK]
  LDAPSyntaxAddChild
    testAddChildOnWire ...                                                 [OK]
  LDAPSyntaxAttributes
    testAttributeAdd ...                                                   [OK]
    testAttributeDelete ...                                                [OK]
    testAttributeItemDelete ...                                            [OK]
    testAttributeSetting ...                                               [OK]
    testUndo ...                                                           [OK]
    testUndoAfterCommit ...                                                [OK]
    testUndoJournaling ...                                                 [OK]
  LDAPSyntaxAttributesModificationOnWire
    testAdd ...                                                            [OK]
    testAddSeparate ...                                                    [OK]
    testDeleteAllAttribute ...                                             [OK]
    testDeleteAttribute ...                                                [OK]
    testReplaceAttributes ...                                              [OK]
  LDAPSyntaxBasics
    testCreation ...                                                       [OK]
    testIn ...                                                             [OK]
    testItems ...                                                          [OK]
    testKeys ...                                                           [OK]
  LDAPSyntaxContainingNamingContext
    testNamingContext ...                                                  [OK]
  LDAPSyntaxDNs
    testDNKeyExistenceSuccess ...                                          [OK]
  LDAPSyntaxDelete
    testDeleteInvalidates ...                                              [OK]
    testDeleteOnWire ...                                                   [OK]
    testErrorHandling ...                                                  [OK]
    testErrorHandling_extended ...                                         [OK]
  LDAPSyntaxFetch
    testCommitAndFetch ...                                                 [OK]
    testFetch_Empty ...                                                    [OK]
    testFetch_Partial ...                                                  [OK]
    testFetch_Prefilled ...                                                [OK]
    testFetch_WithDirtyJournal ...                                         [OK]
  LDAPSyntaxLDIF
    testLDIFConversion ...                                                 [OK]
  LDAPSyntaxMove
    test_move ...                                                          [OK]
  LDAPSyntaxPasswords
    testPasswordSettingAll_hasSamba ...                                    [OK]
    testPasswordSettingAll_hasSambaSam ...                                 [OK]
    testPasswordSettingAll_hasSambaSam_differentCase ...                   [OK]
    testPasswordSettingAll_hasSamba_differentCase ...                      [OK]
    testPasswordSettingAll_maybeSamba_WillFind ...                         [OK]
    testPasswordSettingAll_maybeSamba_WillNotFind ...                      [OK]
    testPasswordSettingAll_maybeSamba_WillNotFindAnything ...              [OK]
    testPasswordSettingAll_noSamba ...                                     [OK]
    testPasswordSetting_ExtendedOperation ...                              [OK]
    testPasswordSetting_Samba_badStyle ...                                 [OK]
    testPasswordSetting_Samba_defaultStyle ...                             [OK]
    testPasswordSetting_Samba_sambaAccount ...                             [OK]
    testPasswordSetting_Samba_sambaSamAccount ...                          [OK]
    testPasswordSetting_abortsOnFirstError ...                             [OK]
  LDAPSyntaxRDNHandling
    testRemovingRDNFails ...                                               [OK]
  LDAPSyntaxSearch
    testSearch ...                                                         [OK]
    testSearch_ImmediateProcessing ...                                     [OK]
    testSearch_defaultAttributes ...                                       [OK]
    testSearch_err ...                                                     [OK]
    testSearch_fail ...                                                    [OK]
    testSearch_noAttributes ...                                            [OK]
ldaptor.test.test_ldifdelta
  TestLDIFDeltaParsing
    testAdd ...                                                            [OK]
    testAdd_fail_noAttrvals ...                                            [OK]
    testDelete ...                                                         [OK]
    testModification_complex ...                                           [OK]
    testModification_empty ...                                             [OK]
    testModification_fail_differentKey ...                                 [OK]
    testModification_fail_noDash_1 ...                                     [OK]
    testModification_fail_noDash_2 ...                                     [OK]
    testModification_fail_unknownModSpec ...                               [OK]
    testModification_oneAdd ...                                            [OK]
    testModification_twoAdds ...                                           [OK]
    testNoChangeType ...                                                   [OK]
ldaptor.test.test_ldifprotocol
  RFC2849_Examples
    testExamples ...                                                       [OK]
  TestLDIFParsing
    testCaseInsensitiveAttributeTypes ...                                  [OK]
    testFromLDIF ...                                                       [OK]
    testNoSpaces ...                                                       [OK]
    testSplitLines ...                                                     [OK]
    testTruncatedFailure ...                                               [OK]
    testVersion1 ...                                                       [OK]
    testVersion2 ...                                                       [OK]
    testVersionInvalid ...                                                 [OK]
ldaptor.test.test_ldiftree
  Dir2LDIF
    testEmptyError ...                                                     [OK]
    testMissingEndError ...                                                [OK]
    testMultipleError ...                                                  [OK]
    testNoAccess ...                                                       [OK]
    testOnlyNewlineError ...                                               [OK]
    testSimpleRead ...                                                     [OK]
    testTreeBranches ...                                                   [OK]
  LDIF2Dir
    testAddTopLevel ...                                                    [OK]
    testDirCreation ...                                                    [OK]
    testDirExists ...                                                      [OK]
    testMissingLinkError ...                                               [OK]
    testSimpleWrite ...                                                    [OK]
  Tree
    test_addChild ...                                                      [OK]
    test_addChild_Exists ...                                               [OK]
    test_children_empty ...                                                [OK]
    test_children_noAccess_dir_noExec ...                                  [OK]
    test_children_noAccess_dir_noRead ...                                  [OK]
    test_children_noAccess_file ...                                        [OK]
    test_children_oneChild ...                                             [OK]
    test_children_repeat ...                                               [OK]
    test_children_twoChildren ...                                          [OK]
    test_children_twoChildren_callback ...                                 [OK]
    test_delete ...                                                        [OK]
    test_deleteChild ...                                                   [OK]
    test_deleteChild_NonExisting ...                                       [OK]
    test_delete_nonLeaf ...                                                [OK]
    test_delete_root ...                                                   [OK]
    test_diffTree_addChild ...                                             [OK]
    test_diffTree_copy ...                                                 [OK]
    test_diffTree_delChild ...                                             [OK]
    test_diffTree_edit ...                                                 [OK]
    test_diffTree_self ...                                                 [OK]
    test_lookup_deep ...                                                   [OK]
    test_lookup_fail ...                                                   [OK]
    test_lookup_fail_emptyError ...                                        [OK]
    test_lookup_fail_multipleError ...                                     [OK]
    test_lookup_fail_outOfTree ...                                         [OK]
    test_lookup_fail_outOfTree_2 ...                                       [OK]
    test_move_children_newSuperior ...                                     [OK]
    test_move_children_sameSuperior ...                                    [OK]
    test_move_noChildren_newSuperior ...                                   [OK]
    test_move_noChildren_sameSuperior ...                                  [OK]
    test_parent ...                                                        [OK]
    test_setPassword ...                                                   [OK]
    test_setPassword_noSalt ...                                            [OK]
    test_subtree_empty ...                                                 [OK]
    test_subtree_many ...                                                  [OK]
    test_subtree_many_cb ...                                               [OK]
    test_subtree_oneChild ...                                              [OK]
    test_subtree_oneChild_cb ...                                           [OK]
ldaptor.test.test_match
  TestEntryMatch
    test_and_match ...                                                     [OK]
    test_and_noMatch ...                                                   [OK]
    test_equality_match ...                                                [OK]
    test_equality_match_caseInsensitive ...                                [OK]
    test_equality_noMatch ...                                              [OK]
    test_extensibleMatch4 ...                                              [OK]
    test_extensibleMatch4_noMatch ...                                      [OK]
    test_greaterOrEqual_match_equal ...                                    [OK]
    test_greaterOrEqual_match_greater ...                                  [OK]
    test_greaterOrEqual_noMatch ...                                        [OK]
    test_greaterOrEqual_noMatch_nosuchattr ...                             [OK]
    test_lessOrEqual_match_equal ...                                       [OK]
    test_lessOrEqual_match_less ...                                        [OK]
    test_lessOrEqual_noMatch ...                                           [OK]
    test_lessOrEqual_noMatch_nosuchattr ...                                [OK]
    test_matchAll ...                                                      [OK]
    test_not ...                                                           [OK]
    test_notImplemented ...                                                [OK]
    test_or_match ...                                                      [OK]
    test_or_noMatch ...                                                    [OK]
    test_present_match ...                                                 [OK]
    test_present_noMatch ...                                               [OK]
    test_substrings_match ...                                              [OK]
    test_substrings_match2 ...                                             [OK]
    test_substrings_match3 ...                                             [OK]
    test_substrings_match4 ...                                             [OK]
    test_substrings_match5 ...                                             [OK]
    test_substrings_match6 ...                                             [OK]
    test_substrings_match7 ...                                             [OK]
    test_substrings_noMatch ...                                            [OK]
    test_substrings_noMatch2 ...                                           [OK]
ldaptor.test.test_merger
  MergedLDAPServerTest
    test_bind_both_invalid ...                                          [ERROR]
    test_bind_both_success ...                                          [ERROR]
    test_bind_one_invalid ...                                           [ERROR]
    test_search_merged ...                                              [ERROR]
    test_search_one_invalid ...                                         [ERROR]
    test_unbind_clientEOF ...                                           [ERROR]
    test_unbind_clientUnbinds ...                                       [ERROR]
    test_unwilling_to_perform ...                                       [ERROR]
ldaptor.test.test_proxy
  Proxy
    test_bind ...                                                       [ERROR]
    test_search ...                                                     [ERROR]
    test_unbind_clientEOF ...                                           [ERROR]
    test_unbind_clientUnbinds ...                                       [ERROR]
ldaptor.test.test_proxybase
  ProxyBase
    test_bind ...                                                          [OK]
    test_cannot_connect_to_proxied_server_no_pending_requests ...          [OK]
    test_cannot_connect_to_proxied_server_pending_requests ...             [OK]
    test_intercepted_search_request ...                                    [OK]
    test_intercepted_search_response ...                                   [OK]
    test_search ...                                                        [OK]
    test_unbind_clientEOF ...                                              [OK]
    test_unbind_clientUnbinds ...                                          [OK]
ldaptor.test.test_pureber
  BERBaseEquality
    testBERBaseEquality ...                                                [OK]
    testBERBaseInEquality ...                                              [OK]
  BERBooleanKnownValues
    testFromBERBooleanKnownValues ...                                      [OK]
    testPartialBERBooleanEncodings ...                                     [OK]
    testToBERBooleanKnownValues ...                                        [OK]
  BEREnumeratedKnownValues
    testFromBEREnumeratedKnownValues ...                                   [OK]
    testPartialBEREnumeratedEncodings ...                                  [OK]
    testToBEREnumeratedKnownValues ...                                     [OK]
  BEREnumeratedSanityCheck
    testSanity ...                                                         [OK]
  BERIntegerKnownValues
    testFromBERIntegerKnownValues ...                                      [OK]
    testPartialBERIntegerEncodings ...                                     [OK]
    testToBERIntegerKnownValues ...                                        [OK]
  BERIntegerSanityCheck
    testSanity ...                                                         [OK]
  BERNullKnownValues
    testFromBERNullKnownValues ...                                         [OK]
    testPartialBERNullEncodings ...                                        [OK]
    testToBERNullKnownValues ...                                           [OK]
  BEROctetStringKnownValues
    testFromBEROctetStringKnownValues ...                                  [OK]
    testPartialBEROctetStringEncodings ...                                 [OK]
    testToBEROctetStringKnownValues ...                                    [OK]
  BEROctetStringSanityCheck
    testSanity ...                                                         [OK]
  BERSequenceKnownValues
    testFromBERSequenceKnownValues ...                                     [OK]
    testPartialBERSequenceEncodings ...                                    [OK]
    testToBERSequenceKnownValues ...                                       [OK]
  BerLengths
    testFromBER ...                                                        [OK]
    testPartialBER ...                                                     [OK]
    testToBER ...                                                          [OK]
ldaptor.test.test_pureldap
  KnownValues
    testFromLDAP ...                                                       [OK]
    testPartial ...                                                        [OK]
    testToLDAP ...                                                         [OK]
  Substrings
    test_length ...                                                        [OK]
  TestEquality
    testEquality ...                                                       [OK]
    testInEquality ...                                                     [OK]
ldaptor.test.test_schema
  AttributeType_KnownValues
    testParse ...                                                          [OK]
    testStringification ...                                                [OK]
  ObjectClass_KnownValues
    testParse ...                                                          [OK]
    testStringification ...                                                [OK]
  TestComparison
    test_eq ...                                                            [OK]
    test_ne ...                                                            [OK]
    test_order ...                                                         [OK]
ldaptor.test.test_server
  LDAPServerTest
    test_add_fail_existsAlready ...                                        [OK]
    test_add_success ...                                                   [OK]
    test_bind ...                                                          [OK]
    test_bind_badVersion_1_anonymous ...                                   [OK]
    test_bind_badVersion_2_anonymous ...                                   [OK]
    test_bind_badVersion_4_anonymous ...                                   [OK]
    test_bind_badVersion_4_nonExisting ...                                 [OK]
    test_bind_invalidCredentials_badPassword ...                           [OK]
    test_bind_invalidCredentials_nonExisting ...                           [OK]
    test_bind_success ...                                                  [OK]
    test_control_unknown_critical ...                                      [OK]
    test_control_unknown_nonCritical ...                                   [OK]
    test_delete ...                                                        [OK]
    test_extendedRequest_unknown ...                                       [OK]
    test_modify ...                                                        [OK]
    test_modifyDN_rdnOnly_deleteOldRDN_success ...                         [OK]
    test_modifyDN_rdnOnly_noDeleteOldRDN_success ...                     [TODO]
    test_passwordModify_notBound ...                                       [OK]
    test_passwordModify_simple ...                                         [OK]
    test_rootDSE ...                                                       [OK]
    test_search_matchAll_manyResults ...                                   [OK]
    test_search_matchAll_oneResult ...                                     [OK]
    test_search_matchAll_oneResult_filtered ...                            [OK]
    test_search_matchAll_oneResult_filteredNoAttribsRemaining ...          [OK]
    test_search_outOfTree ...                                              [OK]
    test_search_scope_baseObject ...                                       [OK]
    test_search_scope_oneLevel ...                                         [OK]
    test_search_scope_wholeSubtree ...                                     [OK]
    test_unbind ...                                                        [OK]
    test_unknownRequest ...                                                [OK]
  TestSchema
    testSimple ...                                                 [SUCCESS!?!]
ldaptor.test.test_smbpassword
  TestLMHash
    testKnownValues ...                                                    [OK]
  TestNTHash
    testKnownValues ...                                                    [OK]
ldaptor.test.test_svcbindproxy
  ServiceBindingProxy
    test_bind_match_badAuth ...                                         [ERROR]
    test_bind_match_success ...                                         [ERROR]
    test_bind_match_success_later ...                                   [ERROR]
    test_bind_noMatchingServicesFound_fallback_badAuth ...              [ERROR]
    test_bind_noMatchingServicesFound_fallback_success ...              [ERROR]
    test_bind_noMatchingServicesFound_noFallback ...                    [ERROR]

===============================================================================
[TODO]
Reason: 'Not supported yet.'
Traceback (most recent call last):
  File "ldaptor/test/test_server.py", line 552, in test_modifyDN_rdnOnly_noDeleteOldRDN_success
    id=2)))
  File "/usr/lib64/python2.7/site-packages/twisted/trial/_synctest.py", line 432, in assertEqual
    super(_Assertions, self).assertEqual(first, second, msg)
  File "/usr/lib64/python2.7/unittest/case.py", line 513, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib64/python2.7/unittest/case.py", line 506, in _baseAssertEqual
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: '01\x02\x01\x02m,\n\x015\x04\x00\x04%Cannot handle preserving old RDN yet.' != '0\x0c\x02\x01\x02m\x07\n\x01\x00\x04\x00\x04\x00'

ldaptor.test.test_server.LDAPServerTest.test_modifyDN_rdnOnly_noDeleteOldRDN_success
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_merger.py", line 75, in test_bind_both_invalid
    [[LDAPBindResponse(resultCode=ldaperrors.LDAPInvalidCredentials.resultCode)]])
  File "ldaptor/test/test_merger.py", line 43, in createMergedServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/merger.py", line 88, in connectionMade
    overrides=c.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_merger.MergedLDAPServerTest.test_bind_both_invalid
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_merger.py", line 50, in test_bind_both_success
    [[LDAPBindResponse(resultCode=0)]])
  File "ldaptor/test/test_merger.py", line 43, in createMergedServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/merger.py", line 88, in connectionMade
    overrides=c.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_merger.MergedLDAPServerTest.test_bind_both_success
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_merger.py", line 64, in test_bind_one_invalid
    [[LDAPBindResponse(resultCode=0)]])
  File "ldaptor/test/test_merger.py", line 43, in createMergedServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/merger.py", line 88, in connectionMade
    overrides=c.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_merger.MergedLDAPServerTest.test_bind_one_invalid
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_merger.py", line 91, in test_search_merged
    LDAPSearchResultDone(ldaperrors.Success.resultCode)]])
  File "ldaptor/test/test_merger.py", line 43, in createMergedServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/merger.py", line 88, in connectionMade
    overrides=c.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_merger.MergedLDAPServerTest.test_search_merged
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_merger.py", line 110, in test_search_one_invalid
    LDAPSearchResultDone(ldaperrors.Success.resultCode),
  File "ldaptor/test/test_merger.py", line 43, in createMergedServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/merger.py", line 88, in connectionMade
    overrides=c.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_merger.MergedLDAPServerTest.test_search_one_invalid
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_merger.py", line 138, in test_unbind_clientEOF
    d = self.createMergedServer([[]], [[]])
  File "ldaptor/test/test_merger.py", line 43, in createMergedServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/merger.py", line 88, in connectionMade
    overrides=c.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_merger.MergedLDAPServerTest.test_unbind_clientEOF
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_merger.py", line 125, in test_unbind_clientUnbinds
    d = self.createMergedServer([[]], [[]])
  File "ldaptor/test/test_merger.py", line 43, in createMergedServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/merger.py", line 88, in connectionMade
    overrides=c.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_merger.MergedLDAPServerTest.test_unbind_clientUnbinds
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_merger.py", line 151, in test_unwilling_to_perform
    d = self.createMergedServer([[]], [[]])
  File "ldaptor/test/test_merger.py", line 43, in createMergedServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/merger.py", line 88, in connectionMade
    overrides=c.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_merger.MergedLDAPServerTest.test_unwilling_to_perform
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_proxy.py", line 16, in test_bind
    server = self.createServer([ pureldap.LDAPBindResponse(resultCode=0),
  File "ldaptor/test/test_proxy.py", line 13, in createServer
    return testutil.createServer(proxy.Proxy, *responses)
  File "ldaptor/testutil.py", line 160, in createServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/proxy.py", line 65, in connectionMade
    overrides=self.config.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_proxy.Proxy.test_bind
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_proxy.py", line 28, in test_search
    pureldap.LDAPSearchResultDone(ldaperrors.Success.resultCode),
  File "ldaptor/test/test_proxy.py", line 13, in createServer
    return testutil.createServer(proxy.Proxy, *responses)
  File "ldaptor/testutil.py", line 160, in createServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/proxy.py", line 65, in connectionMade
    overrides=self.config.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_proxy.Proxy.test_search
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_proxy.py", line 62, in test_unbind_clientEOF
    [],
  File "ldaptor/test/test_proxy.py", line 13, in createServer
    return testutil.createServer(proxy.Proxy, *responses)
  File "ldaptor/testutil.py", line 160, in createServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/proxy.py", line 65, in connectionMade
    overrides=self.config.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_proxy.Proxy.test_unbind_clientEOF
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_proxy.py", line 43, in test_unbind_clientUnbinds
    [],
  File "ldaptor/test/test_proxy.py", line 13, in createServer
    return testutil.createServer(proxy.Proxy, *responses)
  File "ldaptor/testutil.py", line 160, in createServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/proxy.py", line 65, in connectionMade
    overrides=self.config.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_proxy.Proxy.test_unbind_clientUnbinds
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_svcbindproxy.py", line 352, in test_bind_match_badAuth
    [ pureldap.LDAPBindResponse(resultCode=ldaperrors.LDAPInvalidCredentials.resultCode) ],
  File "ldaptor/test/test_svcbindproxy.py", line 24, in createServer
    *responses)
  File "ldaptor/testutil.py", line 160, in createServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/proxy.py", line 65, in connectionMade
    overrides=self.config.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_svcbindproxy.ServiceBindingProxy.test_bind_match_badAuth
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_svcbindproxy.py", line 226, in test_bind_match_success
    [ pureldap.LDAPBindResponse(resultCode=ldaperrors.Success.resultCode) ],
  File "ldaptor/test/test_svcbindproxy.py", line 24, in createServer
    *responses)
  File "ldaptor/testutil.py", line 160, in createServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/proxy.py", line 65, in connectionMade
    overrides=self.config.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_svcbindproxy.ServiceBindingProxy.test_bind_match_success
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_svcbindproxy.py", line 275, in test_bind_match_success_later
    [ pureldap.LDAPBindResponse(resultCode=ldaperrors.Success.resultCode) ],
  File "ldaptor/test/test_svcbindproxy.py", line 24, in createServer
    *responses)
  File "ldaptor/testutil.py", line 160, in createServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/proxy.py", line 65, in connectionMade
    overrides=self.config.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_svcbindproxy.ServiceBindingProxy.test_bind_match_success_later
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_svcbindproxy.py", line 161, in test_bind_noMatchingServicesFound_fallback_badAuth
    [ pureldap.LDAPBindResponse(resultCode=ldaperrors.LDAPInvalidCredentials.resultCode),
  File "ldaptor/test/test_svcbindproxy.py", line 24, in createServer
    *responses)
  File "ldaptor/testutil.py", line 160, in createServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/proxy.py", line 65, in connectionMade
    overrides=self.config.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_svcbindproxy.ServiceBindingProxy.test_bind_noMatchingServicesFound_fallback_badAuth
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_svcbindproxy.py", line 100, in test_bind_noMatchingServicesFound_fallback_success
    [ pureldap.LDAPBindResponse(resultCode=ldaperrors.Success.resultCode) ],
  File "ldaptor/test/test_svcbindproxy.py", line 24, in createServer
    *responses)
  File "ldaptor/testutil.py", line 160, in createServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/proxy.py", line 65, in connectionMade
    overrides=self.config.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_svcbindproxy.ServiceBindingProxy.test_bind_noMatchingServicesFound_fallback_success
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "ldaptor/test/test_svcbindproxy.py", line 39, in test_bind_noMatchingServicesFound_noFallback
    [ pureldap.LDAPSearchResultDone(ldaperrors.Success.resultCode) ],
  File "ldaptor/test/test_svcbindproxy.py", line 24, in createServer
    *responses)
  File "ldaptor/testutil.py", line 160, in createServer
    server.connectionMade()
  File "ldaptor/protocols/ldap/proxy.py", line 65, in connectionMade
    overrides=self.config.getServiceLocationOverrides())
  File "ldaptor/protocols/ldap/ldapconnector.py", line 113, in connect
    bindAddress=bindAddress)
  File "ldaptor/protocols/ldap/ldapconnector.py", line 39, in __init__
    connectFuncKwArgs={'bindAddress': bindAddress})
  File "/usr/lib64/python2.7/site-packages/twisted/names/srvconnect.py", line 77, in __init__
    self.domain = nativeString(domain)
  File "/usr/lib64/python2.7/site-packages/twisted/python/compat.py", line 412, in nativeString
    raise TypeError("%r is neither bytes nor unicode" % s)
exceptions.TypeError: None is neither bytes nor unicode

ldaptor.test.test_svcbindproxy.ServiceBindingProxy.test_bind_noMatchingServicesFound_noFallback
===============================================================================
[SUCCESS!?!]
Reason: 'Not supported yet.'

ldaptor.test.test_server.TestSchema.testSimple
-------------------------------------------------------------------------------
Ran 461 tests in 2.203s

FAILED (expectedFailures=1, errors=18, unexpectedSuccesses=1, successes=441)
 �[31;01m*�[0m ERROR: dev-python/twisted-ldaptor-16.0.0::nado failed (test phase):
 �[31;01m*�[0m   Failed tests with python2.7
 �[31;01m*�[0m 
 �[31;01m*�[0m Call stack:
 �[31;01m*�[0m     ebuild.sh, line  124:  Called src_test
 �[31;01m*�[0m   environment, line 2723:  Called distutils-r1_src_test
 �[31;01m*�[0m   environment, line  974:  Called _distutils-r1_run_foreach_impl 'python_test'
 �[31;01m*�[0m   environment, line  425:  Called python_foreach_impl 'distutils-r1_run_phase' 'python_test'
 �[31;01m*�[0m   environment, line 2256:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test'
 �[31;01m*�[0m   environment, line 1628:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test'
 �[31;01m*�[0m   environment, line 1626:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_test'
 �[31;01m*�[0m   environment, line  637:  Called distutils-r1_run_phase 'python_test'
 �[31;01m*�[0m   environment, line  905:  Called python_test
 �[31;01m*�[0m   environment, line 2625:  Called die
 �[31;01m*�[0m The specific snippet of code:
 �[31;01m*�[0m       "${EPYTHON}" -m twisted.trial ldaptor || die "Failed tests with ${EPYTHON}"
 �[31;01m*�[0m 
 �[31;01m*�[0m If you need support, post the output of `emerge --info '=dev-python/twisted-ldaptor-16.0.0::nado'`,
 �[31;01m*�[0m the complete build log and the output of `emerge -pqv '=dev-python/twisted-ldaptor-16.0.0::nado'`.
 �[31;01m*�[0m The complete build log is located at '/var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/temp/build.log'.
 �[31;01m*�[0m The ebuild environment file is located at '/var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/temp/environment'.
 �[31;01m*�[0m Working directory: '/var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0'
 �[31;01m*�[0m S: '/var/tmp/portage/dev-python/twisted-ldaptor-16.0.0/work/ldaptor-16.0.0'

Login using LDAP fails on the latest Debian versions

environment: Debian testing (Buster)
matrix-synapse package version: 0.99.1.1-1
matrix-syanpse-ldap3 package version: 0.1.3-4

Logging in using an LDAP user's credentials fails on the latest versions of the packages available on Debian testing.

screenshot_2019-02-25 riot

Feb 25 07:12:26 freedombox synapse[11329]: synapse.handlers.presence: [] Handling presence timeouts
Feb 25 07:12:27 freedombox synapse[11329]: synapse.access.http.8008: [OPTIONS-1] ::1 - 8008 - Received request: OPTIONS /_matrix/client/r0/login
Feb 25 07:12:27 freedombox synapse[11329]: synapse.access.http.8008: [OPTIONS-1] ::1 - 8008 - {None} Processed request: 0.001sec/0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 22B 200 "OPTIONS /_matrix/cli
Feb 25 07:12:27 freedombox synapse[11329]: synapse.access.http.8008: [POST-2] ::1 - 8008 - Received request: POST /_matrix/client/r0/login
Feb 25 07:12:27 freedombox synapse[11329]: synapse.rest.client.v1.login: [POST-2] Got login request with identifier: {'type': 'm.id.user', 'user': 'tester'}, medium: None, address: None, user: 'tester'
Feb 25 07:12:27 freedombox synapse[11329]: synapse.storage._base: [] Starting db txn 'get_users_by_id_case_insensitive' from sentinel context
Feb 25 07:12:27 freedombox synapse[11329]: synapse.storage._base: [] Starting db connection from sentinel context: metrics will be lost
Feb 25 07:12:27 freedombox synapse[11329]: synapse.metrics: [] Collecting gc 0
Feb 25 07:12:27 freedombox synapse[11329]: synapse.handlers.auth: [] Attempted to login as @tester:mybox.me but they do not exist
Feb 25 07:12:27 freedombox synapse[11329]: synapse.http.server: [] Failed handle request via <function JsonResource._async_render at 0x7fd008a03488>: <SynapseRequest at 0x7fd0053bdb70 method='POST' uri='/_matri
                                             File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
                                               current.result = callback(current.result, *args, **kw)
                                             File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1475, in gotResult
                                               _inlineCallbacks(r, g, status)
                                             File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                               result = result.throwExceptionIntoGenerator(g)
                                             File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                               return g.throw(self.type, self.value, self.tb)
                                           --- <exception caught here> ---
                                             File "/usr/lib/python3/dist-packages/synapse/http/server.py", line 81, in wrapped_request_handler
                                               yield h(self, request)
                                             File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                               result = result.throwExceptionIntoGenerator(g)
                                             File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                               return g.throw(self.type, self.value, self.tb)
                                             File "/usr/lib/python3/dist-packages/synapse/http/server.py", line 316, in _async_render
                                               callback_return = yield callback(request, **kwargs)
                                             File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                               result = result.throwExceptionIntoGenerator(g)
                                             File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                               return g.throw(self.type, self.value, self.tb)
                                             File "/usr/lib/python3/dist-packages/synapse/rest/client/v1/login.py", line 140, in on_POST
                                               result = yield self._do_other_login(login_submission)
                                             File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                               result = result.throwExceptionIntoGenerator(g)
                                             File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                               return g.throw(self.type, self.value, self.tb)
                                             File "/usr/lib/python3/dist-packages/synapse/rest/client/v1/login.py", line 220, in _do_other_login
                                               login_submission,
                                             File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                               result = result.throwExceptionIntoGenerator(g)
                                             File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                               return g.throw(self.type, self.value, self.tb)
                                             File "/usr/lib/python3/dist-packages/synapse/handlers/auth.py", line 664, in validate_login
                                               qualified_user_id, password,
                                             File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
                                               result = result.throwExceptionIntoGenerator(g)
                                             File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                               return g.throw(self.type, self.value, self.tb)
                                             File "/usr/lib/python3/dist-packages/ldap_auth_provider.py", line 172, in check_password
                                               self.ldap_attributes['mail']
                                             File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
                                               result = inContext.theWork()
                                             File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
                                               inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
                                             File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
                                               return self.currentContext().callWithContext(ctx, func, *args, **kw)
                                             File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
                                               return func(*args,**kw)
                                             File "/usr/lib/python3/dist-packages/ldap3/core/connection.py", line 772, in search
                                               check_names=self.check_names)
                                             File "/usr/lib/python3/dist-packages/ldap3/operation/search.py", line 375, in search_operation
                                               request['attributes'] = build_attribute_selection(attributes, schema)
                                             File "/usr/lib/python3/dist-packages/ldap3/operation/search.py", line 311, in build_attribute_selection
                                               attribute_selection[index] = Selector(attribute)
                                             File "/usr/lib/python3/dist-packages/pyasn1/type/univ.py", line 819, in __init__
                                               base.AbstractSimpleAsn1Item.__init__(self, value, **kwargs)
                                             File "/usr/lib/python3/dist-packages/pyasn1/type/base.py", line 240, in __init__
                                               value = self.prettyIn(value)
                                             File "/usr/lib/python3/dist-packages/pyasn1/type/univ.py", line 878, in prettyIn
                                               return bytes(value)
                                               result = result.throwExceptionIntoGenerator(g)
                                             File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
                                               return g.throw(self.type, self.value, self.tb)
                                             File "/usr/lib/python3/dist-packages/ldap_auth_provider.py", line 172, in check_password
                                               self.ldap_attributes['mail']
                                             File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
                                               result = inContext.theWork()
                                             File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
                                               inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
                                             File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
                                               return self.currentContext().callWithContext(ctx, func, *args, **kw)
                                             File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
                                               return func(*args,**kw)
                                             File "/usr/lib/python3/dist-packages/ldap3/core/connection.py", line 772, in search
                                               check_names=self.check_names)
                                             File "/usr/lib/python3/dist-packages/ldap3/operation/search.py", line 375, in search_operation
                                               request['attributes'] = build_attribute_selection(attributes, schema)
                                             File "/usr/lib/python3/dist-packages/ldap3/operation/search.py", line 311, in build_attribute_selection
                                               attribute_selection[index] = Selector(attribute)
                                             File "/usr/lib/python3/dist-packages/pyasn1/type/univ.py", line 819, in __init__
                                               base.AbstractSimpleAsn1Item.__init__(self, value, **kwargs)
                                             File "/usr/lib/python3/dist-packages/pyasn1/type/base.py", line 240, in __init__
                                               value = self.prettyIn(value)
                                             File "/usr/lib/python3/dist-packages/pyasn1/type/univ.py", line 878, in prettyIn
                                               return bytes(value)
                                           builtins.TypeError: cannot convert 'NoneType' object to bytes
Feb 25 07:12:27 freedombox synapse[11329]: synapse.access.http.8008: [POST-2] ::1 - 8008 - {None} Processed request: 0.009sec/0.000sec (0.000sec, 0.002sec) (0.000sec/0.000sec/0) 67B 500 "POST /_matrix/client/r0

This has nothing to do with Let's Encrypt certificates. I did a similar test with a valid domain name and LE certificate here - https://salsa.debian.org/freedombox-team/plinth/issues/1484

IndexError when accessing missing attribute for registration metadata

Hi, I upgrade recently to last version of matrix (0.18.5). Only who logins before upgrade using LDAP can login now in matrix. New users don't. My config and error below.

I change the config to new version:

homeserver.yaml

#ldap_config:
password_providers:
 - module: "ldap_auth_provider.LdapAuthProvider"
   config:
      enabled: true
      uri: "ldap://***.ufrj.br:389"
      start_tls: true
      base: "cn=users,cn=accounts,dc=***"
      attributes:
         uid: "uid"
         mail: "email"
         name: "displayName"
      bind_dn: "uid=matrix,cn=sysaccounts,cn=etc,dc=***"
      bind_password: "*****"
      filter: "(&(objectclass=person)(memberOf=cn=matrix,cn=groups,cn=accounts,dc=***))"

homeserver.log

2016-12-21 08:26:51,080 - synapse.access.https.8448 - 59 - INFO - POST-10721- 146.164.84.4 - 8448 - Received request: POST /_matrix/client/r0/login?
2016-12-21 08:26:51,095 - synapse.handlers.auth - 460 - WARNING - POST-10721- Attempted to login as @teste:matrix.id.ufrj.br but they do not exist
2016-12-21 08:26:51,100 - synapse.http.server - 139 - ERROR - POST-10721- Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x38a2d90>: <SynapseRequest at 0x4bb9560 method=POST uri=/_matrix/client/r0/login? clientproto=HTTP/1.1 site=8448>
Traceback (most recent call last):
  File "/root/.synapse/lib/python2.7/site-packages/synapse/http/server.py", line 116, in wrapped_request_handler
    yield request_handler(self, request, request_metrics)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1297, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/root/.synapse/lib/python2.7/site-packages/synapse/http/server.py", line 255, in _async_render
    callback_return = yield callback(request, **kwargs)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1297, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/root/.synapse/lib/python2.7/site-packages/synapse/rest/client/v1/login.py", line 94, in on_POST
    result = yield self.do_password_login(login_submission)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1297, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/root/.synapse/lib/python2.7/site-packages/synapse/rest/client/v1/login.py", line 137, in do_password_login
    password=login_submission["password"],
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1297, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/root/.synapse/lib/python2.7/site-packages/synapse/handlers/auth.py", line 491, in _check_password
    is_valid = yield provider.check_password(user_id, password)
  File "/root/.synapse/lib/python2.7/site-packages/twisted/internet/defer.py", line 1299, in _inlineCallbacks
    result = g.send(result)
  File "/root/.synapse/lib/python2.7/site-packages/ldap_auth_provider.py", line 178, in check_password
    mail = attrs[self.ldap_attributes['mail']][0]
IndexError: list index out of range

Thanks.

Logging Error on User Creation

2017-09-27 10:30:05,507 - twisted - 131 - ERROR - POST-1321- Traceback (most recent call last):
2017-09-27 10:30:05,508 - twisted - 131 - ERROR - POST-1321-   File "/usr/lib/python2.7/logging/handlers.py", line 76, in emit
2017-09-27 10:30:05,510 - twisted - 131 - ERROR - POST-1321-     if self.shouldRollover(record):
2017-09-27 10:30:05,510 - twisted - 131 - ERROR - POST-1321-   File "/usr/lib/python2.7/logging/handlers.py", line 156, in shouldRollover
2017-09-27 10:30:05,511 - twisted - 131 - ERROR - POST-1321-     msg = "%s\n" % self.format(record)
2017-09-27 10:30:05,512 - twisted - 131 - ERROR - POST-1321-   File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
2017-09-27 10:30:05,514 - twisted - 131 - ERROR - POST-1321-     return fmt.format(record)
2017-09-27 10:30:05,515 - twisted - 131 - ERROR - POST-1321-   File "/usr/lib/python2.7/logging/__init__.py", line 465, in format
2017-09-27 10:30:05,515 - twisted - 131 - ERROR - POST-1321-     record.message = record.getMessage()
2017-09-27 10:30:05,516 - twisted - 131 - ERROR - POST-1321-   File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage
2017-09-27 10:30:05,517 - twisted - 131 - ERROR - POST-1321-     msg = msg % self.args
2017-09-27 10:30:05,518 - twisted - 131 - ERROR - POST-1321- TypeError: %d format: a number is required, not str
2017-09-27 10:30:05,519 - twisted - 131 - ERROR - POST-1321- Logged from file ldap_auth_provider.py, line 202
2017-09-27 10:30:05,520 - twisted - 131 - ERROR - POST-1321- Traceback (most recent call last):
2017-09-27 10:30:05,521 - twisted - 131 - ERROR - POST-1321-   File "/usr/lib/python2.7/logging/__init__.py", line 861, in emit
2017-09-27 10:30:05,522 - twisted - 131 - ERROR - POST-1321-     msg = self.format(record)
2017-09-27 10:30:05,522 - twisted - 131 - ERROR - POST-1321-   File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
2017-09-27 10:30:05,523 - twisted - 131 - ERROR - POST-1321-     return fmt.format(record)
2017-09-27 10:30:05,524 - twisted - 131 - ERROR - POST-1321-   File "/usr/lib/python2.7/logging/__init__.py", line 465, in format
2017-09-27 10:30:05,525 - twisted - 131 - ERROR - POST-1321-     record.message = record.getMessage()
2017-09-27 10:30:05,525 - twisted - 131 - ERROR - POST-1321-   File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage
2017-09-27 10:30:05,526 - twisted - 131 - ERROR - POST-1321-     msg = msg % self.args
2017-09-27 10:30:05,527 - twisted - 131 - ERROR - POST-1321- TypeError: %d format: a number is required, not str
2017-09-27 10:30:05,528 - twisted - 131 - ERROR - POST-1321- Logged from file ldap_auth_provider.py, line 202
2017-09-27 10:30:05,796 - synapse.handlers.auth - 442 - INFO - POST-1321- Logging in user @test:domain.com on device XXXXXXXXXX

I think there is a problem with these lines:

logger.info(
"Registration based on LDAP data was successful: "
"%d: %s (%s, %)",
user_id, localpart, name, mail
)

Especially since this comment says:

# user_id is of the form @foo:bar.com

Authentication never makes it to try LDAP

I've configured my Synapse server (version 1.2.1) as in the README to allow LDAP. However, any attempt to authenticate just immediately fails, and no LDAP events ever show up in homeserver.log, even with logging set to DEBUG. I've tried setting localdb_enabled to false, but there was no change in behavior. Can anyone point me in the right direction to figure this out, or at least get more information?

Fill Email in user profile from LDAP mail field on user creation

Auth work successfull via LDAP, but in user profiles Email field are empty (even if I fill correct "mail" account at ldap_auth_provider.LdapAuthProvider config.

So I must manually fill it and complete email verification process with activation link for each LDAP user.

Will be good to auto-fill email field from LDAP mail field info.

Can't log in with LDAP

Hi,

I've installed Synapse on a Debian Stretch from the deb repo. It is linked to Nginx as reverse proxy.
I've setup my LDAP server in homeserver.yaml and put the log on DEBUG

Here are the log i have when i try to log in as a ldap user:

ldap_auth_provider - 91 - DEBUG - POST-1- Attempting LDAP connection with ldaps://XXXXX:XXX
ldap_auth_provider - 342 - DEBUG - - Established LDAP connection in search mode: ldaps://XXXXXX:XXX - ssl - user: cn=XXX,dc=XXX,dc=XXX - not lazy - unbound - closed - <no socket> - tls not started - not listening - SyncStrategy - internal decoder

I can't log in. Any ideas ?
If you need more details let me know 🙂

Thank you !

LDAP registration failed, no result

Hi,

LDAP integration , but trying to login as a LDAP user get error as follows
ldap_auth_provider - 198 - WARNING - POST-182- LDAP registration failed, no result

LDAP Succesfully integrated to the serverr and get logs as follows

ldap_auth_provider - 332 - DEBUG - POST-179- Established LDAP connection in search mode:
ldap_auth_provider - 365 - DEBUG - POST-39- LDAP search filter: (uid=anish_v)
ldap_auth_provider - 376 - DEBUG - POST-39- LDAP search found dn: uid=anish_v,ou=People, **
ldap_auth_provider - 277 - DEBUG - POST-39- Established LDAP connection in simple bind mode: ldap://**
ldap_auth_provider - 291 - DEBUG - POST-39- LDAP Bind successful in simple bind mode.
ldap_auth_provider - 119 - DEBUG - POST-39- LDAP auth method authenticated search returned: True
ldap_auth_provider - 133 - INFO - POST-39- User authenticated against LDAP server: ldap:// **
ldap_auth_provider - 163 - DEBUG - POST-39- ldap registration filter: (uid=anish_v)
ldap_auth_provider - 198 - WARNING - POST-39- LDAP registration failed, no result.

But User Registration fails using the Package

Problem with connect to LDAP (Samba4)

Configuration:

password_providers:
    - module: "synapse.util.ldap_auth_provider.LdapAuthProvider"
      config:
         enabled: true
         mode: search
         uri: "ldap://****.**********.pl:389"
         start_tls: false
         base: "dc=**********,dc=pl"
         attributes:
            uid: "samaccountname"
            mail: "email"
            name: "givenName"
         bind_dn: "cn=matrix,cn=Users,dc=**********,dc=pl"
         bind_password: "***************************"
         filter: "(&(|(objectclass=organizationalPerson))(|(|(memberof=CN=Matrix Users,CN=Users,DC=**********,DC=pl)(primaryGroupID=1148))))"

Logs:

2016-11-30 08:18:48,602 - synapse.access.http.8008 - 59 - INFO - POST-1- 212.91.12.42 - 8008 - Received request: POST /_matrix/client/r0/login?
2016-11-30 08:18:48,607 - ldap3 - 113 - DEBUG - POST-1- BASIC:instantiated Server: <Server(host='****.*********.pl', port=389, use_ssl=False, allowed_referral_hosts=[('*', True)])>
2016-11-30 08:18:48,608 - ldap_auth_provider - 95 - DEBUG - POST-1- Attempting LDAP connection with ldap://****.*********.pl:389
2016-11-30 08:18:48,610 - ldap_auth_provider - 332 - DEBUG - POST-1- Established LDAP connection in search mode: None
2016-11-30 08:18:48,611 - ldap3 - 113 - DEBUG - - BASIC:instantiated <SyncStrategy>: <ldap://****.*********.pl:389 - cleartext - user: cn=matrix,cn=Users,dc=*********,dc=pl - not lazy - unbound - closed - <no socket> - tls not started - not listening - No strategy - internal decoder - async - real DSA - not pooled - cannot stream output>
2016-11-30 08:18:48,613 - synapse.http.server - 139 - ERROR - POST-1- Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x7feb89b00490>: <XForwardedForRequest at 0x7feb8d042170 method=POST uri=/_matrix/client/r0/login? clientproto=HTTP/1.0 site=8008>
Traceback (most recent call last):
  File "/srv/synapse/lib/python2.7/site-packages/synapse/http/server.py", line 116, in wrapped_request_handler
    yield request_handler(self, request, request_metrics)
AttributeError: 'NoneType' object has no attribute 'bind'
2016-11-30 08:18:48,614 - ldap3 - 113 - DEBUG - - BASIC:instantiated Connection: <Connection(server=Server(host='****.*********.pl', port=389, use_ssl=False, allowed_referral_hosts=[('*', True)]), user='cn=matrix,cn=Users,dc=*********,dc=pl', password='<stripped 20 characters of sensitive data>', auto_bind='NONE', version=3, authentication='SIMPLE', client_strategy='SYNC', auto_referrals=True, check_names=True, read_only=False, lazy=False, raise_exceptions=False, fast_decoder=True, return_empty_attributes=True)>
2016-11-30 08:18:48,618 - synapse.access.http.8008 - 91 - INFO - POST-1- 212.91.12.42 - 8008 - {None} Processed request: 14ms (19ms, 0ms) (0ms/0) 67B 500 "POST /_matrix/client/r0/login? HTTP/1.0" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"

Allow multiple OU's

I have users in several OU's and would like to enable LDAP authentication for multiple OU's. I tried changing the base to an array type string like:

[ "ou=users1","ou=users2" ]

However then no one can authenticate. Using the normal single string for a single OU works fine.

Can support be added for an array string or other option for multiple OU's?

Can login only with lowercase username

Hello,

it looks like that, when the user tries to login with uppercase or a combination of uppercase and lowercase, the login fails.
The only way to login using the Active Directory credentials is to use only lowercase.

In the configuration we have:
attributes:
uid: "sAMAccountName"
mail: "mail"
name: "displayName"

Is there a way to allow the users to login without caring about the case sensitivity?

Thank you in advance

fail to setup LDAP authentication properly

We are trying to setup ldap authentication with synapse and according to the matrix-synapse debug log it authenticates the test user successfully but then does nothing

homeserver.yaml part

password_providers:
    - module: "ldap_auth_provider.LdapAuthProvider"
      config:
        enabled: true
        uri: "auth.example.com"
#        start_tls: false
        base: "ou=matrix,dc=example,dc=com"
        attributes:
           uid: "cn"
           mail: "email"
           name: "givenName"
        bind_dn: cn=admin,dc=example,dc=com
        bind_password: ************************************
       # filter: "(objectClass=posixAccount)"

$ journalctl -u matrix-synapse | grep ldap

Jul 29 12:25:24 matrix python[8345]: 2017-07-29 12:25:24,000 - ldap_auth_provider - 91 - DEBUG - POST-1949- Attempting LDAP connection with auth.******.com
Jul 29 12:25:24 matrix python[8345]: 2017-07-29 12:25:24,000 - ldap_auth_provider - 332 - DEBUG - POST-1949- Established LDAP connection in search mode: ldap://auth.example.com:389 - cleartext - user: cn=admin,dc=example,dc=com - unbound - closed - tls not started - not listening - SyncWaitStrategy
Jul 29 12:25:24 matrix python[8345]: 2017-07-29 12:25:24,007 - ldap_auth_provider - 365 - DEBUG - POST-1949- LDAP search filter: (cn=matrixtest)
Jul 29 12:25:24 matrix python[8345]: 2017-07-29 12:25:24,009 - ldap_auth_provider - 376 - DEBUG - POST-1949- LDAP search found dn: cn=matrixtest,ou=matrix,dc=example,dc=com
Jul 29 12:25:24 matrix python[8345]: 2017-07-29 12:25:24,010 - ldap_auth_provider - 277 - DEBUG - POST-1949- Established LDAP connection in simple bind mode: ldap://auth.example.com:389 - cleartext - user: cn=matrixtest,ou=matrix,dc=example,dc=com - unbound - closed - tls not started - not listening - SyncWaitStrategy
Jul 29 12:25:24 matrix python[8345]: 2017-07-29 12:25:24,019 - ldap_auth_provider - 291 - DEBUG - POST-1949- LDAP Bind successful in simple bind mode.
Jul 29 12:25:24 matrix python[8345]: 2017-07-29 12:25:24,019 - ldap_auth_provider - 119 - DEBUG - POST-1949- LDAP auth method authenticated search returned: True (conn: ldap://auth.example.com:389 - cleartext - user: cn=matrixtest,ou=matrix,dc=example,dc=com - bound - open - tls not started - listening - SyncWaitStrategy)
Jul 29 12:25:24 matrix python[8345]: 2017-07-29 12:25:24,019 - ldap_auth_provider - 133 - INFO - POST-1949- User authenticated against LDAP server: ldap://auth.example.com:389 - cleartext - user: cn=matrixtest,ou=matrix,dc=example,dc=com - bound - open - tls not started - listening - SyncWaitStrategy
Jul 29 12:25:24 matrix python[8345]: 2017-07-29 12:25:24,020 - ldap_auth_provider - 163 - DEBUG - POST-1949- ldap registration filter: (cn=matrixtest)

Riot error message on login

Error: Problem communicating with the given homeserver. (M_UNKNOWN)

test user

field value
dn cn=matrixtest,ou=matrix,dc=example,dc=com
cn matrixtest
gidnumber 500
givenname MatrixTest
homedirectory /home/users/mtest
mail [email protected]
objectclass `inetOrgPerson
sn test
uid mtest
uidnumber 1000
userpassword {MD5}CamDBc5HJ0jV6idzdGAffA==

Account creation fails for users with no email

when letting ldap auth create a user, if the user doens't have an email attribute it results in a rather generic "Missing JSON keys" error.

to fix I edited synapse/handlers/auth.py and changed mail = attrs[self.ldap_attributes['mail']][0] to

try:
    mail = attrs[self.ldap_attributes['mail']][0]
except KeyError:
    mail = ""
    pass

@chrwei, matrix-org/synapse#1135

Feature request: Option to automatically set the user's display name to an LDAP attribute value on first LDAP login

Many LDAP databases contain display names or full names for users. For example:

dn: uid=jdoe,ou=users,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: posixAccount
uidNumber: 1000
gidNumber: 1000
[...]
uid: jdoe
cn: John Doe

On first login, a Matrix user is created for the corresponding LDAP account. However, display names are not set by default, so users must enter their own display name. The user in the above example will display as @jdoe:example.com until they manually enter a different display name into their client app.

It would be nice if matrix-synapse-ldap3 could be configured to automatically set users' display names based on their LDAP information on first login. For example, if a server could be configured to set default display names from the cn LDAP attribute, the user in the above example would have their default display name set to John Doe.

Installation / Getting started guide

Is there an installation and/or Getting Started guide somewhere on how to use this plugin for those that are not familiar with python and have no clue how to make this work?

Users from different Organizational Units can't login

I can't find a solution for this problem.
If I set base: "ou=Alytus,dc=KP,dc=local" users from this OU login without any problems. But users from other OU can't login because LDAP don't find such user.
If I set base: "dc=KP,dc=local" non of user can login because LDAP gets error
ldap_auth_provider - 397 - INFO - POST-4- LDAP search returned too many (4) results for 'lina.gaubiene'
And for all users I get 4 results. Using filter I can filter good result, but I can't find how to filter those 3 bad results.

Feature request: Add support for checking memberUid group attributes

By default, OpenLDAP doesn't add the memberOf group membership attribute to user objects. Instead, group objects typically contain lists of members, each one with a memberUid value in the group object. To check if a user belongs to a group, clients typically need to locate the user account and then perform a second query to see if that user is in the group (ex. (&(objectClass=posixGroup)(cn=GROUP_NAME)(memberUid=USER_NAME))).

matrix-synapse-ldap3 allows specifying a lookup filter when searching for user accounts, but there is no support for restricting access to groups for servers that don't store group membership information in the user objects themselves. It would be great if support for this feature were added.

PyAsn1Error with ldap3==2.4

After upgrading to pyldap==2.4 logging in triggers the following exception. Downgrading to pyldap==2.3 makes it work again.

Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x7fda8dc80450>: <XForwardedForRequest at 0x7fda7c539680 method=POST uri=/_matrix/client/r0/login clientproto=HTTP/1.1 site=8008>: Traceback (most recent call last):
to=HTTP/1.1 site=8008>: Traceback (most recent call last):
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 653, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1442, in gotResult
_inlineCallbacks(r, g, deferred)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
--- <exception caught here> ---
File "/home/matrix/git/synapse/synapse/http/server.py", line 117, in wrapped_request_handler
yield request_handler(self, request, request_metrics)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/home/matrix/git/synapse/synapse/http/server.py", line 263, in _async_render
callback_return = yield callback(request, **kwargs)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/home/matrix/git/synapse/synapse/rest/client/v1/login.py", line 154, in on_POST
result = yield self._do_other_login(login_submission)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/home/matrix/git/synapse/synapse/rest/client/v1/login.py", line 224, in _do_other_login
login_submission,
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/home/matrix/git/synapse/synapse/handlers/auth.py", line 639, in validate_login
qualified_user_id, password,
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/home/matrix/git/matrix-synapse-ldap3/ldap_auth_provider.py", line 113, in check_password
server=server, localpart=localpart, password=password
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/home/matrix/git/matrix-synapse-ldap3/ldap_auth_provider.py", line 354, in _ldap_authenticated_search
if not (yield threads.deferToThread(conn.bind)):
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/threadpool.py", line 250, in inContext
result = inContext.theWork()
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/ldap3/core/connection.py", line 427, in bind
response = self.post_send_single_response(self.send('bindRequest', request, controls))
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/ldap3/strategy/sync.py", line 122, in post_send_single_response
responses, result = self.get_response(message_id)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/ldap3/strategy/base.py", line 298, in get_response
responses = self._get_response(message_id)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/ldap3/strategy/sync.py", line 168, in _get_response
dict_response = self.decode_response(ldap_resp)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/ldap3/strategy/base.py", line 403, in decode_response
result = bind_response_to_dict(component)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/ldap3/operation/bind.py", line 119, in bind_response_to_dict
'saslCreds': bytes(response['serverSaslCreds']) if response['serverSaslCreds'] is not None else None}
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/pyasn1/type/univ.py", line 843, in __str__
return str(self._value)
File "/home/matrix/.synapse/local/lib/python2.7/site-packages/pyasn1/type/base.py", line 199, in plug
raise error.PyAsn1Error('Attempted "%s" operation on ASN.1 schema object' % name)
pyasn1.error.PyAsn1Error: Attempted "__str__" operation on ASN.1 schema object

Active Directory login fault

Description of problem: login fault when try to auth with Active Directory and user search base configured to domain/forest root.

Error text in log:

INFO - POST-3- LDAP search returned too many (4) results for 'username'

Error reason: dirty conn.response lenght check. There not only 'searchResEntry' type entries may present in LDAP responce. There may be 'searchResRef' type entries (most often occur in MS AD, but can also be found in other LDAP servers). In Active Directory forest root there always 3 refferal links, so in LDAP response, 4 objects are obtained: one user object with type 'searchResEntry' and tree 'searchResRef' objects.

Solution: count in conn.response only 'searchResEntry' type entries, and (in the ideal case) correctly handle LDAP referral links.

Migrate existing users

Is there a way to migrate existing users to a LDAP directory?
It seems like the internal database password table is looked up before LDAP is checked.

Is there a way to delete just the password (not the account) so that LDAP password is used instead or disable the internal password provider?

AD LDAP - No Registration?

Hi,

i'm Using Synapse with Riot-Web and try to use ldap3 connector.
After all, i think that the Query String find a User. But there is no registration in Matrix/Synapse with this user. Am i understand it wrong? Is there a config Option i have to set? Here is the output of the synapse log:

2017-06-13 09:57:24,902 - ldap_auth_provider - 91 - DEBUG - POST-68- Attempting LDAP connection with ldap://192.168.11.12:389
2017-06-13 09:57:24,903 - ldap_auth_provider - 336 - DEBUG - POST-68- Established LDAP connection in search mode: ldap://192.168.11.12:389 - cleartext - user: CN=administrator,CN=Users,DC=domain,DC=de - not lazy - unbound - closed - - tls not started - not listening - SyncStrategy - internal decoder
2017-06-13 09:57:24,906 - ldap_auth_provider - 369 - DEBUG - POST-68- LDAP search filter: (cn=domaintestuser)
2017-06-13 09:57:24,908 - ldap_auth_provider - 380 - DEBUG - POST-68- LDAP search found dn: CN=domaintestuser,OU=LAB,OU=Benutzer,DC=domain,DC=de
2017-06-13 09:57:24,909 - ldap_auth_provider - 281 - DEBUG - POST-68- Established LDAP connection in simple bind mode: ldap://192.168.11.12:389 - cleartext - user: CN=domaintestuser,OU=LAB,OU=Benutzer,DC=domain,DC=de - not lazy - unbound - closed - - tls not started - not listening - SyncStrategy - internal decoder
2017-06-13 09:57:24,911 - ldap_auth_provider - 295 - DEBUG - POST-68- LDAP Bind successful in simple bind mode.
2017-06-13 09:57:24,911 - ldap_auth_provider - 119 - DEBUG - POST-68- LDAP auth method authenticated search returned: True (conn: ldap://192.168.11.12:389 - cleartext - user: CN=domaintestuser,OU=LAB,OU=Benutzer,DC=domain,DC=de - not lazy - bound - open - <local: 192.168.11.27:57232 - remote: 192.168.11.12:389> - tls not started - listening - SyncStrategy - internal decoder)
2017-06-13 09:57:24,911 - ldap_auth_provider - 133 - INFO - POST-68- User authenticated against LDAP server: ldap://192.168.11.12:389 - cleartext - user: CN=domaintestuser,OU=LAB,OU=Benutzer,DC=domain,DC=de - not lazy - bound - open - <local: 192.168.11.27:57232 - remote: 192.168.11.12:389> - tls not started - listening - SyncStrategy - internal decoder
2017-06-13 09:57:24,912 - ldap_auth_provider - 163 - DEBUG - POST-68- ldap registration filter: (cn=domaintestuser)

My config:

password_providers:

  • module: "ldap_auth_provider.LdapAuthProvider"
    config:
    enabled: true
    uri: "ldap://192.168.11.12:389"
    start_tls: false
    base: "ou=LAB,ou=Benutzer,dc=domain,dc=de"
    attributes:
    uid: "cn"
    mail: "email"
    name: "givenName"
    bind_dn: "CN=administrator,CN=Users,DC=domain,DC=de"
    bind_password: "#########"
    #filter: "(objectClass=posixAccount)"

Riot-Web gives an Error (M_UNKNOWN).
When using Wrong Credentials, it tells me that there are wrong credentials.

The User has no Emailadress in the AD.
I am not very familiar with git or synapse. So please be nice :)

Windows AD Login failed

LDAP was worked fine, but user login has failed. Cause matrix will give ad the username format: @[email protected]:homeserver to Windows AD. They, it a wrong name, ad will return: the user is not exist. How to set the username just what I fill?

TLS certificates are not validated

With ldap3 this can be done rather easy:

import ssl

tls = ldap3.Tls(validate=ssl.CERT_REQUIRED)
server = ldap3.Server(self.ldap_uri, get_info=None, tls=tls)

Ideally this should be made optional via the config (possibly with providing a CA file opposed to using the system's cert store).

UnicodeEncodeError: 'ascii' codec can't encode characters on non-ascii symbols (cyrillic) in LDAP server on matrix-synapse-ldap3 module

I try to setup Synapse Matrix server with LDAP database (Samba AD server on Linux via Zentyal). After setup it connects successfully, also I can login to Matrix via LDAP login-password, but in user settings "email" field is empty and "Display name" is wrong (equal as login).

Seems that this happens because LDAP user DN and name contains non-ascii unciode symbols (Cyrillic), because I see in logs:

2017-06-28 12:21:42,716 - ldap_auth_provider - 349 - DEBUG - POST-12- Upgraded LDAP connection in search mode through StartTLS: ldap://example.com:389 - cleartext - user: [email protected] - unbound - open - <local: xxx.xxx.106.15:58272 - remote: xxx.xxx.36.174:389> - tls started - listening - SyncStrategy - internal decoder
2017-06-28 12:21:42,739 - ldap_auth_provider - 373 - DEBUG - POST-12- LDAP search filter: (&(sAMAccountName=korepov)(userAccountControl=512))
2017-06-28 12:21:42,751 - ldap_auth_provider - 384 - DEBUG - POST-12- LDAP search found dn: CN=Алексей Корепов,CN=Users,DC=office,DC=qseo,DC=ru
2017-06-28 12:21:42,751 - synapse.metrics - 162 - INFO - POST-12- Collecting gc 0
2017-06-28 12:21:42,753 - twisted - 131 - ERROR - POST-12- Traceback (most recent call last):
2017-06-28 12:21:42,753 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/handlers.py", line 76, in emit
2017-06-28 12:21:42,754 - twisted - 131 - ERROR - POST-12-     if self.shouldRollover(record):
2017-06-28 12:21:42,755 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/handlers.py", line 156, in shouldRollover
2017-06-28 12:21:42,755 - twisted - 131 - ERROR - POST-12-     msg = "%s\n" % self.format(record)
2017-06-28 12:21:42,756 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
2017-06-28 12:21:42,757 - twisted - 131 - ERROR - POST-12-     return fmt.format(record)
2017-06-28 12:21:42,757 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 465, in format
2017-06-28 12:21:42,758 - twisted - 131 - ERROR - POST-12-     record.message = record.getMessage()
2017-06-28 12:21:42,758 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage
2017-06-28 12:21:42,759 - twisted - 131 - ERROR - POST-12-     msg = msg % self.args
2017-06-28 12:21:42,759 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/dist-packages/ldap3/core/connection.py", line 308, in __str__
2017-06-28 12:21:42,760 - twisted - 131 - ERROR - POST-12-     'user: ' + str(self.user),
2017-06-28 12:21:42,760 - twisted - 131 - ERROR - POST-12- UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-9: ordinal not in range(128)
2017-06-28 12:21:42,761 - twisted - 131 - ERROR - POST-12- Logged from file ldap_auth_provider.py, line 285
2017-06-28 12:21:42,812 - twisted - 131 - ERROR - POST-12- Traceback (most recent call last):
2017-06-28 12:21:42,812 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/handlers.py", line 76, in emit
2017-06-28 12:21:42,813 - twisted - 131 - ERROR - POST-12-     if self.shouldRollover(record):
2017-06-28 12:21:42,813 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/handlers.py", line 156, in shouldRollover
2017-06-28 12:21:42,814 - twisted - 131 - ERROR - POST-12-     msg = "%s\n" % self.format(record)
2017-06-28 12:21:42,814 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
2017-06-28 12:21:42,815 - twisted - 131 - ERROR - POST-12-     return fmt.format(record)
2017-06-28 12:21:42,815 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 465, in format
2017-06-28 12:21:42,816 - twisted - 131 - ERROR - POST-12-     record.message = record.getMessage()
2017-06-28 12:21:42,816 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage
2017-06-28 12:21:42,817 - twisted - 131 - ERROR - POST-12-     msg = msg % self.args
2017-06-28 12:21:42,817 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/dist-packages/ldap3/core/connection.py", line 308, in __str__
2017-06-28 12:21:42,817 - twisted - 131 - ERROR - POST-12-     'user: ' + str(self.user),
2017-06-28 12:21:42,818 - twisted - 131 - ERROR - POST-12- UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-9: ordinal not in range(128)
2017-06-28 12:21:42,818 - twisted - 131 - ERROR - POST-12- Logged from file ldap_auth_provider.py, line 294
2017-06-28 12:21:42,839 - ldap_auth_provider - 299 - DEBUG - POST-12- LDAP Bind successful in simple bind mode.
2017-06-28 12:21:42,839 - twisted - 131 - ERROR - POST-12- Traceback (most recent call last):
2017-06-28 12:21:42,840 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/handlers.py", line 76, in emit
2017-06-28 12:21:42,840 - twisted - 131 - ERROR - POST-12-     if self.shouldRollover(record):
2017-06-28 12:21:42,841 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/handlers.py", line 156, in shouldRollover
2017-06-28 12:21:42,841 - twisted - 131 - ERROR - POST-12-     msg = "%s\n" % self.format(record)
2017-06-28 12:21:42,842 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
2017-06-28 12:21:42,842 - twisted - 131 - ERROR - POST-12-     return fmt.format(record)
2017-06-28 12:21:42,843 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 465, in format
2017-06-28 12:21:42,843 - twisted - 131 - ERROR - POST-12-     record.message = record.getMessage()
2017-06-28 12:21:42,844 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage
2017-06-28 12:21:42,844 - twisted - 131 - ERROR - POST-12-     msg = msg % self.args
2017-06-28 12:21:42,845 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/dist-packages/ldap3/core/connection.py", line 308, in __str__
2017-06-28 12:21:42,845 - twisted - 131 - ERROR - POST-12-     'user: ' + str(self.user),
2017-06-28 12:21:42,845 - twisted - 131 - ERROR - POST-12- UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-9: ordinal not in range(128)
2017-06-28 12:21:42,846 - twisted - 131 - ERROR - POST-12- Logged from file ldap_auth_provider.py, line 127
2017-06-28 12:21:42,847 - twisted - 131 - ERROR - POST-12- Traceback (most recent call last):
2017-06-28 12:21:42,847 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/handlers.py", line 76, in emit
2017-06-28 12:21:42,847 - twisted - 131 - ERROR - POST-12-     if self.shouldRollover(record):
2017-06-28 12:21:42,848 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/handlers.py", line 156, in shouldRollover
2017-06-28 12:21:42,848 - twisted - 131 - ERROR - POST-12-     msg = "%s\n" % self.format(record)
2017-06-28 12:21:42,849 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 734, in format
2017-06-28 12:21:42,849 - twisted - 131 - ERROR - POST-12-     return fmt.format(record)
2017-06-28 12:21:42,850 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 465, in format
2017-06-28 12:21:42,850 - twisted - 131 - ERROR - POST-12-     record.message = record.getMessage()
2017-06-28 12:21:42,851 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage
2017-06-28 12:21:42,851 - twisted - 131 - ERROR - POST-12-     msg = msg % self.args
2017-06-28 12:21:42,852 - twisted - 131 - ERROR - POST-12-   File "/usr/lib/python2.7/dist-packages/ldap3/core/connection.py", line 308, in __str__
2017-06-28 12:21:42,852 - twisted - 131 - ERROR - POST-12-     'user: ' + str(self.user),
2017-06-28 12:21:42,852 - twisted - 131 - ERROR - POST-12- UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-9: ordinal not in range(128)
2017-06-28 12:21:42,853 - twisted - 131 - ERROR - POST-12- Logged from file ldap_auth_provider.py, line 141
2017-06-28 12:21:42,858 - synapse.handlers.auth - 433 - INFO - POST-12- Logging in user @korepov:example.com on device BCUJZDNXXX

How can I fix this problem?

Synapse 0.25 appears to have broken this package

It looks like the API changed for auth providers from what I can tell. This is the stack trace I get when trying to auth against our LDAP server

2017-11-16 08:57:01,220 - synapse.http.server - 139 - ERROR - POST-42- Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x7f54af13f090>: <SynapseRequest at 0x7f54ac35bb48 method=POST uri=/_matrix/client/r0/login? clientproto=HTTP/1.1 site=8008>
Traceback (most recent call last):
  File "/home/user/.synapse/local/lib/python2.7/site-packages/synapse/http/server.py", line 116, in wrapped_request_handler
    yield request_handler(self, request, request_metrics)
  File "/home/user/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1299, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/home/user/.synapse/local/lib/python2.7/site-packages/twisted/python/failure.py", line 393, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/home/user/.synapse/local/lib/python2.7/site-packages/synapse/http/server.py", line 257, in _async_render
    callback_return = yield callback(request, **kwargs)
  File "/home/user/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1299, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/home/user/.synapse/local/lib/python2.7/site-packages/twisted/python/failure.py", line 393, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/home/user/.synapse/local/lib/python2.7/site-packages/synapse/rest/client/v1/login.py", line 154, in on_POST
    result = yield self._do_other_login(login_submission)
  File "/home/user/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1301, in _inlineCallbacks
    result = g.send(result)
  File "/home/user/.synapse/local/lib/python2.7/site-packages/synapse/rest/client/v1/login.py", line 224, in _do_other_login
    login_submission,
ValueError: too many values to unpack

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.