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

back-<shell/tcl> abandon needs mutex (ITS#2564)



Full_Name: Hallvard B Furuseth
Version: HEAD
OS: Solaris
URL: ftp://ftp.openldap.org/incoming/Hallvard-Furuseth-030602.tgz
Submission from: (NULL) (129.240.186.42)
Submitted by: hallvard


back-shell/abandon.c can access op->o_bd->be_private of some operation
(in the LDAP_STAILQ_FOREACH loop) before e.g. search.c can set it
(as op->o_private).

Fix: Either protect it with a mutex, or remove the abandon operations
from back-shell and back-tcl.

To reproduce:

In back-shell/search.c, apply this patch to set o_private to a distinctive
value and then sleep a bit.

--- slapd/back-shell/search.c~	Mon Jun  2 14:29:17 2003
+++ slapd/back-shell/search.c	Mon Jun  2 14:18:58 2003
@@ -31,4 +31,7 @@
 	}
 
+ op->o_private = (void *) 12345;
+ sleep(5);
+
 	if ( (op->o_private = (void *) forkandexec( si->si_search, &rfp, &wfp ))
 	    == (void *) -1 ) {

Then run tst.c from the .tgz file above, with
  slapd -d 0 -h ldap://localhost:3890/ -f etc/openldap/slapd-shell.conf