Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274239 - sys-apps/sandbox-2.0 fails to compile due to /selinux/context violations
Summary: sys-apps/sandbox-2.0 fails to compile due to /selinux/context violations
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-15 15:18 UTC by Peter Waller
Modified: 2011-07-22 10:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (buildlog,144.02 KB, text/plain)
2009-06-15 15:18 UTC, Peter Waller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Waller 2009-06-15 15:18:20 UTC
See attached build.log

the latest portage currently depends on sandbox >=1.6, which are currently all masked. I tried sandbox-2.0 and it failed to compile with the message:

*** Warning: Linking the shared library libsandbox.la against the
*** static library ../libsbutil/.libs/libsbutil.a is not portable!
libtool: link: i686-pc-linux-gnu-gcc -shared  .libs/libsandbox_la-eqawarn.o .libs/libsandbox_la-libsandbox.o .libs/libsandbox_la-lock.o .libs/libsandbox_la-memory.o .libs/libsandbox_la-trace.o .libs/libsandbox_la-wrappers.o .libs/libsandbox_la-canonicalize.o   -lc -ldl ../libsbutil/.libs/libsbutil.a  -Wl,--version-script -Wl,libsandbox.map -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--no-undefined   -Wl,-soname -Wl,libsandbox.so -o .libs/libsandbox.so
.libs/libsandbox_la-trace.o: In function `trace_main':
trace.c:(.text.trace_main+0xde): undefined reference to `sb_unlinkat_pre_check'
/data/pwaller/gentoo/usr/lib/gcc/i686-pc-linux-gnu/4.2.4/../../../../i686-pc-linux-gnu/bin/ld: .libs/libsandbox_la-trace.o: relocation R_386_GOTOFF against undefined symbol `sb_unlinkat_pre_check' can not be used when making a shared object
/data/pwaller/gentoo/usr/lib/gcc/i686-pc-linux-gnu/4.2.4/../../../../i686-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libsandbox.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Comment 1 Peter Waller 2009-06-15 15:18:47 UTC
Created attachment 194792 [details]
build.log
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-06-15 15:52:59 UTC
The lastest stable version is sys-apps/sandbox-1.6-r2 as can be seen here:

http://packages.gentoo.org/package/sys-apps/sandbox
Comment 3 Fabian Groffen gentoo-dev 2009-06-15 15:55:38 UTC
we either have to drop sandbox in prefix, or fix it voodoo style
Comment 4 Peter Waller 2009-06-15 15:59:45 UTC
(In reply to comment #2)
> The lastest stable version is sys-apps/sandbox-1.6-r2 as can be seen here:
> 
> http://packages.gentoo.org/package/sys-apps/sandbox
> 

Indeed, but 1.6 isn't in prefix, and the latest portage seems to require it.
Comment 5 Fabian Groffen gentoo-dev 2009-06-15 17:58:36 UTC
I added 1.6-r2 now, with some luck...
Comment 6 Fabian Groffen gentoo-dev 2009-06-19 19:54:03 UTC
@Peter: what linux are you on?
Comment 7 Peter Waller 2009-06-19 20:05:04 UTC
(In reply to comment #6)
> @Peter: what linux are you on?

Scientific Linux 4, a derivative of RHEL (4?). 32bit.
Comment 8 Michael Haubenwallner (RETIRED) gentoo-dev 2009-06-26 15:32:56 UTC
I'm bootstrapping a prefix with sandbox-2.0 on "Red Hat Enterprise Linux Server release 5.2 (Tikanga)", and had to add this to EPREFIX/etc/sandbox.conf to get things working:

+# Needed for selinux
+SANDBOX_WRITE="/selinux:/proc/self/task"

Looking at the error again it might have been enough to add "/selinux/context" though...
Comment 9 SpanKY gentoo-dev 2009-06-26 16:36:04 UTC
i dont know anything about selinux, but if libselinux really needs applications to screw around with /selinux/context, then that libselinux should be updated to install a sandbox.d file.
Comment 10 Michael Haubenwallner (RETIRED) gentoo-dev 2009-07-03 11:51:43 UTC
Well, libselinux isn't installed within Prefix (yet?), it is from the host system. So we either need to add /selinux/context in Prefix somehow, or sandbox knows itself. Maybe due to some configure check ("checking for selinux": test -d /selinux), although IMHO it shouldn't hurt to "addwrite /selinux/context" unconditional.
Comment 11 SpanKY gentoo-dev 2009-10-26 07:19:55 UTC
i really dont want to add special casing for selinux to sandbox.  i spent time getting all the special casing out.

if you have selinux up & running on your system, doesnt it make sense to include libselinux in the prefix too ?

a `test -d /...` would defeat cross-compiling and similar scenarios ... so it would have to be added all the time
Comment 12 Chris PeBenito (RETIRED) gentoo-dev 2009-12-16 15:17:19 UTC
I'm coming in on this way late, but it is fine to allow write in /selinux since this is SELinux's pseudo filesystem (you can't create new files) which is strongly protected by policy.  I don't have a problem allowing /selinux/context across the board for sandbox because of that.  So if it helps I can add a sandbox.d entry to the gentoo libselinux package.  (I'm not familiar with prefix, so please excuse me if I'm off base)
Comment 13 Fabian Groffen gentoo-dev 2010-07-09 20:21:19 UTC
I think this issue no longer exists with recent versions