summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/netrc.cc
Commit message (Collapse)AuthorAgeFilesLines
* Address statements of public domainJulian Andres Klode2023-03-061-0/+4
|
* Revert "Add a Packages-Require-Authorization Release file field"Julian Andres Klode2020-02-161-43/+0
| | | | | | | | This experiment did not turn out sensibly, as some servers do not accept credentials when none are expected and fail, so you cannot mirror such a repository. This reverts commit c2b9b0489538fed4770515bd8853a960b13a2618.
* netrc: Add warning when ignoring entries for unencrypted protocolsJulian Andres Klode2020-01-151-9/+15
| | | | | | | | Commit 93f33052de84e9aeaf19c92291d043dad2665bbd restricted auth.conf entries to only apply to https by default, but this was silent - there was no information why http sources with auth.conf entries suddenly started failing. Add such information, and extend test case to cover it.
* netrc: Restrict auth.conf entries to https by defaultJulian Andres Klode2019-12-021-1/+21
| | | | | | | | | | | | This avoids downgrade attacks where an attacker could inject Location: http://private.example/ and then (having access to raw data to private.example, for example, by opening a port there, or sniffing network traffic) read the credentials for the private repository. Closes: #945911
* netrc: Remove deprecated function maybe_add_auth()Julian Andres Klode2019-02-261-9/+0
|
* Add a Packages-Require-Authorization Release file fieldJulian Andres Klode2019-02-011-0/+44
| | | | | | | | | | | | | | | | | This new field allows a repository to declare that access to packages requires authorization. The current implementation will set the pin to -32768 if no authorization has been provided in the auth.conf(.d) files. This implementation is suboptimal in two aspects: (1) A repository should behave more like NotSource repositories (2) We only have the host name for the repository, we cannot use paths yet. - We can fix those after an ABI break. The code also adds a check to acquire-item.cc to not use the specified repository as a download source, mimicking NotSource.
* Remove obsolete RCS keywordsGuillem Jover2018-05-071-1/+0
| | | | Prompted-by: Jakub Wilk <jwilk@debian.org>
* explicitly name token in auth.conf parsing errorDavid Kalnischkies2017-12-131-2/+12
| | | | Reported-By: gcc -Wsign-promo
* reimplement and document auth.confDavid Kalnischkies2017-07-261-186/+110
| | | | | | | | | | | | | | | | | | 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
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-121-2/+2
| | | | | | | | | | | | | This makes it easier to see which headers includes what. The changes were done by running git grep -l '#\s*include' \ | grep -E '.(cc|h)$' \ | xargs sed -i -E 's/(^\s*)#(\s*)include/\1#\2 include/' To modify all include lines by adding a space, and then running ./git-clang-format.sh.
* review of new/changed translatable program stringsJustin B Rye2015-11-211-1/+1
| | | | | Reference mail: https://lists.debian.org/debian-l10n-english/2015/11/msg00006.html
* Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-05-071-3/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/cachefilter.h apt-pkg/contrib/fileutl.cc apt-pkg/contrib/netrc.h apt-pkg/deb/debsrcrecords.cc apt-pkg/init.h apt-pkg/pkgcache.cc debian/apt.install.in debian/changelog
| * cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-2/+1
| | | | | | | | | | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
| * warning: useless cast to type A [-Wuseless-cast]David Kalnischkies2014-03-131-1/+1
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wuseless-cast
* | merged debian-sid branch and resolved conflictsMichael Vogt2013-04-231-5/+3
|\|
| * various simple changes to fix cppcheck warningsDavid Kalnischkies2013-03-101-5/+3
| |
* | stop exporting the accidently exported parsenetrc() symbolMichael Vogt2012-10-171-12/+0
|/
* merge from lp:~donkult/apt/sidMichael Vogt2012-10-151-30/+33
|\
| * remove 256 char line limit by using getline() (POSIX.1-2008)David Kalnischkies2012-10-131-3/+5
| |
| * * apt-pkg/contrib/netrc.cc:David Kalnischkies2012-10-131-16/+27
| | | | | | - remove the 64 char limit for login/password in internal usage
* | merged lp:~mvo/apt/mvoMichael Vogt2012-10-121-5/+16
|\ \ | |/ |/|
| * apt-pkg/contrib/netrc.cc: use a slightly smaller login/password sizeMichael Vogt2012-08-281-2/+2
| |
| * make netrc parser more robust and parser biger login tokens, thanks to "TJ" ↵Michael Vogt2012-08-131-5/+16
| | | | | | | | (LP: #1008289)
* | * apt-pkg/acquire-worker.cc:David Kalnischkies2012-03-201-2/+1
|/ | | | | | | | | | | - check return of write() as gcc recommends * apt-pkg/acquire.cc: - check return of write() as gcc recommends * apt-pkg/cdrom.cc: - check return of chdir() and link() as gcc recommends * apt-pkg/clean.cc: - check return of chdir() as gcc recommends * apt-pkg/contrib/netrc.cc: - check return of asprintf() as gcc recommends
* use forward declaration in headers if possible instead of includesDavid Kalnischkies2011-09-191-0/+2
|
* do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-0/+1
|
* merge with debian/experimentalDavid Kalnischkies2011-09-131-3/+4
|\
| * fix a few more cppcheck performance and scope warningsDavid Kalnischkies2011-08-111-3/+4
| |
* | reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies2011-09-131-0/+1
|/
* * apt-pkg/contrib/netrc.cc:David Kalnischkies2011-05-131-4/+8
| | | - replace non-posix gnu-extension strdupa with strdup
* if "/" is found in the machine, do a uri.startswith(host) substring match to ↵Michael Vogt2009-12-071-4/+8
| | | | support multiple user/passwds on the same host
* * apt-pkg/contrib/netrc.cc:Michael Vogt2009-12-041-7/+27
| | | | | | | - check for hostname and then host+path - better debug output * methods/https.cc: - fix bug in netrc integration
* add ftp support, basic debuggingMichael Vogt2009-10-161-1/+4
|
* port netrc support from maemonMichael Vogt2009-10-161-0/+184