From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 05:58:03 2022 Received: (at submit) by debbugs.gnu.org; 31 Aug 2022 09:58:03 +0000 Received: from localhost ([127.0.0.1]:38232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTKTy-0000qP-PD for submit@debbugs.gnu.org; Wed, 31 Aug 2022 05:58:03 -0400 Received: from lists.gnu.org ([209.51.188.17]:53700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTKTv-0000pw-Ul for submit@debbugs.gnu.org; Wed, 31 Aug 2022 05:58:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTKTv-0005dd-LM for bug-guix@gnu.org; Wed, 31 Aug 2022 05:57:59 -0400 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21124) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTKTt-0002Fb-Uw for bug-guix@gnu.org; Wed, 31 Aug 2022 05:57:59 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1661939875; cv=none; d=zohomail.com; s=zohoarc; b=U6oLZZVZV1D5WPh0aZEy/Pj7IKLN6CDIjiNPdsdgOD3Jv9VIhvKMeUqB3MsiurD/D6f1O2eF/BnAPfuVWX6fFNP2YJHh0E8uOuYRwauzOqR3lp4FTd6wxH8o6HnXVEHnDCEFQFiCA0J3d2xxu1Og56b1O6w3FL0yYPvO3kDvqJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661939875; h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To; bh=gYTX3fxxwWZASCD7Y49W7YdoO2fVEUzZfW28q8Znf1U=; b=NtkT70wve/iPeN3TYjsw3MENDmMUhNjnCT1oKcrLJFFyGHQ5bd7/p0ZeLotGFflag/1Lbv8EzqCPpNdvqt2kwXu1y1IgfHfT27uhNpyHz+2fPteYV0EWgJZBPGyMpaU4qGl1BhfW1DsgQnhtcrgLpnSSP1VJ1n4nkff6j/LroS4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1661939875; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=gYTX3fxxwWZASCD7Y49W7YdoO2fVEUzZfW28q8Znf1U=; b=HTC4Z8rDkIfmR2Eo2Edd22ZyYJEG+OFQ8c3Xi9bByeBDIDSMUA2Q9uv9qzHn3fZZ bX4YJMq61MruTxRDcO2IL1eeOcd9ojrvGUYsWCRMqEp4QR/7Im265Np3VMYBnZ5gozK YBHppK0eu4EPyMRH4BZUCyX8bdjB0ePaeF88YlEk= Received: from localhost (i5E862DD2.versanet.de [94.134.45.210]) by mx.zohomail.com with SMTPS id 1661939874184666.9667178691935; Wed, 31 Aug 2022 02:57:54 -0700 (PDT) User-agent: mu4e 1.8.7; emacs 28.1 From: Ricardo Wurmus To: bug-guix@gnu.org Subject: call-with-file-lock does not remove lock file Date: Wed, 31 Aug 2022 11:50:38 +0200 X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Message-ID: <87v8q8razk.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.51; envelope-from=rekado@elephly.net; helo=sender4-of-o51.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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.3 (--) =E2=80=9Ccall-with-file-lock=E2=80=9D and =E2=80=9Ccall-with-file-lock/no-w= ait=E2=80=9D create a lock file but don=E2=80=99t remove the lock file when they exit. (guix build syscalls) defines these procedures with =E2=80=9Cdynamic-wind= =E2=80=9D so that the lock is always lifted with =E2=80=9Cunlock-file=E2=80=9D. While = =E2=80=9Cunlock-file=E2=80=9D uses the fcntl syscall to remove the lock on the file, the lock file itself is not deleted. I think it should be deleted. When the lock file sticks around we may run into problems due to lock file ownership. For example, imagine a cron job running as a different user that upgrades the contents of a user profile. That cron job would leave behind an unlocked lock file owned by that user, preventing the owner of the profile from operating on the profile even though the lock has already been lifted with =E2=80=9Cunlock-file=E2=80=9D. I propose letting either unlock-file or with-profile-lock delete the lock file. --=20 Ricardo From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 11 19:52:50 2023 Received: (at 57501-done) by debbugs.gnu.org; 12 Feb 2023 00:52:50 +0000 Received: from localhost ([127.0.0.1]:43598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR0bp-0001PK-UD for submit@debbugs.gnu.org; Sat, 11 Feb 2023 19:52:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR0bm-0001Os-Om for 57501-done@debbugs.gnu.org; Sat, 11 Feb 2023 19:52:47 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pR0bh-0007WJ-5S; Sat, 11 Feb 2023 19:52:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=NKxb1RcDQrXm8+FzHN5oVL/hkiaQ2XZAe8kOUzINQdo=; b=mr9MGEM3UdN3PCKiNP2k eMv+i7tdBWy/YcHpawXC/859CFHSjaq9yHukGYXhXzQXiuGnwHNHNKnCaR4eDMauACR7LfQy/WVrJ WOHE0k/2tvJceWnlmH1dY1sEyQyglwArEKF3Mcacoaw1rz3XnYm9iIzcJ2VnZMahYZr1WvNKdEHUp j6beInH3dnBhObQwHc2ofeBQYH6BeD0towwVIl/Br1s1+y51F6VCQkEK+0uBC/FYNRx53i/wxLyn5 XcmXhcnuSRc85u7PTsiQH+sXIkVg1HB+ltEAxPSsam7aUv9Pqqho7W/mDZ/T/COprfbgflTMZFKsK +9kqgaSAUfZlYw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pR0bg-0002P0-HJ; Sat, 11 Feb 2023 19:52:40 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Ricardo Wurmus Subject: Re: bug#57501: call-with-file-lock does not remove lock file References: <87v8q8razk.fsf@elephly.net> Date: Sun, 12 Feb 2023 01:52:36 +0100 In-Reply-To: <87v8q8razk.fsf@elephly.net> (Ricardo Wurmus's message of "Wed, 31 Aug 2022 11:50:38 +0200") Message-ID: <87y1p3ln6z.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57501-done Cc: 57501-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: -3.3 (---) Ricardo Wurmus skribis: > =E2=80=9Ccall-with-file-lock=E2=80=9D and =E2=80=9Ccall-with-file-lock/no= -wait=E2=80=9D create a lock > file but don=E2=80=99t remove the lock file when they exit. > > (guix build syscalls) defines these procedures with =E2=80=9Cdynamic-wind= =E2=80=9D so > that the lock is always lifted with =E2=80=9Cunlock-file=E2=80=9D. While= =E2=80=9Cunlock-file=E2=80=9D > uses the fcntl syscall to remove the lock on the file, the lock file > itself is not deleted. > > I think it should be deleted. When the lock file sticks around we may > run into problems due to lock file ownership. For example, imagine a > cron job running as a different user that upgrades the contents of a > user profile. That cron job would leave behind an unlocked lock file > owned by that user, preventing the owner of the profile from operating > on the profile even though the lock has already been lifted with > =E2=80=9Cunlock-file=E2=80=9D. > > I propose letting either unlock-file or with-profile-lock delete the > lock file. Agreed. Done in a68229b9a0f450db622511adfe00ff7307d745d3, thanks! Ludo=E2=80=99. From unknown Mon Aug 18 11:25:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 12 Mar 2023 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator