File Write Permission Rules

Mark A. Heilpern heilpern at ibd.BRL.MIL
Thu Feb 9 23:05:45 AEST 1989


In article <306 at wubios.wustl.edu> david at wubios.wustl.edu (David J. Camp) writes:
.>We have a strange situation where a program can write to a file even
.>though it does not have write permission.  What it does is remove the
.>file and write a new one in its place.  It can do this because it has
.>write permission to the directory in which the file is contained.
.>My question is:  What is the (historical or otherwise) justification for
.>this rule?  It seems wrong.  I would have required write permission to
.>the file itself in order that it be removed.

In order to disallow 'removal-of-file' positions, you must remove write
protection from the directory. By removing a file, you are not writing
to the file, or altering it in ANY way, you are merely removing the link
to the file, which means you are writing to the directory which has
that link.
-- 
 |\/|         |
 |  |   _     |<
/    \_(_(_)\_/ \______



More information about the Comp.unix.questions mailing list