You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
1.1 KiB

  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. /* ######################################################################
  4. netrc file parser - returns the login and password of a give host in
  5. a specified netrc-type file
  6. Originally written by Daniel Stenberg, <daniel@haxx.se>, et al. and
  7. placed into the Public Domain, do with it what you will.
  8. ##################################################################### */
  9. /*}}}*/
  10. #ifndef NETRC_H
  11. #define NETRC_H
  12. #include <memory>
  13. #include <string>
  14. #include <vector>
  15. #include <apt-pkg/macros.h>
  16. #include <apt-pkg/pkgcache.h>
  17. #ifndef APT_8_CLEANER_HEADERS
  18. #include <apt-pkg/strutl.h>
  19. #endif
  20. #ifndef APT_15_CLEANER_HEADERS
  21. #define DOT_CHAR "."
  22. #define DIR_CHAR "/"
  23. #endif
  24. class URI;
  25. class FileFd;
  26. APT_DEPRECATED_MSG("Use FileFd-based MaybeAddAuth instead")
  27. void maybe_add_auth(URI &Uri, std::string NetRCFile);
  28. bool MaybeAddAuth(FileFd &NetRCFile, URI &Uri);
  29. bool IsAuthorized(pkgCache::PkgFileIterator const I, std::vector<std::unique_ptr<FileFd>> &authconfs) APT_HIDDEN;
  30. #endif