debugd: Fix segment count for the PPDCache folder.
The file name is included in the segment count so it should
be increased to six.
BUG=chromium:670037
TEST=Add a printer with the dbus client using a PPDCache path.
Change-Id: Ia9ad576667cdb36eca3aa3dd907d21db28b28b7c
Reviewed-on: https://chromium-review.googlesource.com/415430
Commit-Ready: Sean Kau <skau@chromium.org>
Tested-by: Sean Kau <skau@chromium.org>
Reviewed-by: Justin Carlson <justincarlson@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/debugd/src/cups_tool.cc b/debugd/src/cups_tool.cc
index fcae7f1..329ccbc 100644
--- a/debugd/src/cups_tool.cc
+++ b/debugd/src/cups_tool.cc
@@ -62,7 +62,8 @@
}
bool IsInPPDCache(const std::vector<std::string>& path_components) {
- return path_components.size() == 5 && path_components[0] == "/" &&
+ // {/, home, chronos, u-HEX, PPDCache, <FileName>}
+ return path_components.size() == 6 && path_components[0] == "/" &&
path_components[1] == "home" && path_components[2] == "chronos" &&
MatchesUserString(path_components[3]) &&
path_components[4] == kPPDCacheFolder;