The Samba-Bugzilla – Attachment 17402 Details for
Bug 15082
The pcap background queue process should not be stopped
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.16
0001-s3-printing-Do-not-clear-the-printer-list.tdb.patch (text/plain), 3.75 KB, created by
Andreas Schneider
on 2022-07-01 07:12:54 UTC
(
hide
)
Description:
patch for 4.16
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2022-07-01 07:12:54 UTC
Size:
3.75 KB
patch
obsolete
>From b3d007859041a4d868630c74cda9cc6b4cdf2739 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 22 Jun 2022 18:56:26 +0200 >Subject: [PATCH] s3:printing: Do not clear the printer-list.tdb > >With the new dcerpc architecture we need to keep printer-list.tdb >around. A spoolss dcerpc call will start rpc-spoolssd which will then >start the background queue process. However in order to enum the >printers we need have a printer-list.tdb. Depending on the number of >printers this task can take several seconds. It is unlinkly that >the printer-list will change all the time, so we might provide outdated >data till it gets refreshed, but this is better than providing no >printer list at all. > >If there are a lot of printers, the idle_seconds for the rpc-spoolssd >should be increased so that the background task can finish. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15082 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Thu Jun 30 22:08:39 UTC 2022 on sn-devel-184 >--- > source3/printing/printer_list.c | 41 ++++++++++++--------------------- > source3/printing/printer_list.h | 2 -- > source3/printing/printing.c | 4 ---- > 3 files changed, 15 insertions(+), 32 deletions(-) > >diff --git a/source3/printing/printer_list.c b/source3/printing/printer_list.c >index 4efcc2e2dd8..8ff75dc6bdd 100644 >--- a/source3/printing/printer_list.c >+++ b/source3/printing/printer_list.c >@@ -30,13 +30,14 @@ > #define PL_DATA_FORMAT "ddPPP" > #define PL_TSTAMP_FORMAT "dd" > >+static struct db_context *printerlist_db; >+ > static struct db_context *get_printer_list_db(void) > { >- static struct db_context *db; > char *db_path; > >- if (db != NULL) { >- return db; >+ if (printerlist_db != NULL) { >+ return printerlist_db; > } > > db_path = lock_path(talloc_tos(), "printer_list.tdb"); >@@ -44,31 +45,19 @@ static struct db_context *get_printer_list_db(void) > return NULL; > } > >- db = db_open(NULL, db_path, 0, >- TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, >- O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_1, >- DBWRAP_FLAG_NONE); >+ printerlist_db = db_open(NULL, >+ db_path, >+ 0, >+ TDB_DEFAULT|TDB_INCOMPATIBLE_HASH, >+ O_RDWR|O_CREAT, >+ 0644, >+ DBWRAP_LOCK_ORDER_1, >+ DBWRAP_FLAG_NONE); > TALLOC_FREE(db_path); >- return db; >-} >- >-bool printer_list_parent_init(void) >-{ >- struct db_context *db; >- >- /* >- * Open the tdb in the parent process (smbd) so that our >- * CLEAR_IF_FIRST optimization in tdb_reopen_all can properly >- * work. >- */ >- >- db = get_printer_list_db(); >- if (db == NULL) { >- DEBUG(1, ("could not open Printer List Database: %s\n", >- strerror(errno))); >- return false; >+ if (printerlist_db == NULL) { >+ DBG_ERR("Failed to open printer_list.tdb\n"); > } >- return true; >+ return printerlist_db; > } > > NTSTATUS printer_list_get_printer(TALLOC_CTX *mem_ctx, >diff --git a/source3/printing/printer_list.h b/source3/printing/printer_list.h >index f30b3150671..c687048fc3b 100644 >--- a/source3/printing/printer_list.h >+++ b/source3/printing/printer_list.h >@@ -20,8 +20,6 @@ > #ifndef _PRINTER_LIST_H_ > #define _PRINTER_LIST_H_ > >-bool printer_list_parent_init(void); >- > /** > * @brief Get the comment and the last refresh time from the printer list > * database. >diff --git a/source3/printing/printing.c b/source3/printing/printing.c >index 67d798fbb21..284c6e68cb0 100644 >--- a/source3/printing/printing.c >+++ b/source3/printing/printing.c >@@ -61,10 +61,6 @@ bool print_backend_init(struct messaging_context *msg_ctx) > bool ok; > char *print_cache_path; > >- if (!printer_list_parent_init()) { >- return false; >- } >- > print_cache_path = cache_path(talloc_tos(), "printing"); > if (print_cache_path == NULL) { > return false; >-- >2.36.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15082
:
17402
|
17403