< prev index next >

modules/jdk.packager/src/main/java/jdk/packager/builders/mac/MacAppImageBuilder.java

Print this page

        

@@ -739,11 +739,11 @@
         String appExecutable = "/Contents/MacOS/" + APP_NAME.fetchFrom(params);
         String keyChain = SIGNING_KEYCHAIN.fetchFrom(params);
 
         // sign all dylibs and jars
         Files.walk(appLocation)
-                // while we are searching let's fix permissions
+                // fix permissions
                 .peek(path -> {
                     try {
                         Set<PosixFilePermission> pfp = Files.getPosixFilePermissions(path);
                         if (!pfp.contains(PosixFilePermission.OWNER_WRITE)) {
                             pfp = EnumSet.copyOf(pfp);

@@ -760,10 +760,12 @@
                                         || p.toString().endsWith(appExecutable))
                 ).forEach(p -> {
             //noinspection ThrowableResultOfMethodCallIgnored
             if (toThrow.get() != null) return;
 
+            // If p is a symlink then skip the signing process.
+            if (!Files.isSymbolicLink(p)) {
             List<String> args = new ArrayList<>();
             args.addAll(Arrays.asList("codesign",
                     "-s", signingIdentity, // sign with this key
                     "--prefix", identifierPrefix, // use the identifier as a prefix
                     "-vvvv"));

@@ -792,10 +794,11 @@
 
                 Files.setPosixFilePermissions(p, oldPermissions);
             } catch (IOException ioe) {
                 toThrow.set(ioe);
             }
+            }
         });
 
         IOException ioe = toThrow.get();
         if (ioe != null) {
             throw ioe;
< prev index next >