all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob b50dc8fd6a1e29e6620e5a2317e1e4f3d657201f 984 bytes (raw)
name: gnu/packages/patches/openssh-trust-gnu-store-directory.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 
From a840e4b10961fb2b1b6b0f93e5b2b367887ed691 Mon Sep 17 00:00:00 2001
From: Alexey Abramov <levenson@mmer.org>
Date: Sun, 21 Nov 2021 12:21:28 +0100
Subject: [PATCH] Trust /gnu/store directory

---
 misc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/misc.c b/misc.c
index 0134d69..01f1660 100644
--- a/misc.c
+++ b/misc.c
@@ -2146,6 +2146,7 @@ int
 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[] = "/gnu/store";
 	char buf[PATH_MAX], homedir[PATH_MAX];
 	char *cp;
 	int comparehome = 0;
@@ -2178,6 +2179,10 @@ safe_path(const char *name, struct stat *stp, const char *pw_dir,
 		}
 		strlcpy(buf, cp, sizeof(buf));
 
+		/* If are past the Guix /gnu/store then we can stop */
+		if (strcmp(gnu_store, buf) == 0)
+			break;
+
 		if (stat(buf, &st) == -1 ||
 		    (!platform_sys_dir_uid(st.st_uid) && st.st_uid != uid) ||
 		    (st.st_mode & 022) != 0) {
-- 
2.33.1


debug log:

solving b50dc8fd6a ...
found b50dc8fd6a in https://yhetil.org/guix/20220420084913.4113-1-levenson@mmer.org/

applying [1/1] https://yhetil.org/guix/20220420084913.4113-1-levenson@mmer.org/
diff --git a/gnu/packages/patches/openssh-trust-gnu-store-directory.patch b/gnu/packages/patches/openssh-trust-gnu-store-directory.patch
new file mode 100644
index 0000000000..b50dc8fd6a

1:25: space before tab in indent.
 	char buf[PATH_MAX], homedir[PATH_MAX];
1:26: space before tab in indent.
 	char *cp;
1:27: space before tab in indent.
 	int comparehome = 0;
1:29: space before tab in indent.
 		}
1:30: space before tab in indent.
 		strlcpy(buf, cp, sizeof(buf));
Checking patch gnu/packages/patches/openssh-trust-gnu-store-directory.patch...
Applied patch gnu/packages/patches/openssh-trust-gnu-store-directory.patch cleanly.
warning: squelched 6 whitespace errors
warning: 11 lines add whitespace errors.

index at:
100644 b50dc8fd6a1e29e6620e5a2317e1e4f3d657201f	gnu/packages/patches/openssh-trust-gnu-store-directory.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.