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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user