s3: Lift the smbd_messaging_context from is_printer_published
authorVolker Lendecke <vl@samba.org>
Sun, 8 Aug 2010 12:39:40 +0000 (14:39 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 8 Aug 2010 14:03:26 +0000 (16:03 +0200)
source3/include/nt_printing.h
source3/printing/nt_printing_ads.c
source3/rpc_server/srv_spoolss_nt.c
source3/smbd/server_reload.c

index 97f70faf3909928abfed0713b15e151959bc66b9..7ebacc6985434b7298accb60efc2d5a7e5f8a5be 100644 (file)
@@ -249,6 +249,7 @@ WERROR nt_printer_publish(TALLOC_CTX *mem_ctx,
 
 bool is_printer_published(TALLOC_CTX *mem_ctx,
                          struct auth_serversupplied_info *server_info,
 
 bool is_printer_published(TALLOC_CTX *mem_ctx,
                          struct auth_serversupplied_info *server_info,
+                         struct messaging_context *msg_ctx,
                          char *servername, char *printer, struct GUID *guid,
                          struct spoolss_PrinterInfo2 **info2);
 
                          char *servername, char *printer, struct GUID *guid,
                          struct spoolss_PrinterInfo2 **info2);
 
index f0d568b8bf04bfe0a3ed415497d919580ba25ece..e0ace23d4d87b370797d2c55cdc3d35e766d20a7 100644 (file)
@@ -381,6 +381,7 @@ done:
 
 bool is_printer_published(TALLOC_CTX *mem_ctx,
                          struct auth_serversupplied_info *server_info,
 
 bool is_printer_published(TALLOC_CTX *mem_ctx,
                          struct auth_serversupplied_info *server_info,
+                         struct messaging_context *msg_ctx,
                          char *servername, char *printer, struct GUID *guid,
                          struct spoolss_PrinterInfo2 **info2)
 {
                          char *servername, char *printer, struct GUID *guid,
                          struct spoolss_PrinterInfo2 **info2)
 {
@@ -391,8 +392,7 @@ bool is_printer_published(TALLOC_CTX *mem_ctx,
        WERROR result;
        NTSTATUS status;
 
        WERROR result;
        NTSTATUS status;
 
-       result = winreg_get_printer(mem_ctx, server_info,
-                                   smbd_messaging_context(),
+       result = winreg_get_printer(mem_ctx, server_info, msg_ctx,
                                    servername, printer, &pinfo2);
        if (!W_ERROR_IS_OK(result)) {
                return false;
                                    servername, printer, &pinfo2);
        if (!W_ERROR_IS_OK(result)) {
                return false;
@@ -409,8 +409,8 @@ bool is_printer_published(TALLOC_CTX *mem_ctx,
 
        /* fetching printer guids really ought to be a separate function. */
 
 
        /* fetching printer guids really ought to be a separate function. */
 
-       result = winreg_get_printer_dataex(mem_ctx, server_info,
-                                          smbd_messaging_context(), printer,
+       result = winreg_get_printer_dataex(mem_ctx, server_info, msg_ctx,
+                                          printer,
                                           SPOOL_DSSPOOLER_KEY, "objectGUID",
                                           &type, &data, &data_size);
        if (!W_ERROR_IS_OK(result)) {
                                           SPOOL_DSSPOOLER_KEY, "objectGUID",
                                           &type, &data, &data_size);
        if (!W_ERROR_IS_OK(result)) {
index b8a8526eec24b317495dd25ad7d2cd8dd5ac798b..9341809128ddfac23f0ba7c09a5c2002e55cb019 100644 (file)
@@ -3755,7 +3755,9 @@ static WERROR construct_printer_info7(TALLOC_CTX *mem_ctx,
                return WERR_NOMEM;
        }
 
                return WERR_NOMEM;
        }
 
-       if (is_printer_published(mem_ctx, server_info, print_hnd->servername,
+       if (is_printer_published(mem_ctx, server_info,
+                                smbd_messaging_context(),
+                                print_hnd->servername,
                                 lp_servicename(snum), &guid, NULL)) {
                r->guid = talloc_strdup_upper(mem_ctx, GUID_string2(mem_ctx, &guid));
                r->action = DSPRINT_PUBLISH;
                                 lp_servicename(snum), &guid, NULL)) {
                r->guid = talloc_strdup_upper(mem_ctx, GUID_string2(mem_ctx, &guid));
                r->action = DSPRINT_PUBLISH;
index 220147da602d037bf713f35e3dc70468fd8df0ec..4a499daf25d3dbeab7a4d9c8bcb7b8f3b14cd6b7 100644 (file)
@@ -63,6 +63,7 @@ void reload_printers(void)
                        DEBUG(3, ("removing stale printer %s\n", pname));
 
                        if (is_printer_published(server_info, server_info,
                        DEBUG(3, ("removing stale printer %s\n", pname));
 
                        if (is_printer_published(server_info, server_info,
+                                                smbd_messaging_context(),
                                                 NULL, lp_servicename(snum),
                                                 NULL, &pinfo2)) {
                                nt_printer_publish(server_info,
                                                 NULL, lp_servicename(snum),
                                                 NULL, &pinfo2)) {
                                nt_printer_publish(server_info,