From: Justin Stephenson Date: Tue, 20 Nov 2018 16:25:49 +0000 (-0500) Subject: s4:torture: Enforce Printer Class X-Git-Tag: ldb-1.6.1~292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=232273bfac3e65e69c4b9f4527f93cdfe4724f6b;p=thirdparty%2Fsamba.git s4:torture: Enforce Printer Class Ensure that the provided inf defines Class=Printer for driver installation to succeed. Some driver packages(HP Universal Print Driver) include inf files with other device types such as Class=USB. Attempting to install these will fail when tested against Windows Server 2016 Print server using iremotewinspool RPC calls. Signed-off-by: Justin Stephenson Reviewed-by: Andreas Schneider Reviewed-by: Bjoern Jacke Autobuild-User(master): Björn Jacke Autobuild-Date(master): Mon Jan 28 19:34:41 CET 2019 on sn-devel-144 --- diff --git a/source4/torture/rpc/iremotewinspool_driver.c b/source4/torture/rpc/iremotewinspool_driver.c index 0045818e7ff..8090076f1ca 100644 --- a/source4/torture/rpc/iremotewinspool_driver.c +++ b/source4/torture/rpc/iremotewinspool_driver.c @@ -564,6 +564,13 @@ static bool test_init_driver_info(struct torture_context *tctx, drv_info->core_driver_inf, &drv_info->info); torture_assert_goto(tctx, ok, ok, done, "Failed to parse inf driver"); + /* Ensure that we are trying to install the correct device class: + * https://docs.microsoft.com/en-us/windows-hardware/drivers/install/system-defined-device-setup-classes-available-to-vendors + */ + if (!(drv_info->info->printer_driver_attributes & PRINTER_DRIVER_CLASS)) { + ok = false; + torture_fail_goto(tctx, done, "Inf file Class value must be Printer"); + } done: return ok;