From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 07 16:47:07 2011 Received: (at quiet) by debbugs.gnu.org; 7 Mar 2011 21:47:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwiGh-00076h-Ga for submit@debbugs.gnu.org; Mon, 07 Mar 2011 16:47:07 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwiFp-00075A-Lw for quiet@debbugs.gnu.org; Mon, 07 Mar 2011 16:46:14 -0500 Received: from localhost ([127.0.0.1]:46005) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwiFk-0006Vx-IV for quiet@debbugs.gnu.org; Mon, 07 Mar 2011 16:46:08 -0500 From: Michal Nazarewicz To: quiet@debbugs.gnu.org Subject: [PATCH] lisp/server.el: Introduction of server-auth-key variable Date: Tue, 22 Feb 2011 14:55:00 +0100 Lines: 98 X-From-Line: emacs-devel-bounces+rgm=gnu.org@gnu.org Tue Feb 22 12:12:12 2011 Received: from eggs.gnu.org ([140.186.70.92]:47572) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PrvmW-0003wJ-2b for rgm@gnu.org; Tue, 22 Feb 2011 12:12:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrvmU-0007Cq-TL for rgm@gnu.org; Tue, 22 Feb 2011 12:12:11 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:35987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrvmU-0007Ci-OA for rgm@gnu.org; Tue, 22 Feb 2011 12:12:10 -0500 Received: from localhost ([127.0.0.1]:43311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrvmU-0008Tt-7i for rgm@gnu.org; Tue, 22 Feb 2011 12:12:10 -0500 Received: from [140.186.70.92] (port=49506 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Prsn6-0004JI-1y for emacs-devel@gnu.org; Tue, 22 Feb 2011 09:00:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrsiT-0005Vg-LE for emacs-devel@gnu.org; Tue, 22 Feb 2011 08:55:50 -0500 Received: from smtp-out.google.com ([74.125.121.67]:22087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrsiT-0005V9-9X for emacs-devel@gnu.org; Tue, 22 Feb 2011 08:55:49 -0500 Received: from kpbe19.cbf.corp.google.com (kpbe19.cbf.corp.google.com [172.25.105.83]) by smtp-out.google.com with ESMTP id p1MDtkiD001572 for ; Tue, 22 Feb 2011 05:55:47 -0800 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1298382947; bh=sys5wdzU3D+VM2ERyb3pXYntl6o=; h=From:To:Cc:Subject:Date:Message-Id; b=t8TSo0p4cLjaPqOHTHt5HUXeGkxChDNNvj+sv4WLENv4RnecYsJGvzO91mzt+AUu7 sMR3UJOm7GuD5QxmwiQ5g== Received: from fxm20 (fxm20.prod.google.com [10.184.13.20]) by kpbe19.cbf.corp.google.com with ESMTP id p1MDtiB1001928 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 22 Feb 2011 05:55:45 -0800 Received: by fxm20 with SMTP id 20so2447178fxm.12 for ; Tue, 22 Feb 2011 05:55:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=i6f8sxfDp1ammc+kFez+Xz0xBaJN4wdvannxDRSNPiQ=; b=XE28ZY9FCiiwQAYkRID/kqmM52OzCt5dt34+fE/jjZCM6eT1LCZvLpp8779LlnjpaT 6eRbyMY90muIv0fSMzSA== DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=from:to:cc:subject:date:message-id:x-mailer; b=BLLeVJrLMIQZleUTH1n9f875ZOTXlYeHM52WOdIBeR3axgh1ZhhOe1+TG7ju5VESKt p0mxmD1E8irpM8IyY9Zg== Received: by 10.223.87.193 with SMTP id x1mr3440816fal.118.1298382943861; Tue, 22 Feb 2011 05:55:43 -0800 (PST) Received: from mnazarewicz-glaptop.zrh.corp.google.com (dhcp-172-16-75-204.zrh.corp.google.com [172.16.75.204]) by mx.google.com with ESMTPS id z1sm2538763fau.21.2011.02.22.05.55.42 (version=SSLv3 cipher=OTHER); Tue, 22 Feb 2011 05:55:43 -0800 (PST) X-Mailer: git-send-email 1.7.3.1 X-System-Of-Record: true X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Tue, 22 Feb 2011 12:09:51 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: quiet X-Mailman-Approved-At: Mon, 07 Mar 2011 16:47:05 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) Package: emacs Severity: wishlist This commit adds a server-auth-key variable which allows user to specify a default authentication key used by the server process. --- lisp/server.el | 42 +++++++++++++++++++++++++++++++++++------- 1 files changed, 35 insertions(+), 7 deletions(-) Hello, attached is a patch that adds a `server-auth-key' variable, which I use to easily allow a host to connect to Emacs daemon listening on TCP port without the need of synchronising the server file each time server starts. The etc/CONTRIBUTE mentions ChangeLog entry. I'm unsure whether you need anything more then the commit message above but in case you do, here's ChangeLog entry: 2011-02-21 Michal Nazarewicz (tiny change) * lisp/server.el: Introduce server-auth-key variable which allows user to specify a default authentication key used by the server process. Hope you guys don't mind git style patch mail. diff --git a/lisp/server.el b/lisp/server.el index df8cae0..3963e86 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -134,6 +134,27 @@ directory residing in a NTFS partition instead." ;;;###autoload (put 'server-auth-dir 'risky-local-variable t) +(defcustom server-auth-key nil + "Server authentication key. + +Normally, authentication key is generated on random when server +starts, which guarantees a certain level of security. It is +recommended to leave it that way. + +In some situations however, it can be difficult to share randomly +generated password with remote hosts (eg. no shared directory), +so you can set the key with this variable and then copy server +file to remote host (with possible changes to IP address and/or +port if that applies). + +You can use \\[server-generate-key] to get a random authentication +key." + :group 'server + :type '(choice + (const :tag "Random" nil) + (string :tag "Password")) + :version "24.0") + (defcustom server-raise-frame t "If non-nil, raise frame when switching to a buffer." :group 'server @@ -495,6 +516,19 @@ See variable `server-auth-dir' for details." (unless safe (error "The directory `%s' is unsafe" dir))))) +(defun server-generate-key () + "Generates and returns a random 64-byte strings of random chars +in the range `!'..`~'. If called interactively, also inserts it +into current buffer." + (interactive) + (let ((auth-key + (loop repeat 64 + collect (+ 33 (random 94)) into auth + finally return (concat auth)))) + (if (called-interactively-p) + (insert auth-key)) + auth-key)) + ;;;###autoload (defun server-start (&optional leave-dead inhibit-prompt) "Allow this Emacs process to be a server for client processes. @@ -588,13 +622,7 @@ server or call `M-x server-force-delete' to forcibly disconnect it.") (unless server-process (error "Could not start server process")) (process-put server-process :server-file server-file) (when server-use-tcp - (let ((auth-key - (loop - ;; The auth key is a 64-byte string of random chars in the - ;; range `!'..`~'. - repeat 64 - collect (+ 33 (random 94)) into auth - finally return (concat auth)))) + (let ((auth-key (or server-auth-key (server-generate-key)))) (process-put server-process :auth-key auth-key) (with-temp-file server-file (set-buffer-multibyte nil) -- 1.7.3.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 02 02:52:05 2011 Received: (at control) by debbugs.gnu.org; 2 Sep 2011 06:52:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QzNbh-0001Cc-3D for submit@debbugs.gnu.org; Fri, 02 Sep 2011 02:52:05 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QzNbe-0001CV-S0 for control@debbugs.gnu.org; Fri, 02 Sep 2011 02:52:03 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1QzNYN-0007E1-8d for control@debbugs.gnu.org; Fri, 02 Sep 2011 02:48:39 -0400 Date: Fri, 02 Sep 2011 02:48:39 -0400 Message-Id: Subject: control message for bug 9423 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) merge 8198 9423 From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 14 07:18:39 2012 Received: (at control) by debbugs.gnu.org; 14 Apr 2012 11:18:39 +0000 Received: from localhost ([127.0.0.1]:58100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJ100-0001Rt-6n for submit@debbugs.gnu.org; Sat, 14 Apr 2012 07:18:39 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:33365) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJ0zy-0001Rj-NT for control@debbugs.gnu.org; Sat, 14 Apr 2012 07:18:35 -0400 Received: from static-195.22.91.6.addr.tdcsong.se ([195.22.91.6] helo=rusty) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1SJ0yU-0001eb-K0 for control@debbugs.gnu.org; Sat, 14 Apr 2012 13:17:02 +0200 Date: Sat, 14 Apr 2012 13:17:01 +0200 Message-Id: <871unqo95e.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #9423 X-MailScanner-ID: 1SJ0yU-0001eb-K0 X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1335007022.74814@L46VXP8FsH6toiERlgF7KQ X-Spam-Status: No X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) tags 9423 fixed close 9423 24.2 From unknown Mon Aug 18 17:53:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 13 May 2012 11:24:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator