summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire.cc10
-rw-r--r--apt-pkg/init.cc1
2 files changed, 11 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());
+ }
+ }
}
}
}
diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
index f5ca43465..645df044e 100644
--- a/apt-pkg/init.cc
+++ b/apt-pkg/init.cc
@@ -63,6 +63,7 @@ bool pkgInitConfig(Configuration &Cnf)
Cnf.CndSet("Dir::Etc::sourceparts","sources.list.d");
Cnf.CndSet("Dir::Etc::main","apt.conf");
Cnf.CndSet("Dir::Etc::netrc", "auth.conf");
+ Cnf.CndSet("Dir::Etc::netrcparts", "auth.conf.d");
Cnf.CndSet("Dir::Etc::parts","apt.conf.d");
Cnf.CndSet("Dir::Etc::preferences","preferences");
Cnf.CndSet("Dir::Etc::preferencesparts","preferences.d");