summaryrefslogtreecommitdiff
blob: 5e32912f6b198fdbc90bc1bfc8dc144c8cfd24c0 (plain)
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
36
37
* heiko's way of getting this thing going
http://repo.or.cz/w/heikos-i-prolly-break-your-prefix-overlay.git?a=blob;f=sys-apps/sandbox/files/sandbox-2.0-prefix.patch;h=7b4f568679522682ba784853829a0f2b1272b21d;hb=HEAD

diff --git a/libsbutil/get_sandbox_lib.c b/libsbutil/get_sandbox_lib.c
index b64a5ac..1cf4832 100644
--- a/libsbutil/get_sandbox_lib.c
+++ b/libsbutil/get_sandbox_lib.c
@@ -22,6 +22,7 @@
 void get_sandbox_lib(char *path)
 {
 	save_errno();
+#ifndef GENTOO_PREFIX
 	strcpy(path, LIB_NAME);
 	if (strncmp("/usr/lib", LIBSANDBOX_PATH, 8)) {
 		void *hndl = dlopen(path, RTLD_LAZY);
@@ -30,5 +31,10 @@ void get_sandbox_lib(char *path)
 		else
 			dlclose(hndl);
 	}
+#else
+	/* Gentoo Prefix always needs the absolute path due to DT_R*PATH usage
+	 * within dlopen(). */
+	snprintf(path, SB_PATH_MAX, "%s/%s", LIBSANDBOX_PATH, LIB_NAME);
+#endif
 	restore_errno();
 }
--- a/etc/sandbox.d/00default.orig	2009-06-22 14:10:30.000000000 +0200
+++ a/etc/sandbox.d/00default	2009-06-22 14:11:41.000000000 +0200
@@ -14,7 +14,7 @@
 # Finally add current directory if interactive
 SANDBOX_WRITE="${SANDBOX_WORKDIR}"
 # Needed for configure tests
-SANDBOX_WRITE="/usr/tmp/conftest:/usr/lib/conftest:/usr/lib32/conftest:/usr/lib64/conftest:/usr/tmp/cf:/usr/lib/cf:/usr/lib32/cf:/usr/lib64/cf"
+SANDBOX_WRITE="@GENTOO_PORTAGE_EPREFIX@/usr/tmp/conftest:@GENTOO_PORTAGE_EPREFIX@/usr/lib/conftest:@GENTOO_PORTAGE_EPREFIX@/usr/lib32/conftest:@GENTOO_PORTAGE_EPREFIX@/usr/lib64/conftest:@GENTOO_PORTAGE_EPREFIX@/usr/tmp/cf:@GENTOO_PORTAGE_EPREFIX@/usr/lib/cf:@GENTOO_PORTAGE_EPREFIX@/usr/lib32/cf:@GENTOO_PORTAGE_EPREFIX@/usr/lib64/cf"
 
 # Usually writes in /home should not cause violations
 SANDBOX_PREDICT="${HOME}"