On 12/05/2012 01:03 PM, Radzykewycz, T (Radzy) wrote:
Hi folks

I cloned a new 4.0.4 tree recently, but when I try to build it, I get the 
following error:

system/core/init/init.c: In function 'selinux_load_policy':
system/core/init/init.c:851: error: 'SELINUXMNT' undeclared (first use in this 
function)
system/core/init/init.c:851: error: (Each undeclared identifier is reported 
only once
system/core/init/init.c:851: error: for each function it appears in.)

From system/ I tried grepping for it:

find . \( -name .repo -prune \) -o \( -name .git -prune \) -o \( -exec egrep 
"SELINUXMNT" {} /dev/null \\\; \)
./core/init/init.c:    mkdir(SELINUXMNT, 0755);
./core/init/init.c:    if (mount("selinuxfs", SELINUXMNT, "selinuxfs", 0, 
NULL)) {
./core/init/init.c:    set_selinuxmnt(SELINUXMNT);

So it isn't defined there.  I tried re-cloning system/core, but I get the same 
results.  I checked the 4.2 branch, and I don't see SELINUXMNT at all.

Adding the following to system/core/init/init.c allows it to build:

#define SELINUXMNT "/sys/fs/selinux"

But I'm worried that there may be something else I'm doing wrong, with other 
consequences I haven't seen yet.

Has anyone else seen this?  What am I doing wrong?

Ah, I had cherry-picked over various updates from libselinux master/seandroid to 4.0.4 and missed this breakage. The problem is that the policy loading logic was moved out of init and encapsulated entirely within libselinux after 4.0.4, so we removed the SELINUXMNT definition from selinux.h. I'll restore it to the libselinux seandroid-4.0.4 branch. But obviously 4.0.4 is fairly old at this point and not getting any further updates, so I'd encourage you to consider moving to 4.2.1 or at least to 4.1.2.


--
This message was distributed to subscribers of the seandroid-list mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe seandroid-list" without quotes as the message.

Reply via email to