[SCM] Samba Shared Repository - branch v3-6-test updated

Jeremy Allison jra at samba.org
Wed Sep 8 11:06:11 MDT 2010


The branch, v3-6-test has been updated
       via  7c99b9e s3: Prune the printername cache when a printer is deleted
      from  9234d10 s3/libads: use monotonic clock for ldap connection timeouts

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit 7c99b9e46631bc26234a9a33355b68a89b32d18f
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 8 10:05:39 2010 -0700

    s3: Prune the printername cache when a printer is deleted
    
    (back port of commit 7612760c2226bc43c68f1a7e3b2985d0a22bf277
    from master).

-----------------------------------------------------------------------

Summary of changes:
 source3/rpc_server/srv_spoolss_nt.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index f83de14..03b8a60 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -97,6 +97,8 @@ struct xcv_api_table {
 	WERROR(*fn) (TALLOC_CTX *mem_ctx, NT_USER_TOKEN *token, DATA_BLOB *in, DATA_BLOB *out, uint32_t *needed);
 };
 
+static void prune_printername_cache(void);
+
 /********************************************************************
  * Canonicalize servername.
  ********************************************************************/
@@ -374,8 +376,13 @@ static WERROR delete_printer_handle(struct pipes_struct *p, struct policy_handle
 		return WERR_BADFID;
 	}
 
-	return delete_printer_hook(p->mem_ctx, p->server_info->ptok,
+	result = delete_printer_hook(p->mem_ctx, p->server_info->ptok,
 				   Printer->sharename );
+	if (!W_ERROR_IS_OK(result)) {
+		return result;
+	}
+	prune_printername_cache();
+	return WERR_OK;
 }
 
 /****************************************************************************
@@ -433,6 +440,17 @@ static bool set_printer_hnd_printertype(Printer_entry *Printer, const char *hand
 	return true;
 }
 
+static void prune_printername_cache_fn(const char *key, const char *value,
+					time_t timeout, void *private_data)
+{
+	gencache_del(key);
+}
+
+static void prune_printername_cache(void)
+{
+	gencache_iterate(prune_printername_cache_fn, NULL, "PRINTERNAME/*");
+}
+
 /****************************************************************************
  Set printer handle name..  Accept names like \\server, \\server\printer,
  \\server\SHARE, & "\\server\,XcvMonitor Standard TCP/IP Port"    See


-- 
Samba Shared Repository


More information about the samba-cvs mailing list