diff options
author | Michael Vogt <mvo@debian.org> | 2014-06-10 14:47:03 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-06-10 14:47:03 +0200 |
commit | ac00cca724734db58ad14ab8c77d445d0df3bc9f (patch) | |
tree | f476daeecf8cff875e074a819a9229b8a670435a /cmdline | |
parent | c0a5e4644c8cf77feb035cfe8961f40099e1e3c6 (diff) | |
parent | a3f1d60cb75ab83f63a52a43c056a4752c8fdeb2 (diff) |
Merge remote-tracking branch 'mvo/bugfix/apt-get-source-unauthenticated-warning' into debian/sid
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/apt-get.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0f18b0e7c..a58386eb0 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -76,6 +76,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sys/ioctl.h> #include <sys/stat.h> #include <sys/statfs.h> #include <sys/statvfs.h> @@ -755,6 +756,7 @@ static bool DoSource(CommandLine &CmdL) // Load the requestd sources into the fetcher unsigned J = 0; + std::string UntrustedList; for (const char **I = CmdL.FileList + 1; *I != 0; I++, J++) { string Src; @@ -763,6 +765,9 @@ static bool DoSource(CommandLine &CmdL) if (Last == 0) { return _error->Error(_("Unable to find a source package for %s"),Src.c_str()); } + + if (Last->Index().IsTrusted() == false) + UntrustedList += Src + " "; string srec = Last->AsStr(); string::size_type pos = srec.find("\nVcs-"); @@ -846,6 +851,10 @@ static bool DoSource(CommandLine &CmdL) Last->Index().SourceInfo(*Last,*I),Src); } } + + // check authentication status of the source as well + if (UntrustedList != "" && !AuthPrompt(UntrustedList, false)) + return false; // Display statistics unsigned long long FetchBytes = Fetcher.FetchNeeded(); |