summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/acquire.cc')
-rw-r--r--apt-pkg/acquire.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index ed0ddf7ac..bf1c3a4fe 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -87,6 +87,16 @@ void pkgAcquire::Initialize()
if(AuthConf.empty() == false && RealFileExists(AuthConf) &&
chown(AuthConf.c_str(), pw->pw_uid, gr->gr_gid) != 0)
_error->WarningE("SetupAPTPartialDirectory", "chown to %s:root of file %s failed", SandboxUser.c_str(), AuthConf.c_str());
+
+ std::string const AuthParts = _config->FindDir("Dir::Etc::netrcparts");
+ if (AuthParts.empty() == false && DirectoryExists(AuthParts))
+ {
+ for (auto const &AuthConf : GetListOfFilesInDir(AuthParts, "conf", true, true))
+ {
+ if (RealFileExists(AuthConf) && chown(AuthConf.c_str(), pw->pw_uid, gr->gr_gid) != 0)
+ _error->WarningE("SetupAPTPartialDirectory", "chown to %s:root of file %s failed", SandboxUser.c_str(), AuthConf.c_str());
+ }
+ }
}
}
}