[Date Prev][Date Next] [Chronological] [Thread] [Top]

slapd segfaults with bad LDAP URL (ITS#2132)



Full_Name: Hallvard B. Furuseth
Version: HEAD
OS: Solaris
URL: 
Submission from: (NULL) (129.240.186.42)


Run this as another user than root:
   	libexec/slapd -d -1 -h ldap://localhost/

Output (with NEW_LOGGING):
CONNECTION:: slapd_daemon_init: ldap://localhost/
CONNECTION:: slap_daemon_init: listen on ldap://localhost/
.
CONNECTION:: slap_daemon_init: 1 listeners to open...
OPERATION:: ldap_url_parse_ext(ldap://localhost/)
CONNECTION:: slap_open_listener: bind(7) failed errno=13 (Permission denied)
CONNECTION:: slap_open_listener: bind(7) failed errno=13 (Permission denied)
CONNECTION:: slap_open_listener: daemon initialzed Segmentation Fault

The segfault is on line 864:
	LDAP_LOG( CONNECTION, RESULTS, 
			"slap_open_listener: daemon initialzed %s\n", l.sl_url, 0, 0 );
because l.sl_url has not been initialized (because binding failed).

Another strange thing is that bind is attempted twice even though I only gave
one LDAP URL.

I'm not going to dive into this now, but it looks like error handling in
slap_open_listener() needs a lot of fixups.  Maybe some code is confused
because the function is mis-indented.