svn commit: samba r12267 - in branches/SAMBA_4_0/source/smbd: .

abartlet at samba.org abartlet at samba.org
Thu Dec 15 20:25:38 GMT 2005


Author: abartlet
Date: 2005-12-15 20:25:37 +0000 (Thu, 15 Dec 2005)
New Revision: 12267

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12267

Log:
Try to avoid segfault in kerberos libs, because we talloc_free()'ed
the old event context in the standard process modal child.

Andrew Bartlett


Modified:
   branches/SAMBA_4_0/source/smbd/process_single.c
   branches/SAMBA_4_0/source/smbd/process_standard.c
   branches/SAMBA_4_0/source/smbd/process_thread.c
   branches/SAMBA_4_0/source/smbd/server.c


Changeset:
Modified: branches/SAMBA_4_0/source/smbd/process_single.c
===================================================================
--- branches/SAMBA_4_0/source/smbd/process_single.c	2005-12-15 19:23:35 UTC (rev 12266)
+++ branches/SAMBA_4_0/source/smbd/process_single.c	2005-12-15 20:25:37 UTC (rev 12267)
@@ -28,12 +28,17 @@
 #include "smb_server/smb_server.h"
 #include "system/filesys.h"
 
+/* For sepecifiying event context to GSSAPI below */
+#include "heimdal/lib/gssapi/gssapi_locl.h"
 
+
 /*
   called when the process model is selected
 */
 static void single_model_init(struct event_context *ev)
 {
+	/* Hack to ensure that GSSAPI uses the right event context */
+	gssapi_krb5_init_ev(ev);
 }
 
 /*

Modified: branches/SAMBA_4_0/source/smbd/process_standard.c
===================================================================
--- branches/SAMBA_4_0/source/smbd/process_standard.c	2005-12-15 19:23:35 UTC (rev 12266)
+++ branches/SAMBA_4_0/source/smbd/process_standard.c	2005-12-15 20:25:37 UTC (rev 12267)
@@ -29,6 +29,9 @@
 #include "smb_server/smb_server.h"
 #include "system/filesys.h"
 
+/* For sepecifiying event context to GSSAPI below */
+#include "heimdal/lib/gssapi/gssapi_locl.h"
+
 /*
   called when the process model is selected
 */
@@ -94,6 +97,9 @@
 		DEBUG(0,("standard_accept_connection: tdb_reopen_all failed.\n"));
 	}
 
+	/* Hack to ensure that GSSAPI uses the right event context */
+	gssapi_krb5_init_ev(ev2);
+
 	/* Ensure that the forked children do not expose identical random streams */
 	set_need_random_reseed();
 

Modified: branches/SAMBA_4_0/source/smbd/process_thread.c
===================================================================
--- branches/SAMBA_4_0/source/smbd/process_thread.c	2005-12-15 19:23:35 UTC (rev 12266)
+++ branches/SAMBA_4_0/source/smbd/process_thread.c	2005-12-15 20:25:37 UTC (rev 12267)
@@ -35,6 +35,9 @@
 #include "smb_server/smb_server.h"
 #include "mutex.h"
 
+/* For sepecifiying event context to GSSAPI below */
+#include "heimdal/lib/gssapi/gssapi_locl.h"
+
 struct new_conn_state {
 	struct event_context *ev;
 	struct socket_context *sock;
@@ -502,7 +505,10 @@
 	d_ops.get_task_id = thread_get_task_id;
 	d_ops.log_task_id = thread_log_task_id;
 
-	register_debug_handlers("thread", &d_ops);	
+	register_debug_handlers("thread", &d_ops);
+
+	/* Hack to ensure that GSSAPI uses the right event context */
+	gssapi_krb5_init_ev(event_context);
 }
 
 

Modified: branches/SAMBA_4_0/source/smbd/server.c
===================================================================
--- branches/SAMBA_4_0/source/smbd/server.c	2005-12-15 19:23:35 UTC (rev 12266)
+++ branches/SAMBA_4_0/source/smbd/server.c	2005-12-15 20:25:37 UTC (rev 12267)
@@ -31,9 +31,6 @@
 #include "system/filesys.h"
 #include "system/kerberos.h"
 
-/* For sepecifiying event context to GSSAPI below */
-#include "heimdal/lib/gssapi/gssapi_locl.h"
-
 /*
   recursively delete a directory tree
 */
@@ -246,9 +243,6 @@
 		return 1;
 	}
 
-	/* Hack to ensure that GSSAPI uses the right event context */
-	gssapi_krb5_init_ev(event_ctx);
-
 	/* wait for events - this is where smbd sits for most of its
 	   life */
 	event_loop_wait(event_ctx);



More information about the samba-cvs mailing list