X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/7c420169baa7c50428589cca7f8eda71b462eb15..7e09ef09a479731d01b1ca46e94ddadd73ac98e3:/lisp/net/netrc.el diff --git a/lisp/net/netrc.el b/lisp/net/netrc.el index 989470beca..61da85c7c1 100644 --- a/lisp/net/netrc.el +++ b/lisp/net/netrc.el @@ -1,6 +1,5 @@ ;;; netrc.el --- .netrc parsing functionality -;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1996-2015 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; Keywords: news @@ -40,6 +39,7 @@ (defcustom netrc-file "~/.authinfo" "File where user credentials are stored." + :version "24.1" :type 'file :group 'netrc) @@ -64,10 +64,10 @@ alist elem result pair) (if (and netrc-cache (equal (car netrc-cache) (nth 5 (file-attributes file)))) - ;; Store the contents of the file heavily encrypted in memory. (insert (base64-decode-string (rot13-string (cdr netrc-cache)))) (insert-file-contents file) (when (string-match "\\.gpg\\'" file) + ;; Store the contents of the file heavily encrypted in memory. (setq netrc-cache (cons (nth 5 (file-attributes file)) (rot13-string (base64-encode-string @@ -215,30 +215,10 @@ MODE can be \"login\" or \"password\", suitable for passing to (eq type (car (cddr service))))))) (car service))) -(defun netrc-find-service-number (name &optional type) - (let ((services (netrc-parse-services)) - service) - (setq type (or type 'tcp)) - (while (and (setq service (pop services)) - (not (and (string= name (car service)) - (eq type (car (cddr service))))))) - (cadr service))) - -(defun netrc-store-data (file host port user password) - (with-temp-buffer - (when (file-exists-p file) - (insert-file-contents file)) - (goto-char (point-max)) - (unless (bolp) - (insert "\n")) - (insert (format "machine %s login %s password %s port %s\n" - host user password port)) - (write-region (point-min) (point-max) file nil 'silent))) - ;;;###autoload (defun netrc-credentials (machine &rest ports) "Return a user name/password pair. -Port specifications will be prioritised in the order they are +Port specifications will be prioritized in the order they are listed in the PORTS list." (let ((list (netrc-parse)) found)