diff options
author | Gerald Carter <jerry@samba.org> | 2004-12-06 19:25:25 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:53:31 -0500 |
commit | 3bd3be97dc8a581c0502410453091c195e322766 (patch) | |
tree | 26809ad8915aaf7d9bccf5664bdb152e0761bcb4 /source3/rpc_server | |
parent | 57c468bbf1dd124f568c5beb1fb4a7d3c09dda71 (diff) | |
download | samba-3bd3be97dc8a581c0502410453091c195e322766.tar.gz samba-3bd3be97dc8a581c0502410453091c195e322766.tar.bz2 samba-3bd3be97dc8a581c0502410453091c195e322766.zip |
r4083: consolidate printer searches to use find_service rather than for loops
(This used to be commit 12440744ba36445186042c8c254785766cce5385)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index fad5555cea..aba7e6c22f 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -512,24 +512,14 @@ static BOOL set_printer_hnd_name(Printer_entry *Printer, char *handlename) /* Search all sharenames first as this is easier than pulling the printer_info_2 off of disk */ - - for (snum=0; !found && snum<n_services; snum++) { - - if ( !(lp_snum_ok(snum) && lp_print_ok(snum) ) ) - continue; - - /* ------ sharename ------ */ - - fstrcpy(sname, lp_servicename(snum)); - - DEBUGADD(10, ("share: %s\n",sname)); - - if ( strequal(sname, aprinter) ) { - found = True; - } + + snum = find_service(aprinter); + + if ( lp_snum_ok(snum) && lp_print_ok(snum) ) { + found = True; + fstrcpy( sname, aprinter ); } - /* do another loop to look for printernames */ for (snum=0; !found && snum<n_services; snum++) { |