;;; 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
(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")
(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")
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)."
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)
(unwind-protect
(let (file)
;; First, create a temporary directory.
+ (set-default-file-modes #o700)
(while (condition-case ()
(progn
(setq tempdir (make-temp-name
(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
;; let's try again.
(file-already-exists t)))
file)
+ (set-default-file-modes orig-modes)
;; Cleanup the tempfile.
(and tempfile
(file-exists-p tempfile)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)