File.java (renameTo): Fix security checks.

2006-07-12  Gary Benson  <gbenson@redhat.com>

	* java/io/File.java (renameTo): Fix security checks.

From-SVN: r115373
This commit is contained in:
Gary Benson 2006-07-12 15:25:50 +00:00 committed by Gary Benson
parent b3eb1e0e9c
commit 782bcb9f98
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2006-07-12 Gary Benson <gbenson@redhat.com>
* java/io/File.java (renameTo): Fix security checks.
2006-07-12 Bryce McKinlay <mckinlay@redhat.com>
PR libgcj/28352

View File

@ -1298,12 +1298,10 @@ public class File implements Serializable, Comparable
public synchronized boolean renameTo(File dest)
{
SecurityManager s = System.getSecurityManager();
String sname = getName();
String dname = dest.getName();
if (s != null)
{
s.checkWrite (sname);
s.checkWrite (dname);
s.checkWrite (getPath());
s.checkWrite (dest.getPath());
}
return performRenameTo (dest);
}