From c3c22d1d74259100925343f69c9ceaba581c16c5 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Mon, 27 Jun 2011 20:30:40 +0100 Subject: [PATCH] 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jdk/src/windows/classes/java/lang/ProcessImpl.java b/jdk/src/windows/classes/java/lang/ProcessImpl.java index 05891161a42..88486e5f472 100644 --- a/jdk/src/windows/classes/java/lang/ProcessImpl.java +++ b/jdk/src/windows/classes/java/lang/ProcessImpl.java @@ -60,10 +60,11 @@ final class ProcessImpl extends Process { 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(