Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 408213 - sys-apps/sed[selinux] should depend on sys-libs/libselinux
Summary: sys-apps/sed[selinux] should depend on sys-libs/libselinux
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 498352 (view as bug list)
Depends on:
Blocks: 588162
  Show dependency tree
 
Reported: 2012-03-14 20:55 UTC by Markus Knetschke
Modified: 2016-07-17 14:45 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Knetschke 2012-03-14 20:55:07 UTC
sys-apps/sed with activated selinux use flag needs libselinux as build dependency.

Reproducible: Always

Steps to Reproduce:
1. remove libselinux
2. try to emerge sys-apps/sed with selinux use flag
3. emerge fails in build phase
Actual Results:  
emerge fails with: "execute.c:35:29: schwerwiegender Fehler: selinux/selinux.h: Datei oder Verzeichnis nicht gefunden"

Expected Results:  
emerge merges sys-libs/libselinux as dependency before merging sys-apps/sed[selinux]
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2012-03-15 01:38:26 UTC
done.  however I'm not sure if sys-apps/sed should have USE="build" now for:

sed/execute.c:

#ifndef BOOTSTRAP
#include <selinux/selinux.h>
#include <selinux/context.h>
#endif

but I guess we'll find that out.
Comment 2 SpanKY gentoo-dev 2012-03-19 00:57:06 UTC
the sed buildsystem creates local dummy selinux headers with stub funcs so the includes work even when selinux isn't available
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2012-03-19 11:01:07 UTC
reverted the dep addition. indeed, m4/selinux-selinux-h.m4 should work. 

then we will need build.log and config.log attached here to find out why it isn't working.

emerge --info missing too.
Comment 4 SpanKY gentoo-dev 2012-04-21 05:47:26 UTC
(In reply to comment #3)

i think depending on libselinux on selinux systems is fine -- after all, they'll use the library, so we should make sure it's available to build+link against
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2014-01-17 15:59:23 UTC
*** Bug 498352 has been marked as a duplicate of this bug. ***
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2014-01-17 16:02:08 UTC
Reopen for Comment #4 and bug 498352 for re-evaluation
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2014-01-20 19:36:10 UTC
Yes; on SELinux systems sed is built with libselinux support:

$ scanelf -n /bin/sed 
 TYPE   NEEDED FILE 
ET_DYN libselinux.so.1,libc.so.6 /bin/sed 

The SELinux support is to make sure that the context of the file it's editing is retained (which is needed if editing a file is done by creating a new file and moving it in place of the old file, as new files inherit contexts from the parent directory which might not be wanted).
Comment 8 SpanKY gentoo-dev 2014-01-20 22:54:28 UTC
should be all set now in the tree; thanks for the report!

Commit message: Depend on libselinux when USE=selinux
http://sources.gentoo.org/sys-apps/sed/sed-4.2.2.ebuild?r1=1.3&r2=1.4
Comment 9 Pariksheet Nanda 2016-07-05 13:34:10 UTC
Can we please also add sys-libs/libselinux conditional dependency to for sys-apps/sed-4.2.1-r1?  sys-apps/sed-4.2.2 is currently unstable on amd64 and, Markus' original report still affects that older version of sed; namely, rebuilding sys-apps/sed-4.2.1-r1 with selinux USE flag after switching to a hardened/linux/amd64/selinux profile fails without libselinux:

execute.c:35:29: fatal error: selinux/selinux.h: No such file or directory
 #include <selinux/selinux.h>
                             ^
Comment 10 SpanKY gentoo-dev 2016-07-17 14:45:56 UTC
(In reply to Pariksheet Nanda from comment #9)

i don't see value in that.  the new version will go stable eventually.