s3: Remove the smbd_messaging_context from spoolss_init_cb
[amitay/samba.git] / source3 / smbd / process.c
index afc30face882522d5b109461a5d57b6b541360af..05e53904d77fd8a367c97e32716f92a47d4778a4 100644 (file)
@@ -2862,7 +2862,9 @@ fail:
 
 static bool spoolss_init_cb(void *ptr)
 {
-       return nt_printing_tdb_migrate(smbd_messaging_context());
+       struct messaging_context *msg_ctx = talloc_get_type_abort(
+               ptr, struct messaging_context);
+       return nt_printing_tdb_migrate(msg_ctx);
 }
 
 /****************************************************************************
@@ -3124,7 +3126,7 @@ void smbd_process(struct smbd_server_connection *sconn)
         */
        spoolss_cb.init = spoolss_init_cb;
        spoolss_cb.shutdown = NULL;
-
+       spoolss_cb.private_data = sconn->msg_ctx;
 
        if (!NT_STATUS_IS_OK(rpc_winreg_init(NULL))) {
                exit(1);