debugd: cups_tool: Invoke cupstestppd with -W constraints
This flag allows PPD files with invalid *UIConstraint statements to be
used for printing. As we do not use CUPS to generate a UI from the PPD
file, it should be safe to ignore this class of errors.
BUG=b:172548918
TEST=tast run localhost:9222 printer.*
Change-Id: I9504ae4b9d236a56173bbc49a64c142b6cdd5595
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2553009
Tested-by: Pranav Batra <batrapranav@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/debugd/src/cups_tool.cc b/debugd/src/cups_tool.cc
index 1c92ce1..201db55 100644
--- a/debugd/src/cups_tool.cc
+++ b/debugd/src/cups_tool.cc
@@ -155,9 +155,9 @@
}
ppd_content.assign(out.begin(), out.end());
}
- int ret = RunAsUser(kLpadminUser, kLpadminGroup, kTestPPDCommand,
- kTestPPDSeccompPolicy, {"-W", "translations", "-"},
- &ppd_content, false);
+ int ret = RunAsUser(
+ kLpadminUser, kLpadminGroup, kTestPPDCommand, kTestPPDSeccompPolicy,
+ {"-W", "translations", "-W", "constraints", "-"}, &ppd_content);
// Check if the foomatic-rip cups filter is present in the PPD file.
constexpr uint8_t kFoomaticRip[] = "foomatic-rip\"";
// Subtract 1 to exclude the null terminator.