]> code.delx.au - gnu-emacs/blobdiff - lisp/epg.el
* lisp/loadup.el: Count byte-code functions as well.
[gnu-emacs] / lisp / epg.el
index 9ca07e213b4f3f7c9127b9289441fd8ffa0aa1bd..6529afb2d3c0f916a7d1dff28c0a81335987b0fd 100644 (file)
@@ -1,5 +1,5 @@
 ;;; epg.el --- the EasyPG Library -*- lexical-binding: t -*-
-;; Copyright (C) 1999-2000, 2002-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2000, 2002-2012 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Keywords: PGP, GnuPG
@@ -82,7 +82,7 @@
 (defconst epg-invalid-recipients-reason-alist
   '((0 . "No specific reason given")
     (1 . "Not Found")
-    (2 . "Ambigious specification")
+    (2 . "Ambiguous specification")
     (3 . "Wrong key usage")
     (4 . "Key revoked")
     (5 . "Key expired")
@@ -95,7 +95,7 @@
 (defconst epg-delete-problem-reason-alist
   '((1 . "No such key")
     (2 . "Must delete secret key first")
-    (3 . "Ambigious specification")))
+    (3 . "Ambiguous specification")))
 
 (defconst epg-import-ok-reason-alist
   '((0 . "Not actually changed")
@@ -356,7 +356,7 @@ query by itself and Emacs can intercept them."
 PROGRESS-CALLBACK is either a function, or a cons-cell whose
 car is a function and cdr is a callback data.
 
-The function gets five arguments: the context, the operation
+The function gets six arguments: the context, the operation
 description, the character to display a progress unit, the
 current amount done, the total amount to be done, and the
 callback data (if any)."
@@ -1951,7 +1951,8 @@ The returned file name (created by appending some random characters at the end
 of PREFIX, and expanding against `temporary-file-directory' if necessary),
 is guaranteed to point to a newly created empty file.
 You can then use `write-region' to write new data into the file."
-      (let (tempdir tempfile)
+      (let ((orig-modes (default-file-modes))
+           tempdir tempfile)
        (setq prefix (expand-file-name prefix
                                       (if (featurep 'xemacs)
                                           (temp-directory)
@@ -1959,6 +1960,7 @@ You can then use `write-region' to write new data into the file."
        (unwind-protect
            (let (file)
              ;; First, create a temporary directory.
+             (set-default-file-modes #o700)
              (while (condition-case ()
                         (progn
                           (setq tempdir (make-temp-name
@@ -1969,14 +1971,12 @@ You can then use `write-region' to write new data into the file."
                           (make-directory tempdir))
                       ;; let's try again.
                       (file-already-exists t)))
-             (set-file-modes tempdir 448)
              ;; Second, create a temporary file in the tempdir.
              ;; There *is* a race condition between `make-temp-name'
              ;; and `write-region', but we don't care it since we are
              ;; in a private directory now.
              (setq tempfile (make-temp-name (concat tempdir "/EMU")))
              (write-region "" nil tempfile nil 'silent)
-             (set-file-modes tempfile 384)
              ;; Finally, make a hard-link from the tempfile.
              (while (condition-case ()
                         (progn
@@ -1986,6 +1986,7 @@ You can then use `write-region' to write new data into the file."
                       ;; let's try again.
                       (file-already-exists t)))
              file)
+         (set-default-file-modes orig-modes)
          ;; Cleanup the tempfile.
          (and tempfile
               (file-exists-p tempfile)
@@ -2031,7 +2032,7 @@ CIPHER must be a file data object.
 
 If you use this function, you will need to wait for the completion of
 `epg-gpg-program' by using `epg-wait-for-completion' and call
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-decrypt-file' or `epg-decrypt-string' instead."
   (unless (epg-data-file cipher)
@@ -2097,7 +2098,7 @@ For a normal or a cleartext signature, SIGNED-TEXT should be nil.
 
 If you use this function, you will need to wait for the completion of
 `epg-gpg-program' by using `epg-wait-for-completion' and call
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-verify-file' or `epg-verify-string' instead."
   (epg-context-set-operation context 'verify)
@@ -2195,7 +2196,7 @@ Otherwise, it makes a cleartext signature.
 
 If you use this function, you will need to wait for the completion of
 `epg-gpg-program' by using `epg-wait-for-completion' and call
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-sign-file' or `epg-sign-string' instead."
   (epg-context-set-operation context 'sign)
@@ -2299,7 +2300,7 @@ If RECIPIENTS is nil, it performs symmetric encryption.
 
 If you use this function, you will need to wait for the completion of
 `epg-gpg-program' by using `epg-wait-for-completion' and call
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-encrypt-file' or `epg-encrypt-string' instead."
   (epg-context-set-operation context 'encrypt)
@@ -2414,7 +2415,7 @@ If RECIPIENTS is nil, it performs symmetric encryption."
 
 If you use this function, you will need to wait for the completion of
 `epg-gpg-program' by using `epg-wait-for-completion' and call
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-export-keys-to-file' or `epg-export-keys-to-string' instead."
   (epg-context-set-operation context 'export-keys)
@@ -2457,7 +2458,7 @@ KEYS is a data object.
 
 If you use this function, you will need to wait for the completion of
 `epg-gpg-program' by using `epg-wait-for-completion' and call
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-import-keys-from-file' or `epg-import-keys-from-string' instead."
   (epg-context-set-operation context 'import-keys)
@@ -2498,7 +2499,7 @@ KEY-ID-LIST is a list of key IDs.
 
 If you use this function, you will need to wait for the completion of
 `epg-gpg-program' by using `epg-wait-for-completion' and call
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-receive-keys' instead."
   (epg-context-set-operation context 'receive-keys)
@@ -2526,7 +2527,7 @@ KEYS is a list of key IDs"
 
 If you use this function, you will need to wait for the completion of
 `epg-gpg-program' by using `epg-wait-for-completion' and call
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-delete-keys' instead."
   (epg-context-set-operation context 'delete-keys)
@@ -2558,7 +2559,7 @@ If you are unsure, use synchronous version of this function
 
 If you use this function, you will need to wait for the completion of
 `epg-gpg-program' by using `epg-wait-for-completion' and call
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-sign-keys' instead."
   (epg-context-set-operation context 'sign-keys)
@@ -2593,7 +2594,7 @@ PARAMETERS specifies parameters for the key.
 
 If you use this function, you will need to wait for the completion of
 `epg-gpg-program' by using `epg-wait-for-completion' and call
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-generate-key-from-file' or `epg-generate-key-from-string' instead."
   (epg-context-set-operation context 'generate-key)