File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
exist-core/src/main/java/org/exist/management/client Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 56
56
import java .nio .file .Files ;
57
57
import java .nio .file .Path ;
58
58
import java .nio .file .Paths ;
59
+ import java .nio .file .attribute .PosixFileAttributes ;
60
+ import java .nio .file .attribute .PosixFilePermission ;
61
+ import java .nio .file .attribute .PosixFilePermissions ;
59
62
import java .util .HashSet ;
60
63
import java .util .Properties ;
61
64
import java .util .Set ;
@@ -338,6 +341,13 @@ private String getToken() {
338
341
// Create and write when needed
339
342
if (!Files .exists (tokenFile ) || token == null ) {
340
343
344
+ final Set <PosixFilePermission > permissions = PosixFilePermissions .fromString ("rw-r-----" );
345
+ try {
346
+ tokenFile = Files .createFile (tokenFile , PosixFilePermissions .asFileAttribute (permissions ));
347
+ } catch (final Throwable t ) {
348
+ LOG .warn ("Unable to restrict permissions on: " + tokenFile );
349
+ }
350
+
341
351
// Create random token
342
352
token = UUIDGenerator .getUUIDversion4 ();
343
353
You can’t perform that action at this time.
0 commit comments