Getting a strange problem on the Solaris 10 box. I've got a cgi script (perl) which must overwrite personal files. We don't have suexec running on Apache therefore the destination directory has full (777) access to ensure that Apache can email it.

However , the CGI script has the capacity to write a brand new file towards the directory although not overwrite a current file.

    **Directory permissions for file destination:** 

    drwxrwxrwx 146 myuser white      32768 Jun  2 20:46 dest-dir

    **File Permissions of file that needs to be over written:** 

    -rw-r--r--   1 myuser white      0 Jun  2 20:50 cgitestfile

Anybody know an easy solution for solving this ??

If you don't have +w to some file, you cannot write (or overwrite) it. Since you have +w towards the directory, take away the file, then recreate it.

echo "Hello" >file; #Does not work, can't +w to file!

cat file >tempfile; #works fine, +w on directory allows creating a new file 
echo "Hello" >tempfile; #Same thing
mv tempfile file; #Works because of +w on directory