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_get
root@devUbuntu:/home/user1/dev# gdb ./a.out
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
Copyright (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) run
Starting program: /home/user1 /dev/a.out
Checking if selinux is enabled…
this program is not running on a SELinux kernel
getting this program’s current context…
this program's security_context_t is: = unconfined
Calling context_type_get
Program 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