Created
April 11, 2014 13:32
-
-
Save dseg/10469208 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- twittering-mode.el.orig 2013-05-06 15:40:54.000000000 +0900 | |
+++ twittering-mode.el 2014-04-11 22:26:00.759759428 +0900 | |
@@ -560,7 +560,7 @@ | |
(defvar twittering-use-master-password nil | |
"*Wheter to store private information encrypted with a master password.") | |
(defvar twittering-private-info-file | |
- (expand-file-name "~/.twittering-mode.gpg") | |
+ (expand-file-name "~/.twittering-mode.conf") | |
"*File for storing encrypted private information when | |
`twittering-use-master-password' is non-nil.") | |
(defvar twittering-private-info-file-loaded nil | |
@@ -3333,7 +3333,12 @@ | |
(defun twittering-load-private-info () | |
(let* ((file twittering-private-info-file) | |
- (decrypted-str (twittering-read-from-encrypted-file file)) | |
+; (decrypted-str (twittering-read-from-encrypted-file file)) | |
+ (decrypted-str ((lambda (file) | |
+ (with-temp-buffer | |
+ (insert-file-contents file) | |
+ (buffer-string))) | |
+ file)) | |
(loaded-alist | |
(when decrypted-str | |
(condition-case nil | |
@@ -3380,6 +3385,10 @@ | |
twittering-variables-stored-with-encryption)) | |
(str (with-output-to-string (pp obj))) | |
(file twittering-private-info-file)) | |
+ | |
+ ((lambda () | |
+ (with-temp-file file (insert str)))) | |
+ | |
(when (twittering-write-and-encrypt file str) | |
(set-file-modes file #o600) | |
(setq twittering-private-info-file-loaded t)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ArchLinux (2014-4-11) で twittering-mode をどうしても使いたかったので、無理矢理ごまかすパッチ。
twitterの認証系情報を、平文のままファイルに保存、読み込みする。…危険。
現象:
(setq twittering-use-master-password t)
の設定で、twittering-modeを起動(M-x twit) すると、PINコードを入力したあと、GPGでtwitterの認証系情報を暗号化するところで Encrypting...... と表示されたまま止まってしまう。
GPGのパスワード入力ダイアログ(cursesの)がEmacs上に表示されないのが原因と思われる。
(twittering-modeの問題ではなくて、環境の問題。Emacsのバージョンとepg.el/alpaca.elのバージョンの相性?)
環境:
ArchLinux + Emacs 24.3.1 + GnuPG 2.0.22-2 + twittering-mode 3.0.0
参考:
24.3.50; epg.el and GnuPG 2.x cause unavoidable pinentry prompts for symmetrically encrypted files
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15553