Check more validation of native PKG/APP id 65/125065/1
authorjongmyeongko <jongmyeong.ko@samsung.com>
Tue, 11 Apr 2017 06:44:49 +0000 (15:44 +0900)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Thu, 13 Apr 2017 13:20:15 +0000 (06:20 -0700)
"/", ".." and "~" from previous tizen
":", ";" and "*" are new one

Change-Id: Id56a2a91267d6aff636727da106b94a762489351
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
(cherry picked from commit ff77c318a18d5645008cc843fed55b8e8b3c7182)

src/manifest_parser/manifest_util.cc

index 010e0132a6fed4fab1f82aad5092c174a6cf1b6c..84260fc1066a099fbe65d62a2579f5511af691a2 100644 (file)
@@ -356,7 +356,9 @@ bool ValidateTizenPackageId(const std::string& id) {
 }
 
 bool ValidateTizenNativeId(const std::string& id) {
-  return id.find_first_of('/') == std::string::npos;
+  return (id.length() >= 3 && id.length() < 128 &&
+          id.find_first_of("/:~;*") == std::string::npos &&
+          id.find("..") == std::string::npos);
 }
 
 }  // namespace parser