r12267: Try to avoid segfault in kerberos libs, because we talloc_free()'ed
authorAndrew Bartlett <abartlet@samba.org>
Thu, 15 Dec 2005 20:25:37 +0000 (20:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:47:25 +0000 (13:47 -0500)
the old event context in the standard process modal child.

Andrew Bartlett
(This used to be commit 0f52a9ab071c181c7f764adc8be83e162e649931)

source4/smbd/process_single.c
source4/smbd/process_standard.c
source4/smbd/process_thread.c
source4/smbd/server.c

index 8c9dd2f7fa7a45decbb7a79945e8a81c1a550abb..d46ee487185359d254dc00ba043cd49731ef9c08 100644 (file)
 #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);
 }
 
 /*
index bbc0aa4c7ed6417915389d3437e68758f6e63432..5149ab55b676a0f768ee032cba1ddd2c2a5b7c35 100644 (file)
@@ -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 @@ static void standard_accept_connection(struct event_context *ev,
                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();
 
index e5ed74e93972a8d0d60ab17e198439789743234c..b79c2f76b5171a722b52b937277b186ddf1f59a9 100644 (file)
@@ -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 @@ static void thread_model_init(struct event_context *event_context)
        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);
 }
 
 
index 30758967225a177b35ff4a3d70cb042d9e6d8434..4d1e70d68e51bb9d0075a45d5c74545cd305af95 100644 (file)
@@ -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 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
                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);