lib:printer_driver: Don't overwrite printprocessor
authorJustin Stephenson <jstephen@redhat.com>
Fri, 16 Nov 2018 21:53:33 +0000 (16:53 -0500)
committerBjoern Jacke <bjacke@samba.org>
Mon, 28 Jan 2019 14:44:18 +0000 (15:44 +0100)
If the printprocessor is parsed from the inf file in the codepath:

setup_driver_name
  find_driver_files
    process_driver_section_printprocessor

Don't overwrite the value later on in setup_driver_name with the default "winprint"

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
lib/printer_driver/printer_driver.c

index 3b076b766ff60466a8337185d89e7d499d6f5282..bd846035ccade8623ab66b4012d5ce3dca9af5e8 100644 (file)
@@ -1027,9 +1027,11 @@ static NTSTATUS setup_driver_by_name(TALLOC_CTX *mem_ctx,
                return NT_STATUS_NO_MEMORY;
        }
 
-       r->print_processor = talloc_strdup(mem_ctx, "winprint");
        if (r->print_processor == NULL) {
-               return NT_STATUS_NO_MEMORY;
+               r->print_processor = talloc_strdup(mem_ctx, "winprint");
+               if (r->print_processor == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+               }
        }
 
        status = gp_inifile_getstring(ctx, "Version:Signature", &s);