diff options
author | Gary Benson <gbenson@redhat.com> | 2006-07-12 15:25:50 +0000 |
---|---|---|
committer | Gary Benson <gary@gcc.gnu.org> | 2006-07-12 15:25:50 +0000 |
commit | 782bcb9f987ec9168a7224260f90d072b4688b73 (patch) | |
tree | 274ba90708dd31dba4771886f07d799a45b99c02 /libjava/java | |
parent | b3eb1e0e9c1dc7cf7bf0a0d919a1a6239e37298b (diff) | |
download | gcc-782bcb9f987ec9168a7224260f90d072b4688b73.zip gcc-782bcb9f987ec9168a7224260f90d072b4688b73.tar.gz gcc-782bcb9f987ec9168a7224260f90d072b4688b73.tar.bz2 |
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
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/io/File.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index 55b7b08..8e2946f 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -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); } |