|
26 | 26 | import java.nio.file.attribute.AclEntryPermission; |
27 | 27 | import java.nio.file.attribute.AclEntryType; |
28 | 28 | import java.nio.file.attribute.AclFileAttributeView; |
29 | | -import java.nio.file.attribute.PosixFilePermission; |
30 | 29 | import java.util.HashMap; |
31 | 30 | import java.util.List; |
32 | 31 | import java.util.Map; |
33 | 32 | import java.util.stream.Collectors; |
34 | 33 | import java.util.Optional; |
35 | | -import java.util.Set; |
36 | 34 |
|
37 | 35 | import org.slf4j.Logger; |
38 | 36 | import org.slf4j.LoggerFactory; |
@@ -136,16 +134,11 @@ public void start(String path) throws Exception { |
136 | 134 | } |
137 | 135 | } |
138 | 136 |
|
139 | | - private static void manageSocketPermissions(String pathString) throws IOException { |
140 | | - Set<PosixFilePermission> permissions = Set.of( |
141 | | - PosixFilePermission.OWNER_READ, |
142 | | - PosixFilePermission.OWNER_WRITE, |
143 | | - PosixFilePermission.OWNER_EXECUTE); |
144 | | - Path path = Paths.get(pathString); |
145 | | - Files.setPosixFilePermissions(path, permissions); |
| 137 | + private static void manageSocketPermissions(String socketFile) throws IOException { |
| 138 | + Runtime.getRuntime().exec("chmod 700 " + socketFile); |
146 | 139 |
|
147 | 140 | if (!SOCKET_ALLOWED_USERS.isEmpty()) { |
148 | | - Optional.ofNullable(Files.getFileAttributeView(path, AclFileAttributeView.class)) |
| 141 | + Optional.ofNullable(Files.getFileAttributeView(Paths.get(socketFile), AclFileAttributeView.class)) |
149 | 142 | .orElseThrow(() -> new UnsupportedOperationException("ACLs are not supported on this filesystem.")) |
150 | 143 | .setAcl(SOCKET_ALLOWED_USERS.stream() |
151 | 144 | .map(ApplicationRunner::computeAclEntry) |
|
0 commit comments