Your OS says that root can read everything:<br><br>[garth@saba test]$ ls -l foo <br>-r-------- 1 someuser someuser 5 2008-06-06 13:09 foo<br>[garth@saba test]$ cat foo<br>cat: foo: Permission denied<br>[garth@saba test]$ su<br>
Password: <br>[root@saba test]# cat foo<br>Blah<br>[root@saba test]# <br><br><div class="gmail_quote">On Fri, Jun 6, 2008 at 1:04 PM, Dan Boger &lt;<a href="mailto:dan@peeron.com">dan@peeron.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m a little bit confused here, maybe one of you guys can spot what I&#39;m missing.<br><br>I have some files on an NFS filesystem, that is set to root_squash.&nbsp; The file is owned by my network id (dboger), while I&#39;m logged in locally as dan:<br>

<br><div style="margin-left: 40px;">dan@dbdb$ ls -l somefile.png<br>-r-------- 1 dboger 3813 2008-06-05 16:46 somefile.png<br></div><br>I&#39;m trying to figure out if a file is readable, so I do something like:<br><br><div style="margin-left: 40px;">

dan@dbdb$ perl -le &#39;print &quot;lies&quot; if -r shift&#39; somefile.png<br>dan@dbdb$<br><br></div>That is correct - the file is owned by a different UID, and is set to 0400.<br><br>Now, I try the same thing as root:<br>

<br><div style="margin-left: 40px;">dan@dbdb$ sudo perl -le &#39;print &quot;lies&quot; if -r shift&#39; somefile.png<br>lies<br>dan@dbdb$ sudo file somefile.png<br>couldn&#39;t open file<br>somefile.png: regular file, no read permission<br>

<br></div>Is perl just assuming that if I&#39;m root I can always read the file, even though the permissions say that&#39;s wrong?<br><br>What am I missing?<br><br>Dan<br><br>-- <br><font color="#888888">Dan Boger
</font><br>_______________________________________________<br>
SanFrancisco-pm mailing list<br>
<a href="mailto:SanFrancisco-pm@pm.org">SanFrancisco-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/sanfrancisco-pm" target="_blank">http://mail.pm.org/mailman/listinfo/sanfrancisco-pm</a><br>
<br></blockquote></div><br>