From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: [PATCH] Make sure /dev/pts/ptmx is world-writable Date: Wed, 02 Apr 2014 23:41:11 +0200 Message-ID: <87sipvflzc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVSuP-0003uc-5P for guix-devel@gnu.org; Wed, 02 Apr 2014 17:41:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVSuI-0005Ud-B6 for guix-devel@gnu.org; Wed, 02 Apr 2014 17:41:21 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:56868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVSuI-0005UR-3k for guix-devel@gnu.org; Wed, 02 Apr 2014 17:41:14 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: nix-dev@cs.uu.nl Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, While running Python 3=E2=80=99s test suite, we noticed that on some systems /dev/pts/ptmx is created with permissions 0 (that=E2=80=99s the case with my Nixpkgs-originating 3.0.43 kernel, but someone with a Debian-originating 3.10-3 reported not having this problem.) There=E2=80=99s still the problem that people without CONFIG_DEVPTS_MULTIPLE_INSTANCES=3Dy are screwed (as noted in build.cc), but I don=E2=80=99t see how we could work around it. Thoughts? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/src/libstore/build.cc b/src/libstore/build.cc index e846995..53a92c1 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2079,6 +2079,10 @@ void DerivationGoal::initChild() if (mount("none", (chrootRootDir + "/dev/pts").c_str(), "devpts", 0, "newinstance,mode=0620") == -1) throw SysError("mounting /dev/pts"); createSymlink("/dev/pts/ptmx", chrootRootDir + "/dev/ptmx"); + + /* Make sure /dev/pts/ptmx is world-writable. With some + Linux versions, it is created with permissions 0. */ + chmod_(chrootRootDir + "/dev/pts/ptmx", 0666); } /* Do the chroot(). Below we do a chdir() to the --=-=-=--