7059259: (process) ProcessBuilder.start permission check should be improved when redirecting output to append
Reviewed-by: hawtin
This commit is contained in:
parent
a2a420e7de
commit
c3c22d1d74
@ -60,10 +60,11 @@ final class ProcessImpl extends Process {
|
|||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
if (append) {
|
if (append) {
|
||||||
|
String path = f.getPath();
|
||||||
SecurityManager sm = System.getSecurityManager();
|
SecurityManager sm = System.getSecurityManager();
|
||||||
if (sm != null)
|
if (sm != null)
|
||||||
sm.checkWrite(f.getPath());
|
sm.checkWrite(path);
|
||||||
long handle = openForAtomicAppend(f.getPath());
|
long handle = openForAtomicAppend(path);
|
||||||
final FileDescriptor fd = new FileDescriptor();
|
final FileDescriptor fd = new FileDescriptor();
|
||||||
fdAccess.setHandle(fd, handle);
|
fdAccess.setHandle(fd, handle);
|
||||||
return AccessController.doPrivileged(
|
return AccessController.doPrivileged(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user