From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WMrfEXPaX2IFGwAAbAwnHQ (envelope-from ) for ; Wed, 20 Apr 2022 12:03:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UE37EXPaX2K0lQAA9RJhRA (envelope-from ) for ; Wed, 20 Apr 2022 12:03:31 +0200 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 CF9F223E8A for ; Wed, 20 Apr 2022 12:03:30 +0200 (CEST) Received: from localhost ([::1]:55056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nh7BJ-00082P-A5 for larch@yhetil.org; Wed, 20 Apr 2022 06:03:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nh7As-000821-57 for guix-patches@gnu.org; Wed, 20 Apr 2022 06:03:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nh7Ar-0001u5-Sb for guix-patches@gnu.org; Wed, 20 Apr 2022 06:03:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nh7Ar-0007oH-O0 for guix-patches@gnu.org; Wed, 20 Apr 2022 06:03:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55034] [PATCH 0/1] Let openssh trust /gnu/store Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 20 Apr 2022 10:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55034 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Alexey Abramov Cc: 55034@debbugs.gnu.org Received: via spool by 55034-submit@debbugs.gnu.org id=B55034.165044894429966 (code B ref 55034); Wed, 20 Apr 2022 10:03:01 +0000 Received: (at 55034) by debbugs.gnu.org; 20 Apr 2022 10:02:24 +0000 Received: from localhost ([127.0.0.1]:45121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nh7AG-0007nG-8e for submit@debbugs.gnu.org; Wed, 20 Apr 2022 06:02:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nh7AE-0007n1-8T for 55034@debbugs.gnu.org; Wed, 20 Apr 2022 06:02:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nh7A8-0001p7-V1; Wed, 20 Apr 2022 06:02:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=2c721BPXPMhwxP9/vPmS/+BUXq8C+OAFdgsvVQUIzU0=; b=jDBpVWoF5WSLOQG7VH4Y kcXkHhhfn0oMo3qOXlBLqH21k5rxMf7+Hg99CTtaaG3BXIX9BLbNQdvIwLpNd27htMI7j3X963FHV NXxD8M2kSzMXe+QgpkhEs9SoaW5uNSaASd4gnLThH/jxDpQX9Eb5WdYgNOc5UOrwrjiSLoTRfPhGX f+QpJXZ2rH9eidaJcSnLdRo0otD+Uxj1Od/vU5i8LQMqyoMFmT+qgqPLCEGGGpOLQrK1HXq12RkVU 2+vwoV1YXcB4AWBlLwvhPm+yr7zeDZ7p5+ZAgTubH6gtCT7aScdtspqhM/H4YQYcK0Dqak3QCGWAQ nS9YnVjbghM1Jw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:60157 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nh7A6-0005jJ-Ix; Wed, 20 Apr 2022 06:02:16 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <20220420084913.4113-1-levenson@mmer.org> (Alexey Abramov's message of "Wed, 20 Apr 2022 10:49:13 +0200") References: <20220420084724.3514-1-levenson@mmer.org> <20220420084913.4113-1-levenson@mmer.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Date: Wed, 20 Apr 2022 12:02:12 +0200 Message-ID: <8735i8oyxn.fsf_-_@gnu.org> 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: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650449010; 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-cc: 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=2c721BPXPMhwxP9/vPmS/+BUXq8C+OAFdgsvVQUIzU0=; b=io6L1Yw3DD6PrcWkVAQvjW8uOf2ar8uAcUHT7r73ncnCm8Rh1Mhi2sQwwSCRaK1UjSpxSr 0O1NY13P+1ZjrcmAkf4R3WPTLzHIPpW4dCOZXV88zctXSNiS9Hh48ZXsR/R7jAWsn+bxVY nr8jzmqaCJukclUQPy2/Ojjl0MQWbI9fgoURQuVH5dmZeAVKb/rCNif6WP73w+/FbWwhR/ NpwXWjh+GMtF5jAuad+fnOsyDRMF5OcRE9d8qmd0mopOjxeEMzHk2+NZBw5p1JSL2l46UQ EBAd/n6cKfRpoFG8shg02ivxDR+/j6wuDrULoJdjCkXAhyxLg75YuX+NFXYtlQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650449010; a=rsa-sha256; cv=none; b=Lzddls6z5t4GISIroKfNVTNzYvM16tW/uF777MOatvZJULU7nRM2cEss1MS8rySC+uBJlX Fi572H+12LisRhYVRIKUnKQ2D9ulKMnjk5QQ409bKhQ90+YCPIAXhEbH1vLA/45/bNaopl syd12mWETeotrJ47jbnnX9rOgiN5AP3+BUDdDA4w9kFUAk9xXn+zwAkIMrvIh53imuSHQ5 ueW62SCecbZ3qxKY9KqO9Tj3GV3DLHOhD292UfU4xzAEeRRRRj1SM+gja1WeQvgL8nf5ZM xJPFpT9AayFuGEC2bvnk8MYMSH1RANR2dH5Ksoh6OwtbJMZHp68tZhHeER3MHg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=jDBpVWoF; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=jDBpVWoF; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CF9F223E8A X-Spam-Score: -3.44 X-Migadu-Scanner: scn1.migadu.com X-TUID: hFZFuGNe7pei Alexey Abramov skribis: > + safe_path(const char *name, struct stat *stp, const char *pw_dir, > + uid_t uid, char *err, size_t errlen) > + { > ++ static const char gnu_store[] =3D "/gnu/store"; > + char buf[PATH_MAX], homedir[PATH_MAX]; > + char *cp; > + int comparehome =3D 0; > +@@ -2178,6 +2179,10 @@ safe_path(const char *name, struct stat *stp, con= st char *pw_dir, > + } > + strlcpy(buf, cp, sizeof(buf)); > +=20 > ++ /* If are past the Guix /gnu/store then we can stop */ > ++ if (strcmp(gnu_store, buf) =3D=3D 0) > ++ break; We should not hard-code =E2=80=9C/gnu/store=E2=80=9D because it can be some= thing else. I think you can do like what =E2=80=98gcc-dl-cache.patch=E2=80=99 does: rep= lace the literal "/gnu/store" by @STORE_DIRECTORY@, and substitute it in a phase. Also note that the strcmp above is incorrect: it would accept /gnu/storesomethinglese. You probably need to add a trailing slash to be sure. Thanks, Ludo=E2=80=99.