"Lang, Cliff" <[EMAIL PROTECTED]> writes: > This my be more appropriate for a Java list, but I've search around and > have found no information. > > Platform: > Sparc 4m/4u > Solaris 2.7 > Java 1.3.1_2 & 1.4 > Turbine 2.2 > > > When working with the upload routine, I wanted to test for a files > write-ability and found java.io.File().canWrite() always returns true > (if the file exists). > > So even if I make a file read-only (-r--r--r--), canWrite() returns > true, and my file can be overwritten. > > I am running the tdk on a privilege port, so it runs as root. With the > above effect I can't protect any of my files (system or not) at the OS.
I speculate that canWrite() returns true because you're running as root (who can write to read-only files). Try setuidgid() to another user. Dan -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
