LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 09-23-2010, 07:10 PM   #1
amonamarth
Member
 
Registered: Dec 2009
Location: Los Angeles
Distribution: Fedora ,CentOS, RHEL
Posts: 53

Rep: Reputation: 17
Where are the booleans for SELinux stored?


Hello:

I always thought that whenever /usr/sbin/setsebool was used, it would write either a "0" or a "1" into the corresponding boolean file. All SELinux boolean files are in /selinux/booleans but If I check, for example, this boolean ...

$ sudo /usr/sbin/getsebool ftp_home_dir
ftp_home_dir --> on

It returns a positive, but if I do

$ sudo less /selinux/booleans/ftp_home_dir

I get ...
read error (Press Return)

Furthermore, if I list the boolean file itself, it shows it to be empty
$ sudo ls -l /selinux/booleans/ftp_home_dir
-rw-r--r-- 1 root root 0 Aug 9 11:09 /selinux/booleans/ftp_home_dir

Where is SELinux storing the booleans then?

This is on CentOS 5.4
 
Old 09-23-2010, 08:24 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 452

Rep: Reputation: 68
/selinux is a looking glass into the current state of affairs, akin to /proc or /sys.

The booleans are stored in the on-disk policy located under /etc/selinux/; more specifically /etc/selinux/targeted/policy/.

If you run setsebool without the -P option it only modifies the entry in /selinux/boolean/<name> and does not rebuild the on-disk policy so the setting will not persist a reboot. If you run an strace on it, you can see it open, for example, ftp_home_dir, write the value (0 or 1), then close; it also updates /selinux/commit_pending_bools. Whereas when using the -P, it opens, reads, (compiles,) writes each module in /etc/selinux/, rebuilds the on-disk policy, and then sets each boolean value in /selinux/booleans/ from the just compiled policy.

Last edited by rayfordj; 09-23-2010 at 08:38 PM.
 
Old 09-29-2010, 11:49 PM   #3
amonamarth
Member
 
Registered: Dec 2009
Location: Los Angeles
Distribution: Fedora ,CentOS, RHEL
Posts: 53

Original Poster
Rep: Reputation: 17
I see ...
$ cat /selinux/booleans/ftp_home_dir
shows current state and "persistent" state of this boolean

For others reading this thread go here for more details
http://flylib.com/books/en/2.803.1.68/2/
 
  


Reply

Tags
selinux


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Booleans: trscookie Programming 1 07-29-2010 07:01 PM
"../system.h :selinux/selinux.h:no such file or directory" ashmita04 Linux From Scratch 4 02-05-2009 03:36 AM
booleans mintoo4linux Linux - Newbie 4 06-20-2008 08:39 AM
problem with booleans yadava Linux - Newbie 5 04-18-2008 09:16 AM
Load Booleans?? maestro52 Linux - Newbie 11 08-27-2005 10:18 PM


All times are GMT -5. The time now is 11:34 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration