aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Fernando J. Pereda <ferdy@ferdyx.org> 2006-11-05 18:16:41 +0000
committerAvatar Fernando J. Pereda <ferdy@ferdyx.org> 2006-11-05 18:16:41 +0000
commit80454b910a4644e216eee7b5ac08bd032836c5f7 (patch)
tree17394068a14bb1d53a25aff7b17f17563e4d9f9b
parent7ed2e4a5bf0d8449249871789eb5ee475e0d4e61 (diff)
downloadpaludis-80454b910a4644e216eee7b5ac08bd032836c5f7.tar.gz
paludis-80454b910a4644e216eee7b5ac08bd032836c5f7.tar.xz
Simplify detection of bad, unsigned and unknown Manifest signatures.
-rw-r--r--paludis/qa/gpg_check.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/paludis/qa/gpg_check.cc b/paludis/qa/gpg_check.cc
index c4318fb..5b7c07d 100644
--- a/paludis/qa/gpg_check.cc
+++ b/paludis/qa/gpg_check.cc
@@ -25,7 +25,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <pcre++.h>
using namespace paludis;
using namespace paludis::qa;
@@ -38,31 +37,29 @@ CheckResult
GPGCheck::operator() (const FSEntry & d) const
{
CheckResult result(d, identifier());
+ FSEntry manifest(d / "Manifest");
- if (! (d / "Manifest").is_regular_file())
+ if (! manifest.is_regular_file())
{
result << Message(qal_major, "No Manifest");
return result;
}
- static pcrepp::Pcre::Pcre r_is_signed("^-----BEGIN PGP SIGNED MESSAGE-----");
bool is_signed(false);
{
- std::ifstream ff(stringify(d / "Manifest").c_str());
+ std::ifstream ff(stringify(manifest).c_str());
if (! ff)
- result << Message(qal_major, "Can't read file");
+ result << Message(qal_major, "Can't read Manifest file");
else
{
std::string s;
- while ((! is_signed) && std::getline(ff, s))
- if (r_is_signed.search(s))
- is_signed = true;
+ if (std::getline(ff, s))
+ is_signed = (0 == s.compare("-----BEGIN PGP SIGNED MESSAGE-----"));
}
}
if (is_signed)
{
- FSEntry manifest(d / "Manifest");
FDHolder dev_null(::open("/dev/null", O_WRONLY));
set_run_command_stdout_fds(dev_null, -1);