summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-09-29 09:58:38 +0200
committerMichael Vogt <mvo@debian.org>2014-09-29 09:58:38 +0200
commit4c333a25a88b1afac2ed50bf1b9af61dc5b09343 (patch)
treed4b90a7bc46e9da364efb74365a0af604b38e424 /methods
parentbca84917c326fa3158e120147c8aecebe0789b47 (diff)
parent6eb377fb9fba6b7f17f635143e9201f0d62a50fb (diff)
Merge remote-tracking branch 'upstream/debian/experimental' into feature/acq-trans
Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h methods/gpgv.cc
Diffstat (limited to 'methods')
-rw-r--r--methods/copy.cc12
-rw-r--r--methods/ftp.cc5
-rw-r--r--methods/gpgv.cc10
-rw-r--r--methods/https.h5
-rw-r--r--methods/server.cc6
5 files changed, 17 insertions, 21 deletions
diff --git a/methods/copy.cc b/methods/copy.cc
index faf330ace..a23c0316c 100644
--- a/methods/copy.cc
+++ b/methods/copy.cc
@@ -37,15 +37,12 @@ class CopyMethod : public pkgAcqMethod
void CopyMethod::CalculateHashes(FetchResult &Res)
{
- // For gzip indexes we need to look inside the gzip for the hash
- // We can not use the extension here as its not used in partial
- // on a IMS hit
- FileFd::OpenMode OpenMode = FileFd::ReadOnly;
+ Hashes Hash;
+ FileFd::CompressMode CompressMode = FileFd::None;
if (_config->FindB("Acquire::GzipIndexes", false) == true)
- OpenMode = FileFd::ReadOnlyGzip;
+ CompressMode = FileFd::Extension;
- Hashes Hash;
- FileFd Fd(Res.Filename, OpenMode);
+ FileFd Fd(Res.Filename, FileFd::ReadOnly, CompressMode);
Hash.AddFD(Fd);
Res.TakeHashes(Hash);
}
@@ -128,6 +125,5 @@ int main()
CopyMethod Mth;
- Mth.DropPrivsOrDie();
return Mth.Run();
}
diff --git a/methods/ftp.cc b/methods/ftp.cc
index a658b5657..ac76295f0 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -75,9 +75,10 @@ time_t FtpMethod::FailTime = 0;
// FTPConn::FTPConn - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1),
+FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1),
DataListenFd(-1), ServerName(Srv),
- ForceExtended(false), TryPassive(true)
+ ForceExtended(false), TryPassive(true),
+ PeerAddrLen(0), ServerAddrLen(0)
{
Debug = _config->FindB("Debug::Acquire::Ftp",false);
PasvAddr = 0;
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index 72e4c7987..7e8500c51 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -75,7 +75,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
FILE *pipein = fdopen(fd[0], "r");
- // Loop over the output of gpgv, and check the signatures.
+ // Loop over the output of apt-key (which really is gnupg), and check the signatures.
size_t buffersize = 64;
char *buffer = (char *) malloc(buffersize);
size_t bufferoff = 0;
@@ -172,7 +172,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
else if (WEXITSTATUS(status) == 1)
return _("At least one invalid signature was encountered.");
else if (WEXITSTATUS(status) == 111)
- return _("Could not execute 'gpgv' to verify signature (is gpgv installed?)");
+ return _("Could not execute 'apt-key' to verify signature (is gnupg installed?)");
else if (WEXITSTATUS(status) == 112)
{
// acquire system checks for "NODATA" to generate GPG errors (the others are only warnings)
@@ -182,7 +182,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
return errmsg;
}
else
- return _("Unknown error executing gpgv");
+ return _("Unknown error executing apt-key");
}
bool GPGVMethod::Fetch(FetchItem *Itm)
@@ -200,7 +200,7 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
Res.Filename = Itm->DestFile;
URIStart(Res);
- // Run gpgv on file, extract contents and get the key ID of the signer
+ // Run apt-key on file, extract contents and get the key ID of the signer
string msg = VerifyGetSigners(Path.c_str(), Itm->DestFile.c_str(),
GoodSigners, BadSigners, WorthlessSigners,
NoPubKeySigners);
@@ -252,7 +252,7 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
if (_config->FindB("Debug::Acquire::gpgv", false))
{
- std::clog << "gpgv succeeded\n";
+ std::clog << "apt-key succeeded\n";
}
return true;
diff --git a/methods/https.h b/methods/https.h
index faac8a3cd..45d1f7f63 100644
--- a/methods/https.h
+++ b/methods/https.h
@@ -69,10 +69,9 @@ class HttpsMethod : public pkgAcqMethod
public:
FileFd *File;
-
- HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig), File(NULL)
+
+ HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig), Server(NULL), File(NULL)
{
- File = 0;
curl = curl_easy_init();
};
diff --git a/methods/server.cc b/methods/server.cc
index ff67eb09b..4a961f454 100644
--- a/methods/server.cc
+++ b/methods/server.cc
@@ -324,10 +324,10 @@ ServerMethod::DealWithHeaders(FetchResult &Res)
failure */
if (Server->Result < 200 || Server->Result >= 300)
{
- char err[255];
- snprintf(err,sizeof(err)-1,"HttpError%i",Server->Result);
+ std::string err;
+ strprintf(err, "HttpError%u", Server->Result);
SetFailReason(err);
- _error->Error("%u %s",Server->Result,Server->Code);
+ _error->Error("%u %s", Server->Result, Server->Code);
if (Server->HaveContent == true)
return ERROR_WITH_CONTENT_PAGE;
return ERROR_UNRECOVERABLE;