summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-11-22 15:52:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:31 -0500
commitf2ecd4fed0ed11b73fa330588501a0ac37583174 (patch)
tree7e955817adb3f5910b12e3e2d15985e26c66ac9b /source3/registry
parent4826f9d41322649111be7495ede60a8939ad2995 (diff)
downloadsamba-f2ecd4fed0ed11b73fa330588501a0ac37583174.tar.gz
samba-f2ecd4fed0ed11b73fa330588501a0ac37583174.tar.bz2
samba-f2ecd4fed0ed11b73fa330588501a0ac37583174.zip
r11860: BUG 3156: don't use find_service() when explicitly looking for a printer as the username map might get in the way
(This used to be commit 46bf28c81c27dfdc412318a83bf565211a58a47d)
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_printing.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/registry/reg_printing.c b/source3/registry/reg_printing.c
index b07c8e9644..592069052f 100644
--- a/source3/registry/reg_printing.c
+++ b/source3/registry/reg_printing.c
@@ -227,7 +227,16 @@ static int key_printers_fetch_keys( const char *key, REGSUBKEY_CTR *subkeys )
reg_split_path( printers_key, &printername, &printerdatakey );
- if ( find_service(printername) == -1
+ /* validate the printer name */
+
+ for (snum=0; snum<n_services; snum++) {
+ if ( !lp_snum_ok(snum) || !lp_print_ok(snum) )
+ continue;
+ if (strequal( lp_servicename(snum), printername ) )
+ break;
+ }
+
+ if ( snum>=n_services
|| !W_ERROR_IS_OK( get_a_printer(NULL, &printer, 2, printername) ) )
{
return -1;