7059259: (process) ProcessBuilder.start permission check should be improved when redirecting output to append
Reviewed-by: hawtin
--- 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(