From 1369379e33e89f034bc7e94b28d5cd240a2fdefe Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Tue, 30 May 2017 13:45:28 -0700 Subject: [PATCH] init: allow ':' in property names Bug: 62114389 Test: boot bullhead, get/set properties with ':' via command line Test: trigger an init trigger with a property containing a ':' Change-Id: Ib51853a1ef9d4f79d510c8175c0d9684e2025e23 --- init/property_service.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/property_service.cpp b/init/property_service.cpp index 18e47e3df..3490544c8 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -144,7 +144,7 @@ bool is_legal_property_name(const std::string& name) { if (name[0] == '.') return false; if (name[namelen - 1] == '.') return false; - /* Only allow alphanumeric, plus '.', '-', '@', or '_' */ + /* Only allow alphanumeric, plus '.', '-', '@', ':', or '_' */ /* Don't allow ".." to appear in a property name */ for (size_t i = 0; i < namelen; i++) { if (name[i] == '.') { @@ -152,7 +152,7 @@ bool is_legal_property_name(const std::string& name) { if (name[i-1] == '.') return false; continue; } - if (name[i] == '_' || name[i] == '-' || name[i] == '@') continue; + if (name[i] == '_' || name[i] == '-' || name[i] == '@' || name[i] == ':') continue; if (name[i] >= 'a' && name[i] <= 'z') continue; if (name[i] >= 'A' && name[i] <= 'Z') continue; if (name[i] >= '0' && name[i] <= '9') continue;