Bug 2855 - In the passdb/pdb_ldap.c the functions of the lib/smbldap.c are incorrectly initialized
Summary: In the passdb/pdb_ldap.c the functions of the lib/smbldap.c are incorrectly i...
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Domain Control (show other bugs)
Version: 3.0.14a
Hardware: x86 FreeBSD
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-06 20:59 UTC by Andrey Chipaluk
Modified: 2020-03-15 22:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Chipaluk 2005-07-06 20:59:14 UTC
I make use of FreeBSD 5.4-STABLE, samba-3.0.14a, openldap- 2.2.26.

During start is used lib/smbldap.c by smbd daemon. Smbd daemon connects with 
slapd daemon. In the passdb/pdb_ldap.c the functions of the lib/smbldap.c are 
incorrectly initialized. The while loop with call of the function 
lib/smbldap.c:smbldap_idle_fn is not created. That results in error. 

I start with running the ldap server:

# ps ax|grep slapd
  532  ??  Ss     0:00,17 /usr/local/libexec/slapd -u ldap -g ldap

I start with running the samba server:

# ps ax|grep smbd
 1404  ??  Ss     0:00,01 /usr/local/sbin/smbd -D -s /usr/local/etc/smb.conf
 1406  ??  S      0:00,00 /usr/local/sbin/smbd -D -s /usr/local/etc/smb.conf
# ps ax|grep nmbd
 1398  ??  Ss     0:00,04 /usr/local/sbin/nmbd -D -s /usr/local/etc/smb.conf

I can see the following:

# sockstat |grep smbd
root     smbd       1406  6  tcp4   127.0.0.1:60917       127.0.0.1:389
root     smbd       1406  7  tcp4   127.0.0.1:56835       127.0.0.1:389
root     smbd       1404  6  tcp4   127.0.0.1:60917       127.0.0.1:389
root     smbd       1404  7  tcp4   127.0.0.1:56835       127.0.0.1:389
root     smbd       1404  21 tcp4   *:445                 *:*
root     smbd       1404  22 tcp4   *:139                 *:*

The following functions are performed sequentially:

passdb/pdb_ldap.c:pdb_init_ldapsam_common,
lib/smbldap.c:smbldap_init,
lib/module.c:smb_register_idle_event (smbldap_idle_fn is registered),
lib/smbldap.c:another_ldap_try,
lib/smbldap.c:smbldap_close,
lib/smbldap.c:smbldap_delete_state,
lib/smbldap.c:another_ldap_try,
lib/smbldap.c:smbldap_open, thus the connection to slapd daemon is made:

root     smbd       1406  6  tcp4   127.0.0.1:60917       127.0.0.1:389
root     smbd       1406  7  tcp4   127.0.0.1:56835       127.0.0.1:389
root     smbd       1404  6  tcp4   127.0.0.1:60917       127.0.0.1:389
root     smbd       1404  7  tcp4   127.0.0.1:56835       127.0.0.1:389

However, the while loop with call of the function 
lib/module.c:smb_run_idle_events is not started. Therefore smbldap_idle_fn is 
not called and connections of a smbd daemon with a slapd daemon remain not 
closed.

I do the following:

mount_smbfs //andy@temp/user /mnt
umount /mnt

The following functions are performed sequentially:

smbd/server.c:main,
smbd/process.c:smbd_process,
the while loop is created, “lib/module.c:smb_run_idle_events” is called:
the while loop is created, “lib/smbldap.c:smbldap_idle_fn” is called
state->last_use + SMBLDAP_IDLE_TIME < now
the function is performed:
lib/smbldap.c:smbldap_close
etc.:

I repeat:

mount_smbfs //user@temp/user /mnt
mount_smbfs: unable to open connection: syserr = Operation timed out

After a time:

# mount_smbfs //andy@temp/user /mnt
mount_smbfs: unable to open connection: syserr = Connection reset by peer

The following functions are performed sequentially:

smbd/server.c:main,
smbd/process.c:smbd_process,
the while loop is created, “lib/module.c:smb_run_idle_events” is called,
the while loop is created, “lib/smbldap.c:smbldap_idle_fn” is called
state->last_use + SMBLDAP_IDLE_TIME < now
the function is performed:
lib/smbldap.c:smbldap_close,
the process stops.
Comment 1 Gerald (Jerry) Carter (dead mail address) 2006-04-20 08:03:34 UTC
severity should be determined by the developers and not the reporter.
Comment 2 Timur Bakeyev 2007-06-03 07:34:41 UTC
(In reply to comment #0)
> I make use of FreeBSD 5.4-STABLE, samba-3.0.14a, openldap- 2.2.26.
> 
> During start is used lib/smbldap.c by smbd daemon. Smbd daemon connects with 
> slapd daemon. In the passdb/pdb_ldap.c the functions of the lib/smbldap.c are 
> incorrectly initialized. The while loop with call of the function 
> lib/smbldap.c:smbldap_idle_fn is not created. That results in error. 

Does this problem still exists in the latest versions of Samba3?

With regards,
Timur