diff options
| author | Julian Andres Klode <jak@debian.org> | 2020-12-18 21:00:29 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2020-12-18 21:00:29 +0000 |
| commit | 06ec0067057e0578f3bc515f6a97d6a9d70824f6 (patch) | |
| tree | e0cb170d0a4f8caff89c2402bf24e6951b716360 /methods/ftp.cc | |
| parent | ece7f5bb0afee0994a4fb4380e756ce725fe67a9 (diff) | |
| parent | a5859bafdaa6bcf12934d0fb1715a5940965e13a (diff) | |
Merge branch 'pu/uriencode' into 'master'
Use encoded URIs in the acquire system
See merge request apt-team/apt!139
Diffstat (limited to 'methods/ftp.cc')
| -rw-r--r-- | methods/ftp.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc index 98398341e..16236232a 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -988,7 +988,7 @@ bool FTPConn::Get(const char *Path,FileFd &To,unsigned long long Resume, // FtpMethod::FtpMethod - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -FtpMethod::FtpMethod() : aptAuthConfMethod("ftp", "1.0", SendConfig) +FtpMethod::FtpMethod() : aptAuthConfMethod("ftp", "1.0", SendConfig | SendURIEncoded) { SeccompFlags = aptMethod::BASE | aptMethod::NETWORK; signal(SIGTERM,SigTerm); @@ -1038,7 +1038,7 @@ bool FtpMethod::Configuration(string Message) bool FtpMethod::Fetch(FetchItem *Itm) { URI Get(Itm->Uri); - const char *File = Get.Path.c_str(); + auto const File = DecodeSendURI(Get.Path); FetchResult Res; Res.Filename = Itm->DestFile; Res.IMSHit = false; @@ -1070,8 +1070,8 @@ bool FtpMethod::Fetch(FetchItem *Itm) // Get the files information Status(_("Query")); unsigned long long Size; - if (Server->Size(File,Size) == false || - Server->ModTime(File,FailTime) == false) + if (not Server->Size(File.c_str(), Size) || + not Server->ModTime(File.c_str(), FailTime)) { Fail(true); return true; @@ -1119,7 +1119,7 @@ bool FtpMethod::Fetch(FetchItem *Itm) FailFd = Fd.Fd(); bool Missing; - if (Server->Get(File,Fd,Res.ResumePoint,Hash,Missing,Itm->MaximumSize,this) == false) + if (not Server->Get(File.c_str(), Fd, Res.ResumePoint, Hash, Missing, Itm->MaximumSize, this)) { Fd.Close(); |
