From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id OF8zK8LeeGYxJAAAe85BDQ:P1 (envelope-from ) for ; Mon, 24 Jun 2024 02:49:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id OF8zK8LeeGYxJAAAe85BDQ (envelope-from ) for ; Mon, 24 Jun 2024 04:49:38 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=BSbIwJ8V; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1719197378; 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:resent-to: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=IU4yLMv4tJM2YiVBZ4QSz1w+TYkZj7ZCsDA6C85zg0s=; b=sBDxQW6qQYfL7BCNPdmulYR5VRZrrCXXN6e3jYpuyVKJWavpsp8pxfMrYfNXQzxUM9Ajlg PEYF9kAifeONZADjlft5y3CXvrRffEwfGKeQUAqnN4uXe8DSbQnP+L9MsitwrbPppuzWaL qtdYqQ6+EzP0+GdUyufR00nnkPjDDUFn4BPb11NgDyID0QmflL4I49qk+G5+735LwTiw2t 1QCtlGwAIauEiBV5VmYVK7wstA3lYE5/0cZBC8an/CXNQEoAKiw2NaZCk/tuG40M3UrxXg RXYtT6nxbZG0lGAI95GHtDlN6t9EpIkc3/LFJYd7gStUfiyjFizmVuqq1QEK3w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=BSbIwJ8V; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719197378; a=rsa-sha256; cv=none; b=FA5TPB4oaPT8j+nuSR7BHwzoK6s78u9/S4uYNMn//k/PpQ9J1LYNaEAvRGxl+AUHF4xuLd 8GKGBThiDYbJJQJQlzJgGpFhgV3OSU7JKDZxkJuqJ8a/zbiz2swySYiI57RfgaWEQnGam+ L6lhbXhg+loAZ2cg7lQ4KN0gvfPBalMyLjKbIaKjs1tXE/q8hJQsAcY4d7L0MRAuILv2ez 839r34ESd+Q7mL10olcu+NKJq2b+p4b/OHQJCkRtDjqCUPzv++XQhwNGjiqOMnV+XjfD/J rsPmGKSP8YKMjLme/G7QLNzkyCd4LTgaQEjFo2APR9IViu+kq+vdS1NukCWxXg== 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 65373524D4 for ; Mon, 24 Jun 2024 04:49:38 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLZlP-0006F9-Kp; Sun, 23 Jun 2024 22:49:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLZlO-0006ER-6H for bug-guix@gnu.org; Sun, 23 Jun 2024 22:49:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLZlN-0002Oa-UC for bug-guix@gnu.org; Sun, 23 Jun 2024 22:49:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLZlO-0004uj-Jt for bug-guix@gnu.org; Sun, 23 Jun 2024 22:49:02 -0400 Subject: bug#71352: branch master updated: services: nix: Mount Nix store read only. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-To: bug-guix@gnu.org Resent-Date: Mon, 24 Jun 2024 02:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 71352 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Oleg Pykhalov Cc: 71352-done@debbugs.gnu.org Mail-Followup-To: 71352@debbugs.gnu.org, maxim.cournoyer@gmail.com, maxim.cournoyer@gmail.com Received: via spool by 71352-done@debbugs.gnu.org id=D71352.171919732418854 (code D ref 71352); Mon, 24 Jun 2024 02:49:02 +0000 Received: (at 71352-done) by debbugs.gnu.org; 24 Jun 2024 02:48:44 +0000 Received: from localhost ([127.0.0.1]:34662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLZl6-0004u1-0D for submit@debbugs.gnu.org; Sun, 23 Jun 2024 22:48:44 -0400 Received: from mail-qt1-f173.google.com ([209.85.160.173]:46502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLZl3-0004tm-OH for 71352-done@debbugs.gnu.org; Sun, 23 Jun 2024 22:48:42 -0400 Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-444c0d2d503so15879941cf.1 for <71352-done@debbugs.gnu.org>; Sun, 23 Jun 2024 19:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719197254; x=1719802054; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IU4yLMv4tJM2YiVBZ4QSz1w+TYkZj7ZCsDA6C85zg0s=; b=BSbIwJ8V6Qcx2n4DGwvqrVpa1ms9qN9eb8g+1dGizSw4xun/006QKAqQ810+BpBfL/ 6D8JZK7JC8lIA/bbIKBv6VRxWjyriAnNftV4WZU+BuIBcKG91P3/cwouRqQNm8BXTONN n+mcAaPdvqrjz4B19MTIJez7JQTQNG/i7facJcE2lHoDxMbtaSMxJN7JNKx97lvo5RTd QIiksLadeckOmXS9SWUaNDE9sKB0I/PiTyqibUROQh3ZX23q4Ul4EZPyC7FAEf9csQLO eJF5egJH04D2K+c5NKFCUxSmtq8OAppqJ2raCbZQ9szarnwnrOrILbbU+IGjRWTuo2kZ IMLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719197254; x=1719802054; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IU4yLMv4tJM2YiVBZ4QSz1w+TYkZj7ZCsDA6C85zg0s=; b=dp8B5tjn8GyX22Hr5jnHyyYy5q2dsYwVwtkEkN769cf0voc7ePa3oB4uoa4a6gsHVy NnTj/qyZP/PqCjkAxml+wb0gWjoYP6t1vSpAuSDPktu30CgM+etxNkY0E/n9XJZ/TzSP l65cuge4RjNDX0DHgd+QQ9cE5HNzUDAuASNMthRcjs/A8hcv93chOmjx3dqaCpSTp3sH nm4osKFkvx9L+x4YnuCQygTOMdXg2gBQMgOj6exFApE/BzkHoptLLXXW05CqygHXrb+V 5/lpzJurugOco7kED3hS1iss2QKEhT9OuVW6feBAu0talUZHNoIaaxOQe/gkbZqCcMJe rYyQ== X-Gm-Message-State: AOJu0YzULlvugM1tNKfNIPe12kE4DP+lK8EsNTf4D7OnoF93Fv7xpXbp svS5RnBXX24Zss6jqJCMdaTHKo0HaQIjE0f+9fKzF3Emew67VP9ygIvLmpwsLEQ= X-Google-Smtp-Source: AGHT+IF4enFnTl7Rybm5ZCdz+ycqbtWa9bCOIwARYTAddCt8oEVhiZu/o32KyHZgQz7GCapC3dWnZQ== X-Received: by 2002:a05:622a:108:b0:441:569f:7065 with SMTP id d75a77b69052e-444d657b92amr43864191cf.58.1719197254499; Sun, 23 Jun 2024 19:47:34 -0700 (PDT) Received: from hurd (dsl-205-233-124-241.b2b2c.ca. [205.233.124.241]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-444e35fa975sm6657101cf.31.2024.06.23.19.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jun 2024 19:47:34 -0700 (PDT) From: Maxim Cournoyer In-Reply-To: <87tti625fu.fsf@gmail.com> (Maxim Cournoyer's message of "Wed, 05 Jun 2024 22:03:33 -0400") References: <171695309234.24183.12881718488458327568@vcs2.savannah.gnu.org> <87o78hv3k4.fsf@gmail.com> <877cf5gl7z.fsf@gmail.com> <87tti625fu.fsf@gmail.com> Date: Sun, 23 Jun 2024 22:47:33 -0400 Message-ID: <87h6dj6oqi.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 65373524D4 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -5.26 X-Spam-Score: -5.26 X-TUID: +iPeXHZ3MKoP Hi Oleg, Maxim Cournoyer writes: > Hi Oleg, > > [...] > >>> Are these chown still useful in the activation snippet? >>> >>> (define (nix-activation _) >>> ;; Return the activation gexp. >>> #~(begin >>> (use-modules (guix build utils) >>> (srfi srfi-26)) >>> (for-each (cut mkdir-p <>) '("/nix/store" "/nix/var/log" >>> "/nix/var/nix/gcroots/per-user" >>> "/nix/var/nix/profiles/per-user")) >>> (chown "/nix/store" >>> (passwd:uid (getpw "root")) (group:gid (getpw "nixbld01"))) >>> (chmod "/nix/store" #o775) >>> (for-each (cut chmod <> #o777) '("/nix/var/nix/profiles" >>> "/nix/var/nix/profiles/per-user"= )))) >>> >>> If they are useful only on the first time, perhaps we could catch the >>> exceptions for when it runs on an already read-only mounted /nix/store? >> >> Indeed, it is a good idea. >> >> A hotfix for the issue was discussed and implemented. It has already >> been pushed to the master branch. The fix involves a simple >> 'file-exists?' check. You can find more details in the discussion at >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D71320 >> >> What do you think is preferable in this scenario =E2=80=93 catching exce= ptions >> or sticking with '(unless (file-exists? ...))'? Your thoughts on the >> best approach here? > > Exceptions are usually better than 'check then do' as they avoid the > TOCTTOU (time-of-check to time-of-use) class of bugs/vulnerabilities. I'm closing this for now; I'm satisfied that working order has been restored :-). --=20 Thanks, Maxim