Bug 2818 - Fails to bind to LDAP server while smbd startup
Summary: Fails to bind to LDAP server while smbd startup
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Domain Control (show other bugs)
Version: 3.0.14a
Hardware: x86 Linux
: P3 regression
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-23 01:03 UTC by Tim Plessers
Modified: 2005-09-29 08:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Plessers 2005-06-23 01:03:18 UTC
In the process of setting up a Samba 3.0.14a PDC using OpenLDAP 2.2.23-5 and
smbldap-tools-0.9.1-1 on Fedora Core 4, I encountered a problem.

When starting smbd, it's unable to bind to the LDAP server, while all other
software can (ldapbrowser, ...).  Even when I use smbpasswd to change a current
users' password, it binds to the LDAP server succesfully.

I used Ethereal to capture the packets that are sent between them and I came to
the following conclusion :

When samba tries to bind while starting up, it sends the password with \n after it.

<snip from ethereal capture>

LDAP Message, Bind Request
   Message Id: 1
   Message Type: Bind Request (0x00)
   Message Length: 44
   Response In: 13
   Version: 3
   DN: cn=Manager,dc=EXAMPLE,dc=COM
   Auth Type: Simple (0x00)
   Password: secret\n


This isn't the case when I use ldapbrowser or smbpasswd to access ldap, in those
cases, the password is sent correctly without the \n.

Is this because of smbpasswd -w secret <enter> ?


/var/log/ldap/openldap.log says :

Jun 22 14:51:16 zapplinux02 slapd[27676]: conn=0 fd=10 ACCEPT from
IP=127.0.0.1:46590 (IP=0.0.0.0:389)
Jun 22 14:51:16 zapplinux02 slapd[27676]: conn=0 op=0 BIND
dn="cn=Manager,dc=EXAMPLE,dc=COM" method=128
Jun 22 14:51:16 zapplinux02 slapd[27676]: conn=0 op=0 RESULT tag=97 err=49 text=
Jun 22 14:51:16 zapplinux02 slapd[27676]: conn=0 op=1 UNBIND
Jun 22 14:51:16 zapplinux02 slapd[27676]: conn=0 fd=10 closed


/var/log/samba/log.smbd says :

[2005/06/21 16:59:29, 2] lib/smbldap.c:smbldap_open_connection(692)
  smbldap_open_connection: connection opened
[2005/06/21 16:59:29, 2] lib/smbldap.c:smbldap_connect_system(852)
  failed to bind to server ldap://127.0.0.1/ with
dn="cn=Manager,dc=EXAMPLE,dc=COM" Error: Can't contact LDAP server
        (unknown)
[2005/06/21 16:59:29, 1] lib/smbldap.c:another_ldap_try(1011)
  Connection to LDAP server failed for the 1 try!

... and tries for another 15 times.
Comment 1 Gerald (Jerry) Carter (dead mail address) 2005-07-15 15:56:43 UTC
I can't reproduce this.  smbpasswd -w 'pass' should strip the 
trailing '\n'.
Comment 2 Gerald (Jerry) Carter (dead mail address) 2005-09-29 08:01:48 UTC
closing