Bug 7704 - Possible error in fix to rpc_server/srv_spoolss_nt.c
Summary: Possible error in fix to rpc_server/srv_spoolss_nt.c
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Printing (show other bugs)
Version: unspecified
Hardware: All All
: P3 trivial
Target Milestone: ---
Assignee: Jeremy Allison
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-28 09:39 UTC by Peter Benie
Modified: 2012-01-18 12:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Benie 2010-09-28 09:39:40 UTC
To fix a problem where an 'access denied' message was given when successfully deleting a printer, the test at the end of delete_printer_hook() was changed from:
if ( lp_servicenumber( sharename )  < 0 ) {
to
if ( lp_servicenumber( sharename )  > 0 ) {

See http://gitweb.samba.org/?p=samba.git;a=commitdiff;h=43e3d8f51da4bbdb3108af45e2fddab7e2e91f04;hp=8ce66fba03f782c0b9948a9835bb488cfa74acf9

Is this change really correct? Service numbers start from 0 so it looks like this should be
lp_servicenumber( sharename )  >= 0, or possibly:
lp_servicenumber( sharename )  != GLOBAL_SECTION_SNUM
Comment 1 Jeremy Allison 2010-10-01 18:57:32 UTC
Your fix is correct, I'll push to master and 3.6.0.
Thanks !

Jeremy.
Comment 2 Guenther Deschner 2010-10-01 19:25:00 UTC
Jeremy: does this pass make test successfully ?
Comment 3 Jeremy Allison 2010-10-01 22:11:44 UTC
Probably :-). Once I've had chance to test I'll push.
Jeremy.
Comment 4 Andreas Schneider 2011-09-01 10:31:35 UTC
Jeremy, did you have a chance to test this?
Comment 5 Andreas Schneider 2012-01-09 10:13:54 UTC
Ping! We are going towards 3.6.1 :)
Comment 6 Jeremy Allison 2012-01-09 19:47:21 UTC
This went into v3-6-test in commit:

a72eba09a2fcc79990e88042d02b4f2a8e1f75c6
Author: Jeremy Allison <jra@samba.org>
Date:   Mon Oct 4 15:48:04 2010 -0700

    Fix bug 7704 - Possible error in fix to rpc_server/srv_spoolss_nt.c.
    
    From pjb1008@cam.ac.uk - Service numbers start from 0.
    (cherry picked from commit f1c367e60a443fe8fe40b3a7bd82d5ec2cfe669e)

So I think we're good for 3.6.2.

Jeremy.