diff options
Diffstat (limited to 'openjdk/sun/nio/fs/NetPath.java')
-rw-r--r-- | openjdk/sun/nio/fs/NetPath.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/openjdk/sun/nio/fs/NetPath.java b/openjdk/sun/nio/fs/NetPath.java index 991cec4d..6861a1e2 100644 --- a/openjdk/sun/nio/fs/NetPath.java +++ b/openjdk/sun/nio/fs/NetPath.java @@ -418,11 +418,21 @@ final class NetPath extends AbstractPath { return this; } + // System.getProperty("user.dir") will trigger the specified security check return new NetPath(fs, cli.System.IO.Path.GetFullPath(cli.System.IO.Path.Combine(System.getProperty("user.dir"), path))); } public Path toRealPath(LinkOption... options) throws IOException { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + { + sm.checkRead(path); + if (!isAbsolute()) + { + sm.checkPropertyAccess("user.dir"); + } + } return new NetPath(fs, toRealPathImpl(path)); } @@ -487,6 +497,15 @@ final class NetPath extends AbstractPath throw new UnsupportedOperationException(); } } + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + { + sm.checkRead(path); + if (subtree) + { + sm.checkRead(path + cli.System.IO.Path.DirectorySeparatorChar + '-'); + } + } return ((NetFileSystem.NetWatchService)watcher).register(this, create, delete, modify, overflow, subtree); } |