changeset 4454:4f7f3ff57335

7059259: (process) ProcessBuilder.start permission check should be improved when redirecting output to append Reviewed-by: hawtin
author alanb
date Mon, 27 Jun 2011 20:30:40 +0100
parents 7b398eb40add
children d43c73bafe01
files src/windows/classes/java/lang/ProcessImpl.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/classes/java/lang/ProcessImpl.java	Tue Jun 28 11:20:36 2011 -0700
+++ b/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(