summaryrefslogtreecommitdiff
path: root/source3/registry/reg_printing.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/registry/reg_printing.c')
-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;