Question: I have a Umask value of
0066, so that only I have read/write permissions on my files. But other users can delete my files! Is this a proftpd bug?
Answer: No. The permission for deleting a file is
not governed by the write permission on the deleted file; it is
controlled by the write permission on the directory containing the file.
If you think of a directory as a "table of contents", with entries for each
of the files in that directory, then deleting a file means deleting the entry
for that file from the "table of contents", which is a write on the directory
(not on the deleted file).
Let's assume that your files were in a directory whose permissions were
0777 (rwxrwxrwx). This means that everyone has
write permissions in that directory. It also means that everyone can
delete files from that directory.
Now let's assume that your files instead were in a directory whose permissions
where 0755 (rwxr-xr-x). This means that only the
user owner of the directory can delete files from that directory, and no one
else.
For directories which contain files from different users, one of the
little-known (and very useful) permissions to have for the directory is
1777 (rwxrwxrwt). The leading 1 (and t)
indicates the "sticky bit". This obscure bit is little used these days,
except in this useful configuration. When the sticky bit is set on
a directory (making it a "sticky directory"), normal users may not delete or
rename files of other users in that directory. Because of this property,
"sticky directories" are quite useful as shared directories (e.g.
/tmp).
© Copyright 2017 The ProFTPD Project
All Rights Reserved