s4-torture: also test NULL servername in spoolss_GetPrinterDriverPackagePath
authorGünther Deschner <gd@samba.org>
Thu, 8 Sep 2016 19:09:42 +0000 (21:09 +0200)
committerJeremy Allison <jra@samba.org>
Sun, 11 Sep 2016 17:57:26 +0000 (19:57 +0200)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/rpc/spoolss.c

index 23f2b2ecbd0da14b91540a35768cc6db39595159..1fcf3795fefe284394e084e8ca89e1a92d3a8126 100644 (file)
@@ -8063,6 +8063,25 @@ static bool test_get_printer_driver_package_path(struct torture_context *tctx,
                torture_assert_hresult_ok(tctx, r.out.result,
                        "spoolss_GetPrinterDriverPackagePath failed");
 
+               r.in.servername = NULL;
+
+               torture_assert_ntstatus_ok(tctx,
+                       dcerpc_spoolss_GetPrinterDriverPackagePath_r(b, tctx, &r),
+                       "spoolss_GetPrinterDriverPackagePath failed");
+               torture_assert_werr_equal(tctx,
+                       W_ERROR(WIN32_FROM_HRESULT(r.out.result)), WERR_INSUFFICIENT_BUFFER,
+                       "spoolss_GetPrinterDriverPackagePath failed");
+
+               r.in.driver_package_cab_size = required;
+               r.in.driver_package_cab = talloc_zero_array(tctx, char, required);
+               r.out.driver_package_cab = talloc_zero_array(tctx, char, required);
+
+               torture_assert_ntstatus_ok(tctx,
+                       dcerpc_spoolss_GetPrinterDriverPackagePath_r(b, tctx, &r),
+                       "spoolss_GetPrinterDriverPackagePath failed");
+               torture_assert_hresult_ok(tctx, r.out.result,
+                       "spoolss_GetPrinterDriverPackagePath failed");
+
        }
 
        return true;