Cheers,
Gaurav
On Sun, Sep 2, 2012 at 4:42 AM, Gaurav Kumar <gk@xxxxxxxxxxxxxxxxxxx> wrote:
Hi,When I try to compile this program http://pastebin.com/VY958hLD (refer http://www.internet-goods.com/?p=42 for original code) I get segmentation fault. Seems to be an issue with context_type_getroot@devUbuntu:/home/user1/dev# gdb ./a.outGNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04Copyright (C) 2012 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law. Type "show copying"and "show warranty" for details.This GDB was configured as "x86_64-linux-gnu".For bug reporting instructions, please see:Reading symbols from /home/user1 /dev/a.out...done.(gdb) runStarting program: /home/user1 /dev/a.outChecking if selinux is enabled…this program is not running on a SELinux kernelgetting this program’s current context…this program's security_context_t is: = unconfinedCalling context_type_getProgram received signal SIGSEGV, Segmentation fault.0x00007ffff7bc5a20 in context_type_get () from /lib/x86_64-linux-gnu/libselinux.so.1(gdb)I am compiling code as "gcc tmp.c -lselinux -ggdb" on Ubuntu 12.04.Is this an issue with selinux on Ubuntu? If not, can you please provide an example of how to call context_type_get()Thanks,Gaurav