From f3d0a467c4c1f9df19c3c4819b4c6cb4b26fe2a3 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 11 Sep 2020 23:42:37 +0200 Subject: [PATCH] property-matching RROs: allow to prefix the value with + to do glob match instead of exact match Change-Id: I1f5b7c907523eb6e48d41f5163984564d3db9506 --- cmds/idmap2/idmap2/Scan.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmds/idmap2/idmap2/Scan.cpp b/cmds/idmap2/idmap2/Scan.cpp index 36250450cc7..6a5162dd0d9 100644 --- a/cmds/idmap2/idmap2/Scan.cpp +++ b/cmds/idmap2/idmap2/Scan.cpp @@ -15,6 +15,7 @@ */ #include +#include #include #include @@ -187,7 +188,10 @@ Result Scan(const std::vector& args) { // if property set & equal to value, then include overlay - otherwise skip if (android::base::GetProperty(overlay_info->requiredSystemPropertyName, "") != overlay_info->requiredSystemPropertyValue) { - continue; + auto osValue = android::base::GetProperty(overlay_info->requiredSystemPropertyName, ""); + if(fnmatch(overlay_info->requiredSystemPropertyValue.c_str()+1, osValue.c_str(), 0) != 0) { + continue; + } } } -- 2.25.1