summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/netrc.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-07-07 16:24:21 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2017-07-26 19:09:04 +0200
commitea408c560ed85bb4ef7cf8f72f8463653501332c (patch)
tree30dcfc690db0353e786cc9873b6e11803a157611 /apt-pkg/contrib/netrc.h
parent51751106976b1c6afa8f7991790db87b239fcc84 (diff)
reimplement and document auth.conf
We have support for an netrc-like auth.conf file since 0.7.25 (closing 518473), but it was never documented in apt that it even exists and netrc seems to have fallen out of usage as a manpage for it no longer exists making the feature even more arcane. On top of that the code was a bit of a mess (as it is written in c-style) and as a result the matching of machine tokens to URIs also a bit strange by checking for less specific matches (= without path) first. We now do a single pass over the stanzas. In practice early adopters of the undocumented implementation will not really notice the differences and the 'new' behaviour is simpler to document and more usual for an apt user. Closes: #811181
Diffstat (limited to 'apt-pkg/contrib/netrc.h')
-rw-r--r--apt-pkg/contrib/netrc.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/apt-pkg/contrib/netrc.h b/apt-pkg/contrib/netrc.h
index b5b56f5d4..46d8cab3d 100644
--- a/apt-pkg/contrib/netrc.h
+++ b/apt-pkg/contrib/netrc.h
@@ -22,10 +22,15 @@
#include <apt-pkg/strutl.h>
#endif
+#ifndef APT_15_CLEANER_HEADERS
#define DOT_CHAR "."
#define DIR_CHAR "/"
+#endif
class URI;
+class FileFd;
-void maybe_add_auth (URI &Uri, std::string NetRCFile);
+APT_DEPRECATED_MSG("Use FileFd-based MaybeAddAuth instead")
+void maybe_add_auth(URI &Uri, std::string NetRCFile);
+bool MaybeAddAuth(FileFd &NetRCFile, URI &Uri);
#endif