From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH v3] Add systemd socket launching support Date: Thu, 31 Mar 2016 22:34:14 +0300 Message-ID: <83y48ytpah.fsf@gnu.org> References: <874mbn7kmn.fsf@mattleach.net> <871t6qkc3h.fsf@mattleach.net> <8337r6v930.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1459452885 31755 80.91.229.3 (31 Mar 2016 19:34:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Mar 2016 19:34:45 +0000 (UTC) Cc: matthew@mattleach.net, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 31 21:34:45 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aliMe-0007wm-DD for ged-emacs-devel@m.gmane.org; Thu, 31 Mar 2016 21:34:44 +0200 Original-Received: from localhost ([::1]:34060 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aliMd-0003OV-U9 for ged-emacs-devel@m.gmane.org; Thu, 31 Mar 2016 15:34:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aliMQ-0003NM-A5 for emacs-devel@gnu.org; Thu, 31 Mar 2016 15:34:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aliMM-0006r0-8b for emacs-devel@gnu.org; Thu, 31 Mar 2016 15:34:30 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aliMM-0006qw-4p; Thu, 31 Mar 2016 15:34:26 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1996 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aliML-0001Kc-DY; Thu, 31 Mar 2016 15:34:25 -0400 In-reply-to: (message from Stefan Monnier on Thu, 31 Mar 2016 14:14:01 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:202528 Archived-At: > From: Stefan Monnier > Cc: matthew@mattleach.net, emacs-devel@gnu.org > Date: Thu, 31 Mar 2016 14:14:01 -0400 > > In other similar functionality I've seen over the years, an alternative > was to pass the fd as an additional argument on the command line, but in > any case whether it's received from the environment or the command line, > the file-descriptor to use will just be an integer, and it's already > exposed to Lisp. It's an attack vector expecting to happen, so we should try to avoid that. > So, AFAICT we just need 3 elements: > - a function to get the FD number from systemd (which we could write in > Elisp, but is much better implemented as a call to systemd's support > library). > - a way to create a process-object from an existing file-descriptor number. > - changes in server.el to connect the previous 2 elements together. > > AFAICT, only the first part is systemd-specific, so I think it would > make sense to try and avoid having systemd-specific details leak to the > other parts. I agree, and the last version of the patch already does that: it only requires a boolean flag exposed to other APIs.