On Thu, 28 Aug 2003 06:24:03 +0200, "Philipp Thomas"
So in linux there is no way to have some files in "a" directory that are writable and some files that are not? Directly, no. But with a trick it's possible. Create the files in a
Mark Hounschell
[Wed, 27 Aug 2003 16:26:50 -0400]: directory that is owned by root and symlink them into the directory where the user has write permissions.
Check this out: # cd /tmp # mkdir xx # chmod g+w,o+t xx # sudo chown root xx # ll -d xx drwxrwxr-t 2 root users 35 Aug 27 23:24 xx # cd xx # touch yy # sudo touch zz # ll total 0 -rw-r--r-- 1 msiefrit users 0 Aug 27 23:24 yy -rw-r--r-- 1 root root 0 Aug 27 23:24 zz # rm yy # rm zz rm: remove write-protected file `zz'? y rm: cannot unlink `zz': Operation not permitted #
From the ulink man page:
EPERM or EACCES The directory containing pathname has the sticky- bit (S_ISVTX) set and the process's effective uid is neither the uid of the file to be deleted nor that of the directory containing it. So with the sticky bit (t) set you need to own the file or the directory to be able to delete the file. HTH Michael