7059259: (process) ProcessBuilder.start permission check should be improved when redirecting output to append
authoralanb
Mon, 27 Jun 2011 20:30:40 +0100
changeset 10903 dfb253adb28f
parent 10902 a76a2350fe7b
child 10905 238185ac17e8
7059259: (process) ProcessBuilder.start permission check should be improved when redirecting output to append Reviewed-by: hawtin
jdk/src/windows/classes/java/lang/ProcessImpl.java
--- a/jdk/src/windows/classes/java/lang/ProcessImpl.java	Tue Jun 21 20:20:58 2011 +0400
+++ b/jdk/src/windows/classes/java/lang/ProcessImpl.java	Mon Jun 27 20:30:40 2011 +0100
@@ -60,10 +60,11 @@
         throws IOException
     {
         if (append) {
+            String path = f.getPath();
             SecurityManager sm = System.getSecurityManager();
             if (sm != null)
-                sm.checkWrite(f.getPath());
-            long handle = openForAtomicAppend(f.getPath());
+                sm.checkWrite(path);
+            long handle = openForAtomicAppend(path);
             final FileDescriptor fd = new FileDescriptor();
             fdAccess.setHandle(fd, handle);
             return AccessController.doPrivileged(