From unknown Sun Jun 22 22:48:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39211: [PATCH 1/1] 00-repl-server.test: don't use fixed path for socket Resent-From: Rob Browning Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 21 Jan 2020 03:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39211 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: 39211@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15795769175938 (code B ref -1); Tue, 21 Jan 2020 03:22:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Jan 2020 03:21:57 +0000 Received: from localhost ([127.0.0.1]:46359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1itk73-0001Xh-Br for submit@debbugs.gnu.org; Mon, 20 Jan 2020 22:21:57 -0500 Received: from lists.gnu.org ([209.51.188.17]:59276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1itk71-0001XZ-9B for submit@debbugs.gnu.org; Mon, 20 Jan 2020 22:21:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54000) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itk70-0005xf-5n for bug-guile@gnu.org; Mon, 20 Jan 2020 22:21:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itk6z-0008Jp-5A for bug-guile@gnu.org; Mon, 20 Jan 2020 22:21:54 -0500 Received: from defaultvalue.org ([45.33.119.55]:58108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1itk6z-0008Iv-0o for bug-guile@gnu.org; Mon, 20 Jan 2020 22:21:53 -0500 Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id 5963D2009C for ; Mon, 20 Jan 2020 21:21:51 -0600 (CST) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 1BF8214E071; Mon, 20 Jan 2020 21:22:14 -0600 (CST) From: Rob Browning Date: Mon, 20 Jan 2020 21:22:14 -0600 Message-Id: <20200121032214.1908896-1-rlb@defaultvalue.org> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 45.33.119.55 X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Even setting aside any security concerns, this caused tests to fail if you ran them as a given user and then ran them again as another user. --- It didn't look like we have anything like mkdtemp or I'd have used it instead. And it looks like this might apply to, and it would be nice to have something like it on stable-2.2 as well. test-suite/tests/00-repl-server.test | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test-suite/tests/00-repl-server.test b/test-suite/tests/00-r= epl-server.test index 54f518a66..4324f7371 100644 --- a/test-suite/tests/00-repl-server.test +++ b/test-suite/tests/00-repl-server.test @@ -24,13 +24,25 @@ #:use-module (web request) #:use-module (test-suite lib)) =20 +(define (make-tempdir) + (let loop ((try 0) + (n (random:uniform))) + (let* ((path (string-append "/tmp/repl-server-test-" (number->string= n))) + (dir (false-if-exception (mkdir path #o700)))) + (cond + (dir path) + ((> try 10) + (error "Unable to create directory in /tmp for 00-repl-server.te= st")) + (else (loop (1+ try) (random:uniform))))))) + (define (call-with-repl-server proc) "Set up a REPL server in a separate process and call PROC with a socket connected to that server." - (let ((sockaddr (make-socket-address AF_UNIX "/tmp/repl-server")) - (client-socket (socket AF_UNIX SOCK_STREAM 0))) - (false-if-exception - (delete-file (sockaddr:path sockaddr))) + (let* ((tmpdir (make-tempdir)) + (sockaddr (make-socket-address AF_UNIX (string-append tmpdir "/= repl-server"))) + (client-socket (socket AF_UNIX SOCK_STREAM 0))) + (false-if-exception (delete-file (sockaddr:path sockaddr))) + (false-if-exception (rmdir tmpdir)) =20 ;; The REPL server requires thread. The test requires fork. (unless (and (provided? 'threads) (provided? 'fork)) --=20 2.24.0 From unknown Sun Jun 22 22:48:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39211: [PATCH 1/1] 00-repl-server.test: don't use fixed path for socket Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 21 Jan 2020 16:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39211 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: Rob Browning Cc: 39211@debbugs.gnu.org Received: via spool by 39211-submit@debbugs.gnu.org id=B39211.157962547225692 (code B ref 39211); Tue, 21 Jan 2020 16:52:02 +0000 Received: (at 39211) by debbugs.gnu.org; 21 Jan 2020 16:51:12 +0000 Received: from localhost ([127.0.0.1]:48342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1itwk8-0006gF-LK for submit@debbugs.gnu.org; Tue, 21 Jan 2020 11:51:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1itwk2-0006fg-JP for 39211@debbugs.gnu.org; Tue, 21 Jan 2020 11:51:06 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1itwjx-000824-6N; Tue, 21 Jan 2020 11:50:57 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=35186 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1itwjw-0006iS-GU; Tue, 21 Jan 2020 11:50:57 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200121032214.1908896-1-rlb@defaultvalue.org> Date: Tue, 21 Jan 2020 17:50:54 +0100 In-Reply-To: <20200121032214.1908896-1-rlb@defaultvalue.org> (Rob Browning's message of "Mon, 20 Jan 2020 21:22:14 -0600") Message-ID: <8736c8da8h.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Rob, Rob Browning skribis: > Even setting aside any security concerns, this caused tests to fail if > you ran them as a given user and then ran them again as another user. Oops, indeed. > It didn't look like we have anything like mkdtemp or I'd have used it > instead. And it looks like this might apply to, and it would be nice > to have something like it on stable-2.2 as well. I thought we had =E2=80=98mkdtemp!=E2=80=99 but it=E2=80=99s just in Guix. = :-/ Well we can go that way for now, perhaps with a FIXME comment suggesting the use of =E2=80=98mkdtemp!=E2=80=99 once it=E2=80=99s available. Also please make sure to include a ChangeLog-style commit log. Apart from that it LGTM! I think we should add =E2=80=98mkdtemp!=E2=80=99 to libguile in a separate = commit; it=E2=80=99s OK to _add_ procedures during a stable release. Thanks, Ludo=E2=80=99. From unknown Sun Jun 22 22:48:01 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Rob Browning Subject: bug#39211: closed (Re: bug#39211: [PATCH 1/1] 00-repl-server.test: don't use fixed path for socket) Message-ID: References: <87o8t9mtkr.fsf@gnu.org> <20200121032214.1908896-1-rlb@defaultvalue.org> X-Gnu-PR-Message: they-closed 39211 X-Gnu-PR-Package: guile X-Gnu-PR-Keywords: patch Reply-To: 39211@debbugs.gnu.org Date: Fri, 06 Mar 2020 14:45:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1583505902-9383-1" This is a multi-part message in MIME format... ------------=_1583505902-9383-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #39211: [PATCH 1/1] 00-repl-server.test: don't use fixed path for socket which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 39211@debbugs.gnu.org. --=20 39211: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D39211 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1583505902-9383-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 39211-done) by debbugs.gnu.org; 6 Mar 2020 14:44:29 +0000 Received: from localhost ([127.0.0.1]:44327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAEDF-0002QE-7r for submit@debbugs.gnu.org; Fri, 06 Mar 2020 09:44:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAEDE-0002Q2-94 for 39211-done@debbugs.gnu.org; Fri, 06 Mar 2020 09:44:28 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jAED9-0005Qm-3A; Fri, 06 Mar 2020 09:44:23 -0500 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60282 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jAED8-0004YT-Me; Fri, 06 Mar 2020 09:44:22 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Rob Browning Subject: Re: bug#39211: [PATCH 1/1] 00-repl-server.test: don't use fixed path for socket References: <20200121032214.1908896-1-rlb@defaultvalue.org> Date: Fri, 06 Mar 2020 15:44:20 +0100 In-Reply-To: <20200121032214.1908896-1-rlb@defaultvalue.org> (Rob Browning's message of "Mon, 20 Jan 2020 21:22:14 -0600") Message-ID: <87o8t9mtkr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39211-done Cc: 39211-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Rob Browning skribis: > Even setting aside any security concerns, this caused tests to fail if > you ran them as a given user and then ran them again as another user. > > --- > > It didn't look like we have anything like mkdtemp or I'd have used it > instead. And it looks like this might apply to, and it would be nice > to have something like it on stable-2.2 as well. > > test-suite/tests/00-repl-server.test | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) I believe what you pushed as ddcab06f20525d975503d8d9611e02021fb0dff1 fixes this issue, so I=E2=80=99m closing it now. Thanks, Ludo=E2=80=99. ------------=_1583505902-9383-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 Jan 2020 03:21:57 +0000 Received: from localhost ([127.0.0.1]:46359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1itk73-0001Xh-Br for submit@debbugs.gnu.org; Mon, 20 Jan 2020 22:21:57 -0500 Received: from lists.gnu.org ([209.51.188.17]:59276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1itk71-0001XZ-9B for submit@debbugs.gnu.org; Mon, 20 Jan 2020 22:21:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54000) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itk70-0005xf-5n for bug-guile@gnu.org; Mon, 20 Jan 2020 22:21:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itk6z-0008Jp-5A for bug-guile@gnu.org; Mon, 20 Jan 2020 22:21:54 -0500 Received: from defaultvalue.org ([45.33.119.55]:58108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1itk6z-0008Iv-0o for bug-guile@gnu.org; Mon, 20 Jan 2020 22:21:53 -0500 Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id 5963D2009C for ; Mon, 20 Jan 2020 21:21:51 -0600 (CST) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 1BF8214E071; Mon, 20 Jan 2020 21:22:14 -0600 (CST) From: Rob Browning To: bug-guile@gnu.org Subject: [PATCH 1/1] 00-repl-server.test: don't use fixed path for socket Date: Mon, 20 Jan 2020 21:22:14 -0600 Message-Id: <20200121032214.1908896-1-rlb@defaultvalue.org> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 45.33.119.55 X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Even setting aside any security concerns, this caused tests to fail if you ran them as a given user and then ran them again as another user. --- It didn't look like we have anything like mkdtemp or I'd have used it instead. And it looks like this might apply to, and it would be nice to have something like it on stable-2.2 as well. test-suite/tests/00-repl-server.test | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test-suite/tests/00-repl-server.test b/test-suite/tests/00-r= epl-server.test index 54f518a66..4324f7371 100644 --- a/test-suite/tests/00-repl-server.test +++ b/test-suite/tests/00-repl-server.test @@ -24,13 +24,25 @@ #:use-module (web request) #:use-module (test-suite lib)) =20 +(define (make-tempdir) + (let loop ((try 0) + (n (random:uniform))) + (let* ((path (string-append "/tmp/repl-server-test-" (number->string= n))) + (dir (false-if-exception (mkdir path #o700)))) + (cond + (dir path) + ((> try 10) + (error "Unable to create directory in /tmp for 00-repl-server.te= st")) + (else (loop (1+ try) (random:uniform))))))) + (define (call-with-repl-server proc) "Set up a REPL server in a separate process and call PROC with a socket connected to that server." - (let ((sockaddr (make-socket-address AF_UNIX "/tmp/repl-server")) - (client-socket (socket AF_UNIX SOCK_STREAM 0))) - (false-if-exception - (delete-file (sockaddr:path sockaddr))) + (let* ((tmpdir (make-tempdir)) + (sockaddr (make-socket-address AF_UNIX (string-append tmpdir "/= repl-server"))) + (client-socket (socket AF_UNIX SOCK_STREAM 0))) + (false-if-exception (delete-file (sockaddr:path sockaddr))) + (false-if-exception (rmdir tmpdir)) =20 ;; The REPL server requires thread. The test requires fork. (unless (and (provided? 'threads) (provided? 'fork)) --=20 2.24.0 ------------=_1583505902-9383-1--