s3:smbd: pass smbd_server_connection and a snumused function pointer to reload_services()
[kai/samba.git] / source3 / rpc_server / spoolss / srv_spoolss_nt.c
index 491d96566a8e10b80bd3ab0e9d40287b8dfda156..87df5659c7819d9984b382065e37734c9bf38bcc 100644 (file)
@@ -6202,6 +6202,16 @@ static WERROR add_port_hook(TALLOC_CTX *ctx, struct security_token *token, const
 /****************************************************************************
 ****************************************************************************/
 
+static bool spoolss_conn_snum_used(struct smbd_server_connection *sconn,
+                                  int snum)
+{
+       /*
+        * As we do not know if we are embedded in the file server process
+        * or not, we have to pretend that all shares are in use.
+        */
+       return true;
+}
+
 static bool add_printer_hook(TALLOC_CTX *ctx, struct security_token *token,
                             struct spoolss_SetPrinterInfo2 *info2,
                             const char *remote_machine,
@@ -6260,7 +6270,7 @@ static bool add_printer_hook(TALLOC_CTX *ctx, struct security_token *token,
 
        /* reload our services immediately */
        become_root();
-       reload_services(msg_ctx, -1, false);
+       reload_services(NULL, spoolss_conn_snum_used, false);
        unbecome_root();
 
        numlines = 0;