Bug 11210 - printer rename leaves stale entries in the cache
printer rename leaves stale entries in the cache
Status: RESOLVED FIXED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Printing
unspecified
All All
: P5 major
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-10 17:19 UTC by David Disseldorp
Modified: 2015-04-21 19:02 UTC (History)
4 users (show)

See Also:


Attachments
Proposed fix for master (1.60 KB, patch)
2015-04-10 17:24 UTC, David Disseldorp
asn: review+
gd: review+
jra: review+
Details
patch for 4.1.next (1.83 KB, patch)
2015-04-14 09:21 UTC, David Disseldorp
ddiss: review? (asn)
jra: review+
Details
patch for 4.2.next (1.83 KB, patch)
2015-04-14 10:25 UTC, David Disseldorp
ddiss: review? (asn)
jra: review+
Details
patch against v3-6-stable branch, for those playing along at home (1.92 KB, patch)
2015-04-14 10:27 UTC, David Disseldorp
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Disseldorp 2015-04-10 17:19:37 UTC
Currently the name cache is only cleared on printer deletion. This means that if a printer undergoes a name change, the old name remains in the cache and can be subsequently used incorrectly if another printer takes the same name as the old.

I'm flagging this as core dev only, as the incorrect printer handle return raises eyebrows. However, permission checks are done on the (incorrect) handle after it has been retrieved via find_printer_index_by_hnd(), so I don't think this is a security issue.

@Andreas, Günther or others: please confirm.
Comment 1 David Disseldorp 2015-04-10 17:24:04 UTC
Created attachment 10944 [details]
Proposed fix for master
Comment 2 Jeremy Allison 2015-04-13 22:56:11 UTC
Comment on attachment 10944 [details]
Proposed fix for master

LGTM. Pushed !
Comment 3 Guenther Deschner 2015-04-14 08:12:27 UTC
Comment on attachment 10944 [details]
Proposed fix for master

Looks good, thanks!
Comment 4 Guenther Deschner 2015-04-14 08:15:16 UTC
David, I'm wondering, can we now remove the safeguard in the spoolss torture test and enable testing this ?

Look for the "samba currently cannot fully rename printers" inline comment.
Comment 5 David Disseldorp 2015-04-14 09:21:31 UTC
Created attachment 10950 [details]
patch for 4.1.next
Comment 6 David Disseldorp 2015-04-14 09:22:23 UTC
(In reply to Guenther Deschner from comment #4)
Sounds like a good plan Günther, but I'd like to do some further testing first, to make sure we don't have any flapping tests.
Comment 7 David Disseldorp 2015-04-14 10:25:15 UTC
Created attachment 10951 [details]
patch for 4.2.next
Comment 8 David Disseldorp 2015-04-14 10:27:50 UTC
Created attachment 10952 [details]
patch against v3-6-stable branch, for those playing along at home
Comment 9 Jeremy Allison 2015-04-14 20:22:49 UTC
Comment on attachment 10951 [details]
patch for 4.2.next

LGTM.
Comment 10 Jeremy Allison 2015-04-14 20:32:26 UTC
Comment on attachment 10950 [details]
patch for 4.1.next

LGTM.
Comment 11 Jeremy Allison 2015-04-14 20:32:47 UTC
Karolin please push to 4.2.next, 4.1.next.

Thanks !

Jeremy.
Comment 12 Karolin Seeger 2015-04-19 19:19:56 UTC
(In reply to Jeremy Allison from comment #11)
Pushed to autobuild-v4-[1|2]-test.
Comment 13 Karolin Seeger 2015-04-20 19:46:46 UTC
(In reply to Karolin Seeger from comment #12)
Pushed to v4-2-test.
autobuild-v4-1-test failed -> re-trying
Comment 14 Karolin Seeger 2015-04-21 19:02:28 UTC
(In reply to Karolin Seeger from comment #13)
Pushed to v4-1-test.
Closing out bug report.

Thanks!