FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Hardened

 
 
LinkBack Thread Tools
 
Old 01-31-2011, 12:39 AM
d hee
 
Default PID File/SElinux Policy

Hello,

I was reading this tutorial on SELinux:
http://hackinglinux.blogspot.com/2007/05/selinux-tutorial.html

The Author was covering writing a SELinux policy. In it he included a PID file. What use does this PID file serve and why is it needed in the SELinux Policy?

Thank you,
-dman777
 
Old 01-31-2011, 05:30 AM
Chris Richards
 
Default PID File/SElinux Policy

On 01/30/2011 07:39 PM, d hee wrote:

The Author was covering writing a SELinux policy. In it he included a PID file. What use does this PID file serve and why is it needed in the SELinux Policy?

The PID file is not specific to SELinux. Many processes create PID
files so that other processes can determine if they are still running,
or so that another instance of this executable can determine if it is
already running. The PID file is nothing more than a file into which a
process writes its Process ID (PID) when it starts up. By convention
the PID file is usually placed in a file located in /var/run, and named
according to the process which created it (e.g. cron will create
cron.pid, syslog-ng will create syslog-ng.pid).


From SELinux's perspecive, a PID file is special only because a process
may need permission to create the file in /var/run (which is a
restricted directory) and other processes may need permission to read
the file. For this reason, SELinux has a special pidfile attribute that
denotes the fact that this file is a PID file, and the files_pidfile
interface is used to assign this attribute as well as another attribute
indicating this is a generic non-security file (as opposed to e.g. an
executable file or a private data file to which access should be
restricted).


HTH

Later,
Chris
 

Thread Tools




All times are GMT. The time now is 12:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org