summaryrefslogtreecommitdiffstats
path: root/src/Daemon/MiddleWare.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Daemon/MiddleWare.cpp')
-rw-r--r--src/Daemon/MiddleWare.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp
index 5235c17..b597a41 100644
--- a/src/Daemon/MiddleWare.cpp
+++ b/src/Daemon/MiddleWare.cpp
@@ -575,29 +575,35 @@ static mw_result_t SavePackageDescriptionToDebugDump(const char *pExecutable,
}
else
{
- package = GetPackage(pExecutable);
+ char *rpm_pkg = GetPackage(pExecutable);
+ if (rpm_pkg == NULL)
+ {
+ log("Executable '%s' doesn't belong to any package", pExecutable);
+ return MW_PACKAGE_ERROR;
+ }
+
+ package = rpm_pkg;
packageName = package.substr(0, package.rfind("-", package.rfind("-") - 1));
- if (packageName == "" ||
- (g_setBlackList.find(packageName) != g_setBlackList.end()))
+ VERB2 log("Package:'%s' short:'%s'", rpm_pkg, packageName.c_str());
+ free(rpm_pkg);
+
+ if (g_setBlackList.find(packageName) != g_setBlackList.end())
{
- if (packageName == "")
- {
- error_msg("Executable doesn't belong to any package");
- return MW_PACKAGE_ERROR;
- }
- log("Blacklisted package");
+ log("Blacklisted package '%s'", packageName.c_str());
return MW_BLACKLISTED;
}
if (g_settings_bOpenGPGCheck)
{
if (!s_RPM.CheckFingerprint(packageName.c_str()))
{
- error_msg("package isn't signed with proper key");
+ log("Package '%s' isn't signed with proper key", packageName.c_str());
return MW_GPG_ERROR;
}
if (!CheckHash(packageName.c_str(), pExecutable))
{
- error_msg("executable has bad hash");
+ error_msg("Executable '%s' seems to be modified, "
+ "doesn't match one from package '%s'",
+ pExecutable, packageName.c_str());
return MW_GPG_ERROR;
}
}