]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/samba/samba-3.6.99-fix_stale_printer_entries_on_rename.patch
Merge branch 'core110'
[ipfire-2.x.git] / src / patches / samba / samba-3.6.99-fix_stale_printer_entries_on_rename.patch
1 From 20d92c8a18beb4af2b9020efed15f5238d86d13c Mon Sep 17 00:00:00 2001
2 From: David Disseldorp <ddiss@samba.org>
3 Date: Wed, 1 Apr 2015 01:03:13 +0200
4 Subject: [PATCH] PATCHSET30 spoolss: purge the printer name cache on name
5 change
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Currently the name cache is only cleared on printer deletion. This means
11 that if a printer undergoes a name change, the old name remains in the
12 cache and can be subsequently used incorrecly if another printer takes
13 the same name as the old.
14
15 Bug: https://bugzilla.samba.org/show_bug.cgi?id=11210
16
17 Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
18 Signed-off-by: David Disseldorp <ddiss@samba.org>
19 Reviewed-by: Jeremy Allison <jra@samba.org>
20
21 Autobuild-User(master): Jeremy Allison <jra@samba.org>
22 Autobuild-Date(master): Tue Apr 14 05:37:50 CEST 2015 on sn-devel-104
23
24 (cherry picked from commit a97507a9a7ba01beead6a621e1210618e93a9f9c)
25 ---
26 source3/rpc_server/spoolss/srv_spoolss_nt.c | 6 ++++++
27 1 file changed, 6 insertions(+)
28
29 diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
30 index fb8f61f..629bdc2 100644
31 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
32 +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
33 @@ -6373,6 +6373,9 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
34 snum, printer->sharename ?
35 printer->sharename : "");
36 }
37 +
38 + /* name change, purge any cache entries for the old */
39 + prune_printername_cache();
40 }
41
42 if (force_update || !strequal(printer->printername, old_printer->printername)) {
43 @@ -6398,6 +6401,9 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
44 notify_printer_printername(server_event_context(),
45 msg_ctx, snum, p ? p : "");
46 }
47 +
48 + /* name change, purge any cache entries for the old */
49 + prune_printername_cache();
50 }
51
52 if (force_update || !strequal(printer->portname, old_printer->portname)) {
53 --
54 2.5.0
55