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.
Created attachment 10944 [details] Proposed fix for master
Comment on attachment 10944 [details] Proposed fix for master LGTM. Pushed !
Comment on attachment 10944 [details] Proposed fix for master Looks good, thanks!
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.
Created attachment 10950 [details] patch for 4.1.next
(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.
Created attachment 10951 [details] patch for 4.2.next
Created attachment 10952 [details] patch against v3-6-stable branch, for those playing along at home
Comment on attachment 10951 [details] patch for 4.2.next LGTM.
Comment on attachment 10950 [details] patch for 4.1.next LGTM.
Karolin please push to 4.2.next, 4.1.next. Thanks ! Jeremy.
(In reply to Jeremy Allison from comment #11) Pushed to autobuild-v4-[1|2]-test.
(In reply to Karolin Seeger from comment #12) Pushed to v4-2-test. autobuild-v4-1-test failed -> re-trying
(In reply to Karolin Seeger from comment #13) Pushed to v4-1-test. Closing out bug report. Thanks!