lkml.org 
[lkml]   [2012]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject/sys and access(2): Correctly implemented?
Hi!

Recently I found a problem with the command (kernel 3.0.34-0.7-default from SLES 11 SP2, run as root):
test -r "$file" && cat "$file"
emitting "Permission denied"

Investigating, I found that "test" actually uses "access()" to check for permissions. Unfortunately there are some files in /sys that have "write-only" permission bits set (e.g. /sys/devices/system/cpu/probe).

~ # ll /sys/devices/system/cpu/probe
--w------- 1 root root 4096 Jun 29 12:43 /sys/devices/system/cpu/probe
~ # F=/sys/devices/system/cpu/probe
~ # test "$F" && cat "$F"
cat: /sys/devices/system/cpu/probe: Permission denied

In times of capabilities and ACLs, shouldn't there be a test for permissions that actually works?

Regards,
Ulrich
P.S. Please make sure my CC: gets your replies, too -- thanks



\
 
 \ /
  Last update: 2012-07-06 09:01    [W:0.045 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site