;;; url-auth.el --- Uniform Resource Locator authorization modules
-;; Author: $Author: wmperry $
-;; Created: $Date: 2001/12/05 19:05:51 $
-;; Version: $Revision: 1.4 $
+
+;; Copyright (C) 1996, 1997, 1998, 1999, 2004,
+;; 2005, 2006, 2007 Free Software Foundation, Inc.
+
;; Keywords: comm, data, processes, hypermedia
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Copyright (c) 1993 - 1996 by William M. Perry <wmperry@cs.indiana.edu>
-;;; Copyright (c) 1996 - 1999 Free Software Foundation, Inc.
-;;;
-;;; This file is part of GNU Emacs.
-;;;
-;;; GNU Emacs is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 2, or (at your option)
-;;; any later version.
-;;;
-;;; GNU Emacs is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Emacs; see the file COPYING. If not, write to the
-;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;;; Boston, MA 02111-1307, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Code:
(require 'url-vars)
(require 'url-parse)
((and prompt (not byserv))
(setq user (read-string (url-auth-user-prompt url realm)
(user-real-login-name))
- pass (funcall url-passwd-entry-func "Password: "))
+ pass (read-passwd "Password: "))
(set url-basic-auth-storage
(cons (list server
(cons path
(string-match "/" path))
(while (and byserv (not retval))
(setq data (car (car byserv)))
- (if (or (not (string-match "/" data)) ; Its a realm - take it!
+ (if (or (not (string-match "/" data)) ; It's a realm - take it!
(and
(>= (length path) (length data))
(string= data (substring path 0 (length data)))))
(progn
(setq user (read-string (url-auth-user-prompt url realm)
(user-real-login-name))
- pass (funcall url-passwd-entry-func "Password: ")
+ pass (read-passwd "Password: ")
retval (base64-encode-string (format "%s:%s" user pass))
byserv (assoc server (symbol-value url-basic-auth-storage)))
(setcdr byserv
((and prompt (not byserv))
(setq user (read-string (url-auth-user-prompt url realm)
(user-real-login-name))
- pass (funcall url-passwd-entry-func "Password: ")
+ pass (read-passwd "Password: ")
url-digest-auth-storage
(cons (list server
(cons path
(progn
(setq user (read-string (url-auth-user-prompt url realm)
(user-real-login-name))
- pass (funcall url-passwd-entry-func "Password: ")
+ pass (read-passwd "Password: ")
retval (setq retval
(cons user
(url-digest-auth-create-key
representing the type (basic, digest, etc), or nil or the symbol 'any'
to specify that any authentication is acceptable. If requesting 'any'
the strongest matching authentication will be returned. If this is
- wrong, its no big deal, the error from the server will specify exactly
+ wrong, it's no big deal, the error from the server will specify exactly
what type of auth to use
PROMPT is boolean - specifies whether to ask the user for a username/password
if one cannot be found in the cache"
(function (or function (intern (concat "url-" type "-auth"))))
(rating (cond
((null rating) 2)
- ((stringp rating) (string-to-int rating))
+ ((stringp rating) (string-to-number rating))
(t rating)))
(node (assoc type url-registered-auth-schemes)))
(if (not (fboundp function))
(url-warn 'security
- (format (eval-when-compile
- "Tried to register `%s' as an auth scheme"
- ", but it is not a function!") function)))
+ (format (concat
+ "Tried to register `%s' as an auth scheme"
+ ", but it is not a function!") function)))
(if node
(setcdr node (cons function rating))
(assoc scheme url-registered-auth-schemes))
(provide 'url-auth)
+
+;;; arch-tag: 04058625-616d-44e4-9dbf-4b46b00b2a91
+;;; url-auth.el ends here