The function is called 2 out of 3 times in places
where the package was already added (appInstall, appUpdate),
so no check is needed.
Added the check manually before function call in registering paths API,
where in fact we need to return invalid param for backward compatibility.
Change-Id: I7fb8b967409972ef1f0734f40320682b6bf6cc1b
bool isSharedRO)
{
try {
- if (!m_privilegeDb.PkgNameExists(pkgName)) {
- LogError("No such package: " << pkgName);
- return SECURITY_MANAGER_ERROR_INPUT_PARAM;
- }
-
std::string authorHash;
m_privilegeDb.GetPkgAuthorHash(pkgName, authorHash);
if (req.pkgPaths.empty())
return SECURITY_MANAGER_SUCCESS;
+ if (!m_privilegeDb.PkgNameExists(req.pkgName)) {
+ LogError("No such package: " << req.pkgName);
+ return SECURITY_MANAGER_ERROR_INPUT_PARAM;
+ }
+
try {
setRequestDefaultValues(req.uid, req.installationType);