From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YJ83LfG3SGA1fgAA0tVLHw (envelope-from ) for ; Wed, 10 Mar 2021 12:13:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uBUsKfG3SGCaXwAA1q6Kng (envelope-from ) for ; Wed, 10 Mar 2021 12:13:37 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 46DC8100BD for ; Wed, 10 Mar 2021 13:13:37 +0100 (CET) Received: from localhost ([::1]:51254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJxiZ-0004t1-I1 for larch@yhetil.org; Wed, 10 Mar 2021 07:13:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJxi9-0004st-E1 for guix-devel@gnu.org; Wed, 10 Mar 2021 07:13:09 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59971) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJxi8-0004UF-PN; Wed, 10 Mar 2021 07:13:08 -0500 Received: from [2a01:e0a:19b:d9a0:c4bd:335d:6b08:e2bd] (port=42002 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lJxi8-0007mb-02; Wed, 10 Mar 2021 07:13:08 -0500 From: Mathieu Othacehe To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: 05/07: inferior: Fix concurrent cached-profile calls. References: <20210310075017.12619.72665@vcs0.savannah.gnu.org> <20210310075020.CC605211CF@vcs0.savannah.gnu.org> <87blbr7316.fsf@gnu.org> Date: Wed, 10 Mar 2021 13:13:05 +0100 In-Reply-To: <87blbr7316.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 10 Mar 2021 10:48:21 +0100") Message-ID: <87r1kn4372.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615378417; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=pmmObIJ2Kvoy3cHbo41WTvXhb7O11EJyjEDoBiJ7EfQ=; b=kjM1vNNTMrP9cmRRbcRH3D9Aurn2eA2H70HWKt48CdBoNlgDZYKLEJ+ZlqB3lFv8IsycBD oZf6c+FSWBxjTk6bJyPBCu+otlR4K3555VPruQW6uvTPGFavM8na4clDVjVAhwJikbWvkG 31Ck5Z0ddR7GqSeqk8c8IQlkZWAUzVvnZ3LyNlTQ0cvGOQvSU3BwMnViSTHFFyW/nnpexf r/K8N7mJfHuh1QHOsK4D+aThGsoFNH0EUTjAtc9ibnmhcXOKlKmdplbFWk8xTmjGHpWdnt ZLHl4r3F980zWugn4u8qaPR6ih/vOGmiXRcPlvZa7hc7VWTzP3VUByLJR0KHAA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615378417; a=rsa-sha256; cv=none; b=XNwMikbOr4merkq8Br9HM8BhT7glieucOL7Nt8X1d7nXx7IyyEcDo9J7RI5TMz/ZN11Q1v cX6TuizAnEdvgwIwqcdEbKzBCCd69YB2g84RcJdwGaGV38YKhjLhTKDgI4yORlhvx6GWN5 fvaiWXpKN5O/JlNJHA8/xqfmkn2CYBzu15IC/GBt49tsUjDwUeI1O/M4+ZxegVzWDJfefN Abwor3GUH91YByDH+b5SH4cOtHHLHg9NIqLO/7uIR9Cm6sTl/W8q+Csq4t6YM4FpvZcIf1 Dj8BSCfeY6cKwBJ8EoxGUVm+vQH7is1kyNZoyGMbNRi6I5lMj3Aga1bsGGlUTw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -2.89 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 46DC8100BD X-Spam-Score: -2.89 X-Migadu-Scanner: scn0.migadu.com X-TUID: elZ5kNaM/4oK Hey Ludo, > However, there=E2=80=99s already a (file-exists? cached) call a few lines > above. So what you need instead is a TOCTTOU-free =E2=80=98symlink=E2=80= =99, along > these lines: > > (define (symlink/safe old new) > (catch 'system-error > (lambda () > (symlink old new)) > (lambda args > (unless (=3D EEXIST (system-error-errno args)) > (apply throw args))))) > > ;; =E2=80=A6 > > (define symlink* > (lift2 symlink/safe %store-monad)) > > WDYT? Fixed with a831ff6bc3f92ab4ecf6135e4d6386f14189ad06. Thanks, Mathieu