LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-17-2008, 06:58 AM   #1
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Rep: Reputation: 39
Why does the filesystem think /selinux/enforce is an empty file?


The file /selinux/enforce contains 1 character, according to cat, but apparently it has zero size. What's going on here?

Code:
$ cat /selinux/enforce
1$ ls -l /selinux/enforce
-rw-r--r-- 1 root root 0 2008-12-17 12:36 /selinux/enforce
$ du -b /selinux/enforce
0       /selinux/enforce
$ file /selinux/enforce
/selinux/enforce: empty
$
 
Old 12-17-2008, 08:07 AM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Yes, that's strange. Perhaps you should ask he moderators to move his thread to the security forum. I suspect that it's a security issue. Speaking of zero length files with content, look at this:
Code:
$ ls -l /selinux/
total 0
-rw-rw-rw-  1 root root    0 2008-12-16 21:33 access
dr-xr-xr-x  2 root root    0 2008-12-16 21:33 avc
dr-xr-xr-x  2 root root    0 2008-12-16 21:33 booleans
-rw-r--r--  1 root root    0 2008-12-16 21:33 checkreqprot
dr-xr-xr-x 75 root root    0 2008-12-16 21:33 class
--w-------  1 root root    0 2008-12-16 21:33 commit_pending_bools
-rw-r--r--  1 root root    0 2008-12-16 21:33 compat_net
-rw-rw-rw-  1 root root    0 2008-12-16 21:33 context
-rw-rw-rw-  1 root root    0 2008-12-16 21:33 create
-r--r--r--  1 root root    0 2008-12-16 21:33 deny_unknown
--w-------  1 root root    0 2008-12-16 21:33 disable
-rw-r--r--  1 root root    0 2008-12-16 21:33 enforce
dr-xr-xr-x  2 root root    0 2008-12-16 21:33 initial_contexts
-rw-------  1 root root    0 2008-12-16 21:33 load
-rw-rw-rw-  1 root root    0 2008-12-16 21:33 member
-r--r--r--  1 root root    0 2008-12-16 21:33 mls
crw-rw-rw-  1 root root 1, 3 2008-12-16 21:33 null
dr-xr-xr-x  2 root root    0 2008-12-16 21:33 policy_capabilities
-r--r--r--  1 root root    0 2008-12-16 21:33 policyvers
-r--r--r--  1 root root    0 2008-12-16 21:33 reject_unknown
-rw-rw-rw-  1 root root    0 2008-12-16 21:33 relabel
-rw-rw-rw-  1 root root    0 2008-12-16 21:33 user
Note the date/time is the time I last turned off the system . . .

Last edited by PTrenholme; 12-17-2008 at 08:09 AM.
 
Old 12-18-2008, 02:58 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
It's not only /slinux but /proc too.
All files but links has zero size.
Looks like kernel doesn't bother to export correct file size for stat
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"../system.h :selinux/selinux.h:no such file or directory" ashmita04 Linux From Scratch 4 02-05-2009 03:36 AM
/selinux/enforce not found ShaqDiesel Linux - Server 9 09-11-2008 06:28 PM
httpd access with selinux enforce mode, restriction issues. rajnishmishra Linux - Security 3 08-19-2008 03:46 PM
boot filesystem was empty procfs Linux - General 4 07-20-2006 10:45 PM
FC3, selinux filesystem? mebrelith Fedora 1 02-14-2005 08:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:07 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration