GNU bug report logs - #9423
lisp/server.el: Allow custom server-auth-key

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Fri, 2 Sep 2011 03:43:02 UTC

Severity: wishlist

Tags: fixed, patch

Merged with 8198

Fixed in version 24.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9423 in the body.
You can then email your comments to 9423 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, mina86 <at> mina86.com, bug-gnu-emacs <at> gnu.org:
bug#9423; Package emacs. (Fri, 02 Sep 2011 03:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
New bug report received and forwarded. Copy sent to mina86 <at> mina86.com, bug-gnu-emacs <at> gnu.org. (Fri, 02 Sep 2011 03:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: lisp/server.el: Allow custom server-auth-key
Date: Thu, 01 Sep 2011 23:39:23 -0400
Package: emacs
Severity: wishlist
Tag: patch

> This patch adds a possibility to set create a custom server-auth-key
> which may be shared between several machines without the need of
> having common file system, etc.

> I'm resending this patch as last time the discussion somehow died.

> As for legal stuff, the patch is (c) Google Inc. but since Google has
> signed necessary agreement it should be no problem, right?

> Changelog entry is as follows:


> 2011-08-26  Michal Nazarewicz  <mina86 <at> mina86.com>

> 	* lisp/selver.el (server-auth-key, server-generate-key,
> 	server-get-auth-key, server-start): Add possibility to set
> 	server-auth-key instead of using random one each time.


> === modified file 'lisp/server.el'
> *** lisp/server.el	2011-07-04 22:40:03 +0000
> --- lisp/server.el	2011-08-08 14:12:01 +0000
> *************** directory residing in a NTFS partition i
> *** 134,139 ****
> --- 134,166 ----
>   ;;;###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 some level of security.  It is
> + recommended to leave it that way.  Using a long-lived shared key
> + may decrease security (especially since the key is transmitted as
> + plain text).
> + 
> + 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).
> + 
> + The key must consist of 64 US-ASCII printable characters except
> + for space (this means characters from ! to ~; or from code 33
> + to 126).
> + 
> + 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
> *************** See variable `server-auth-dir' for detai
> *** 503,508 ****
> --- 530,561 ----
>         (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))
> + 
> + (defun server-get-auth-key ()
> +   "Returns server's authentication key.
> + 
> + If `server-auth-key' is nil this function will just call
> + `server-generate-key'.  Otherwise, if `server-auth-key' is
> + a valid authentication it will return it.  Otherwise, it will
> + signal an error."
> +   (if server-auth-key
> +     (if (string-match "^[!-~]\\{64\\}$" server-auth-key)
> +         server-auth-key
> +       (error "The key '%s' is invalid" server-auth-key))
> +     (server-generate-key)))
> + 
>   ;;;###autoload
>   (defun server-start (&optional leave-dead inhibit-prompt)
>     "Allow this Emacs process to be a server for client processes.
> *************** server or call `M-x server-force-delete'
> *** 596,608 ****
>   	  (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))))
>   	      (process-put server-process :auth-key auth-key)
>   	      (with-temp-file server-file
>   		(set-buffer-multibyte nil)
> --- 649,655 ----
>   	  (unless server-process (error "Could not start server process"))
>   	  (process-put server-process :server-file server-file)
>   	  (when server-use-tcp
> ! 	    (let ((auth-key (server-get-auth-key)))
>   	      (process-put server-process :auth-key auth-key)
>   	      (with-temp-file server-file
>   		(set-buffer-multibyte nil)





Merged 8198 9423. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 02 Sep 2011 06:53:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9423; Package emacs. (Thu, 12 Apr 2012 19:49:01 GMT) Full text and rfc822 format available.

Message #10 received at 9423 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 9423 <at> debbugs.gnu.org, Michal Nazarewicz <mina86 <at> mina86.com>
Subject: Re: bug#9423: lisp/server.el: Allow custom server-auth-key
Date: Thu, 12 Apr 2012 21:46:54 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> This patch adds a possibility to set create a custom server-auth-key
>> which may be shared between several machines without the need of
>> having common file system, etc.
>
>> I'm resending this patch as last time the discussion somehow died.

I'm assuming this patch has been approved, but not applied because of
the pretest window?

>> As for legal stuff, the patch is (c) Google Inc. but since Google has
>> signed necessary agreement it should be no problem, right?

Anybody know?  I've always assumed that the FSF needs assignment from
the person who wrote the code, even if their employer claims to own the
code.  (That doesn't sound likely, now that I'm typing it...)

>> Changelog entry is as follows:
>
>> 2011-08-26  Michal Nazarewicz  <mina86 <at> mina86.com>
>
>> 	* lisp/selver.el (server-auth-key, server-generate-key,
>> 	server-get-auth-key, server-start): Add possibility to set
>> 	server-auth-key instead of using random one each time.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9423; Package emacs. (Thu, 12 Apr 2012 22:16:02 GMT) Full text and rfc822 format available.

Message #13 received at 9423 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: 9423 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
	Michal Nazarewicz <mina86 <at> mina86.com>
Subject: Re: bug#9423: lisp/server.el: Allow custom server-auth-key
Date: Thu, 12 Apr 2012 18:14:00 -0400
Lars Magne Ingebrigtsen wrote:

> Anybody know?  I've always assumed that the FSF needs assignment from
> the person who wrote the code, even if their employer claims to own the
> code.

That's my assumption too. Ask assign <at> gnu for a definitive answer, I guess.
Or just get an assignment anyway to be safe. (People in the US can do it
entirely by email now, so it's not much work.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9423; Package emacs. (Thu, 12 Apr 2012 23:17:02 GMT) Full text and rfc822 format available.

Message #16 received at 9423 <at> debbugs.gnu.org (full text, mbox):

From: "Michal Nazarewicz" <mina86 <at> mina86.com>
To: "Stefan Monnier" <monnier <at> iro.umontreal.ca>, "Lars Magne Ingebrigtsen"
	<larsi <at> gnus.org>
Cc: 9423 <at> debbugs.gnu.org
Subject: Re: bug#9423: lisp/server.el: Allow custom server-auth-key
Date: Fri, 13 Apr 2012 00:48:25 +0200
On Thu, 12 Apr 2012 21:46:54 +0200, Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote:

>>> As for legal stuff, the patch is (c) Google Inc. but since Google has
>>> signed necessary agreement it should be no problem, right?

> Anybody know?  I've always assumed that the FSF needs assignment from
> the person who wrote the code, even if their employer claims to own the
> code.  (That doesn't sound likely, now that I'm typing it...)

I don't have any copyright over the code, so I'm not sure why I would have
to assign the copyright to FSF if copyright holder already did that.  Then
again, if required, I can do it.  Could anyone point me to necessary
paperwork? CONTRIBUTE only says that “The process is straightforward --
contact us at emacs-devel <at> gnu.org to obtain the relevant forms.” but gives
no details.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn <at> google.com>--------------ooO--(_)--Ooo--




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9423; Package emacs. (Fri, 13 Apr 2012 12:52:02 GMT) Full text and rfc822 format available.

Message #19 received at 9423 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Michal Nazarewicz" <mina86 <at> mina86.com>
Cc: 9423 <at> debbugs.gnu.org, Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#9423: lisp/server.el: Allow custom server-auth-key
Date: Fri, 13 Apr 2012 08:50:12 -0400
>>>> As for legal stuff, the patch is (c) Google Inc. but since Google has
>>>> signed necessary agreement it should be no problem, right?
>> Anybody know?  I've always assumed that the FSF needs assignment from
>> the person who wrote the code, even if their employer claims to own the
>> code.  (That doesn't sound likely, now that I'm typing it...)
> I don't have any copyright over the code, so I'm not sure why I would have
> to assign the copyright to FSF if copyright holder already did that.

The FSF's copyright clerk confirmed that, as long as the copyright
belongs to Google, we're good to go.  So we can install your patch
right away.  Lars, can you take care of that?

> Then again, if required, I can do it.  Could anyone point me to
> necessary paperwork? CONTRIBUTE only says that “The process is
> straightforward -- contact us at emacs-devel <at> gnu.org to obtain the
> relevant forms.” but gives no details.

That would be even better, since it's sometimes non-trivial to figure
out if your employer owns the copyright or if you do.
The process is as follows: fill the form below and email it as
instructed so the FSF can send you the necessary paperwork to sign.
Thank you for your contribution,


        Stefan


Please email the following information to assign <at> gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]


[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]


[For the copyright registration, what country are you a citizen of?]


[What year were you born?]


[Please write your email address here.]


[Please write your postal address here.]





[Which files have you changed so far, and which new files have you written
so far?]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9423; Package emacs. (Fri, 13 Apr 2012 13:02:01 GMT) Full text and rfc822 format available.

Message #22 received at 9423 <at> debbugs.gnu.org (full text, mbox):

From: "Michal Nazarewicz" <mina86 <at> mina86.com>
To: "Stefan Monnier" <monnier <at> iro.umontreal.ca>
Cc: 9423 <at> debbugs.gnu.org, Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#9423: lisp/server.el: Allow custom server-auth-key
Date: Fri, 13 Apr 2012 15:00:05 +0200
On Fri, 13 Apr 2012 14:50:12 +0200, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
> The process is as follows: fill the form below and email it as
> instructed so the FSF can send you the necessary paperwork to sign.
> Thank you for your contribution,
>
>         Stefan
>
> Please email the following information to assign <at> gnu.org, and we
> will send you the assignment form for your past and future changes.

Done.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn <at> google.com>--------------ooO--(_)--Ooo--




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9423; Package emacs. (Sat, 14 Apr 2012 04:18:02 GMT) Full text and rfc822 format available.

Message #25 received at 9423 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 9423 <at> debbugs.gnu.org, larsi <at> gnus.org, mina86 <at> mina86.com
Subject: Re: bug#9423: lisp/server.el: Allow custom server-auth-key
Date: Sat, 14 Apr 2012 00:16:11 -0400
If the employer claims copyright, only the employer can assign the
copyright.  In that case, the employee's signature is not needed.

--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use free telephony http://directory.fsf.org/category/tel/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9423; Package emacs. (Sat, 14 Apr 2012 11:19:01 GMT) Full text and rfc822 format available.

Message #28 received at 9423 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 9423 <at> debbugs.gnu.org, Michal Nazarewicz <mina86 <at> mina86.com>
Subject: Re: bug#9423: lisp/server.el: Allow custom server-auth-key
Date: Sat, 14 Apr 2012 13:16:56 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> The FSF's copyright clerk confirmed that, as long as the copyright
> belongs to Google, we're good to go.  So we can install your patch
> right away.  Lars, can you take care of that?

I've now applied the patch to the Emacs trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Rome




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 14 Apr 2012 11:19:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 24.2, send any further explanations to 9423 <at> debbugs.gnu.org and Stefan Monnier <monnier <at> iro.umontreal.ca> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 14 Apr 2012 11:19:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9423; Package emacs. (Sat, 14 Apr 2012 18:11:01 GMT) Full text and rfc822 format available.

Message #35 received at 9423 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: rms <at> gnu.org
Cc: 9423 <at> debbugs.gnu.org
Subject: Re: bug#9423: lisp/server.el: Allow custom server-auth-key
Date: Sat, 14 Apr 2012 14:08:36 -0400
Richard Stallman wrote:

> If the employer claims copyright, only the employer can assign the
> copyright.  In that case, the employee's signature is not needed.

Thanks. Maybe you could add a sentence along those lines to the "Copyright
Papers" section of "Information for GNU Maintainers".

http://www.gnu.org/prep/maintain/maintain.html#Copyright-Papers

It would seem to fit naturally after the current sentence:

   We may also need an employer's disclaimer from the person's employer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9423; Package emacs. (Sun, 15 Apr 2012 02:20:02 GMT) Full text and rfc822 format available.

Message #38 received at 9423 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 9423 <at> debbugs.gnu.org
Subject: Re: bug#9423: lisp/server.el: Allow custom server-auth-key
Date: Sat, 14 Apr 2012 22:18:13 -0400
    Thanks. Maybe you could add a sentence along those lines to the "Copyright
    Papers" section of "Information for GNU Maintainers".

I added it.  Thanks.

--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use free telephony http://directory.fsf.org/category/tel/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 13 May 2012 11:24:02 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 361 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.