[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in Filesystem of Obsd 2.9 ??



Hi @ll,

recently when I was writing a little bit in Perl I remarked something
strange, as I was testing perl's -w option. I wanted to test if the if loop works
which is asking if a file is writeable or not. As it never claimed anything on
a write protected file I thought I had made an error in my Perl script. 

But in fact, Perl hasn't cared about the non write of that file and simply
wrote to it.

I'm not able to write to this file as root, and the file has absolutley no
write permissions. As far as I understand perls writing mechanism of an
existing file works in that way, that the file in case of a (OPEN, ">file")is first
snipped to the first line and then the conents are inserted.

As this is not a delete of the file, this is not a write access on the
directory, so removing all write permissions on the file should suffice, to block
it for programs and users (such as root) to write to that file.

Why is that not the case? Where is the bug? In Perl (likley not, as perl is
underlaying the Operating System) Or is it the filesystem of OpenBSD?

I'm using OpenBSD 2.9 stable on a i386

Carsten

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

GMX Tipp:

Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a



Visit your host, monkey.org