mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-25 05:30:25 +08:00
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:
parent
b3eb1e0e9c
commit
782bcb9f98
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user