apt-get: Create the temporary downloaded changelog inside tmpdir
authorGuillem Jover <guillem@debian.org>
Thu, 2 Oct 2014 15:48:13 +0000 (17:48 +0200)
committerMichael Vogt <mvo@ubuntu.com>
Thu, 2 Oct 2014 20:05:25 +0000 (22:05 +0200)
The code is creating a secure temporary directory, but then creates
the changelog alongside the tmpdir in the same base directory. This
defeats the secure tmpdir creation, making the filename predictable.

Inject a '/' between the tmpdir and the changelog filename.

cmdline/apt-get.cc

index 2e283da..cfa7933 100644 (file)
@@ -1563,7 +1563,7 @@ static bool DoChangelog(CommandLine &CmdL)
    {
       string changelogfile;
       if (downOnly == false)
-        changelogfile.append(tmpname).append("changelog");
+        changelogfile.append(tmpname).append("/changelog");
       else
         changelogfile.append(Ver.ParentPkg().Name()).append(".changelog");
       if (DownloadChangelog(Cache, Fetcher, Ver, changelogfile) && downOnly == false)