From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sven Joachim Newsgroups: gmane.emacs.help Subject: Re: Bug when compiling elc code? Date: Wed, 08 Aug 2007 14:17:00 +0200 Message-ID: <87y7gmqkzn.fsf@gmx.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1186577334 19590 80.91.229.12 (8 Aug 2007 12:48:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Aug 2007 12:48:54 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Hadron Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 08 14:48:52 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IIky1-00015f-ND for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Aug 2007 14:48:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIky1-0007Ar-85 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Aug 2007 08:48:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IIkQL-0004XZ-RE for help-gnu-emacs@gnu.org; Wed, 08 Aug 2007 08:14:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IIkQK-0004XH-8c for help-gnu-emacs@gnu.org; Wed, 08 Aug 2007 08:14:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIkQK-0004XE-3K for help-gnu-emacs@gnu.org; Wed, 08 Aug 2007 08:14:00 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1IIkQJ-0006H0-LM for help-gnu-emacs@gnu.org; Wed, 08 Aug 2007 08:14:00 -0400 Original-Received: (qmail invoked by alias); 08 Aug 2007 12:13:57 -0000 Original-Received: from p548641A2.dip.t-dialin.net (EHLO debian) [84.134.65.162] by mail.gmx.net (mp033) with SMTP; 08 Aug 2007 14:13:57 +0200 X-Authenticated: #28250155 X-Provags-ID: V01U2FsdGVkX18WuCB66MAWMNND1i2Ewmp7y41dJyiE/MWqEyPfZ2 fRASBo0sr8thoj In-Reply-To: (Hadron's message of "Wed\, 08 Aug 2007 12\:29\:56 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Wed, 08 Aug 2007 08:48:09 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:46405 Archived-At: Hadron writes: > I recently added this bit of lisp to my .emacs in order to automatically > byte compile any el files I saved > > ,---- > | (add-hook 'emacs-lisp-mode-hook > | '(lambda () > | (make-local-hook 'after-save-hook) > | (add-hook 'after-save-hook > | '(lambda () > | (byte-compile-file buffer-file-name)) > | nil t))) > `---- > > I have my gnus specifics such as smtp server names and passwords in a > "personal.el" file which is obviously not readable by anyone but my own > login and root. > > Unfortunately byte-compile-file produced the following: > > -rw------- 1 hadron hadron 4961 2007-08-08 12:19 personal.el > -rw-r--r-- 1 hadron hadron 3795 2007-08-08 12:19 personal.elc > > In other words a readable by anyone elc file. > > I just checked - I can load up the elc file and see all my passwords. > > Bug or feature? Seems like a nasty bug to me. No, not really. If personal.elc does not exist, Emacs creates it according to your current umask, like any other file. You can change this default with the function set-default-file-modes, please try the following: (add-hook 'emacs-lisp-mode-hook '(lambda () (make-local-hook 'after-save-hook) (add-hook 'after-save-hook '(lambda () (let ((old-mode (default-file-modes))) (set-default-file-modes (file-modes buffer-file-name)) (byte-compile-file buffer-file-name) (set-default-file-modes old-mode))) nil t)))