diff options
author | Gerald Carter <jerry@samba.org> | 2005-11-22 15:52:22 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:31 -0500 |
commit | 46bf28c81c27dfdc412318a83bf565211a58a47d (patch) | |
tree | 48e4a6d2331ded2301fdf6c9e8998332b5fcaa64 /source/registry/reg_printing.c | |
parent | 4c4b2096459ffa6ca0130f1259499933e3182d47 (diff) | |
download | samba-46bf28c81c27dfdc412318a83bf565211a58a47d.tar.gz samba-46bf28c81c27dfdc412318a83bf565211a58a47d.tar.xz samba-46bf28c81c27dfdc412318a83bf565211a58a47d.zip |
r11860: BUG 3156: don't use find_service() when explicitly looking for a printer as the username map might get in the way
Diffstat (limited to 'source/registry/reg_printing.c')
-rw-r--r-- | source/registry/reg_printing.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/registry/reg_printing.c b/source/registry/reg_printing.c index b07c8e9644f..592069052f8 100644 --- a/source/registry/reg_printing.c +++ b/source/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; |