summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
Diffstat (limited to 'methods')
-rw-r--r--methods/aptmethod.h21
-rw-r--r--methods/gpgv.cc23
2 files changed, 32 insertions, 12 deletions
diff --git a/methods/aptmethod.h b/methods/aptmethod.h
index 5d792ceb7..67d5a3a0b 100644
--- a/methods/aptmethod.h
+++ b/methods/aptmethod.h
@@ -8,6 +8,7 @@
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/netrc.h>
+#include <apt-pkg/strutl.h>
#include <algorithm>
#include <locale>
@@ -137,8 +138,11 @@ protected:
ALLOW(chown);
ALLOW(chown32);
ALLOW(clock_getres);
+ ALLOW(clock_getres_time64);
ALLOW(clock_gettime);
+ ALLOW(clock_gettime64);
ALLOW(clock_nanosleep);
+ ALLOW(clock_nanosleep_time64);
ALLOW(close);
ALLOW(creat);
ALLOW(dup);
@@ -166,6 +170,7 @@ protected:
ALLOW(ftruncate);
ALLOW(ftruncate64);
ALLOW(futex);
+ ALLOW(futex_time64);
ALLOW(futimesat);
ALLOW(getegid);
ALLOW(getegid32);
@@ -220,9 +225,11 @@ protected:
ALLOW(pipe2);
ALLOW(poll);
ALLOW(ppoll);
+ ALLOW(ppoll_time64);
ALLOW(prctl);
ALLOW(prlimit64);
ALLOW(pselect6);
+ ALLOW(pselect6_time64);
ALLOW(read);
ALLOW(readv);
ALLOW(rename);
@@ -264,6 +271,7 @@ protected:
ALLOW(unlinkat);
ALLOW(utime);
ALLOW(utimensat);
+ ALLOW(utimensat_time64);
ALLOW(utimes);
ALLOW(write);
ALLOW(writev);
@@ -277,6 +285,7 @@ protected:
ALLOW(recv);
ALLOW(recvfrom);
ALLOW(recvmmsg);
+ ALLOW(recvmmsg_time64);
ALLOW(recvmsg);
ALLOW(send);
ALLOW(sendmmsg);
@@ -525,6 +534,7 @@ class aptAuthConfMethod : public aptMethod
if (uri.User.empty() == false || uri.Password.empty() == false)
return true;
+ _error->PushToStack();
for (auto &authconf : authconfs)
{
if (authconf->IsOpen() == false)
@@ -538,6 +548,17 @@ class aptAuthConfMethod : public aptMethod
result &= MaybeAddAuth(*authconf, uri);
}
+ if (not _error->empty())
+ {
+ std::string message;
+ while (not _error->empty())
+ {
+ _error->PopMessage(message);
+ Warning("%s", message.c_str());
+ }
+ }
+ _error->RevertToStack();
+
return result;
}
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index 04a4f6a83..1ca62557c 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -83,7 +83,8 @@ static constexpr Digest Digests[] = {
static Digest FindDigest(std::string const & Digest)
{
int id = atoi(Digest.c_str());
- if (id >= 0 && static_cast<unsigned>(id) < _count(Digests)) {
+ if (id >= 0 && static_cast<unsigned>(id) < APT_ARRAY_SIZE(Digests))
+ {
return Digests[id];
} else {
return Digests[0];
@@ -309,18 +310,16 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
auto const master = SubKeyMapping.find(l);
if (master == SubKeyMapping.end())
continue;
- for (auto const &sub : master->second)
- if (IsTheSameKey(sub, good))
- {
- if (std::find(Signers.Valid.cbegin(), Signers.Valid.cend(), sub) == Signers.Valid.cend())
- continue;
- found = true;
- Signers.SignedBy.push_back(l);
- Signers.SignedBy.push_back(sub + "!");
- break;
- }
- if (found)
+ auto const validsubkeysig = std::find_if(master->second.cbegin(), master->second.cend(), [&](auto const subkey) {
+ return IsTheSameKey(subkey, good) && std::find(Signers.Valid.cbegin(), Signers.Valid.cend(), subkey) != Signers.Valid.cend();
+ });
+ if (validsubkeysig != master->second.cend())
+ {
+ found = true;
+ Signers.SignedBy.push_back(l);
+ Signers.SignedBy.push_back(*validsubkeysig + "!");
break;
+ }
}
}
if (Debug)