mojira.dev
MC-118391

Crafting not working when running as non-administrator (Server)

When running a minecraft server on Windows as a user with privileges limited to only the users minecraft folder, minecraft will not allow crafting. Crafting book is empty.

If I run the Minecraft server as an administrator, there is no problem however this is a huge security risk since I run multiple servers for different users.

This only impacts Minecraft version 1.12
1.11.2 and lower versions are not impacted.

Reading from the console, I can see the following error messages which states that its attempting to access a file which might be outside the game server's folder (please see attached). The question is, where is it trying to access the file? Why the change?

8/06/2017 7:58 AM: [MC]: java.nio.file.AccessDeniedException: C:\GAME SERVERS\ultramoo mct 9\minecraft_server.jar
8/06/2017 7:58 AM: [MC]: 	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:90) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at sun.nio.fs.WindowsLinkSupport.getRealPath(WindowsLinkSupport.java:259) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:836) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:44) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:111) ~[zipfs.jar:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at java.nio.file.FileSystems.newFileSystem(FileSystems.java:326) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at java.nio.file.FileSystems.newFileSystem(FileSystems.java:276) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at aks.b(SourceFile:77) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: 	at aks.a(SourceFile:55) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: 	at ng.c(SourceFile:485) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: 	at net.minecraft.server.MinecraftServer.main(SourceFile:672) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: java.nio.file.AccessDeniedException: C:\GAME SERVERS\ultramoo mct 9\minecraft_server.jar
8/06/2017 7:58 AM: [MC]: 	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:90) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at sun.nio.fs.WindowsLinkSupport.getRealPath(WindowsLinkSupport.java:259) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:836) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:44) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:111) ~[zipfs.jar:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at java.nio.file.FileSystems.newFileSystem(FileSystems.java:326) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at java.nio.file.FileSystems.newFileSystem(FileSystems.java:276) ~[?:1.8.0_111]
8/06/2017 7:58 AM: [MC]: 	at nq.a(SourceFile:133) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: 	at nq.a(SourceFile:73) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: 	at nq.<init>(SourceFile:66) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: 	at om.b(SourceFile:163) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: 	at net.minecraft.server.MinecraftServer.a(SourceFile:281) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: 	at nx.j(SourceFile:230) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: 	at net.minecraft.server.MinecraftServer.run(SourceFile:434) [minecraft_server.jar:?]
8/06/2017 7:58 AM: [MC]: 	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]

Attachments

Comments 6

Please attach the whole log file, not just a snippet.

This is how your computer is configured to work. Run it as administrator.

This is a technical support issue; this site is for bug reports only. We do not have the resources to provide you with technical support.
Please contact the community support, linked below.

Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki

Is that a joke? Who in the right mind would run a game as an Administrator? Please escalate this to your manager as you have no idea what you are talking about.

This is 100% a bug because the only way I can fix this is by modifying your code but I need the source.

Please provide me the source so I can fix it for you and also for 10,000 other servers in my community who are suffering as the result of this.

Not a joke, the server needs permission to get/create the files it needs.

Thanks - The thing is the permissions are already set which allow user to have access.

After further analysis it seems you are using a new java module called zip fs. This attempts to access libraries within the minecraft jar file but it can't due to the file already being open by minecraft itself and zipfs appears to use a separate thread which is not part of the same process.

This appears to be a bug in Java and windows but fix only available for the unreleased version of java 1.9. Sadly I can;t use java 1.9 due to other side effects on the game.

Guess I'm on my own at the moment to find a solution. If your developers figure something out, please do let me know.

Thanks

Resolved the issue - zipfs checks access to each folder before it reaches the last one - which is unnecessary. Has been raised as a bug in java and fixed in unreleased version JRE 1.9.

For now I've set additional permissions from root folders with limited read access. Exposes folder paths sadly but better than nothing.

Mudassar Khan

(Unassigned)

Unconfirmed

Minecraft 1.12

Retrieved