< prev index next >

test/jdk/sun/security/tools/jarsigner/PosixPermissionsTest.java

Print this page

        

*** 70,81 **** private final static URI ZIPURI = URI.create("jar:" + Path.of(ZIPFILENAME).toUri()); private static Path file; private static int count; private static Set<PosixFilePermission> permsSet; private static String expectedJarPerms; ! private static final String POSIXWARNING = "POSIX file permission attributes detected. " + ! "These attributes are ignored when signing and are not protected by the signature."; public static void main(String[] args) throws Exception { if (!FileSystems.getDefault().supportedFileAttributeViews().contains("posix")) { System.out.println("No posix support. Skipping"); return; --- 70,82 ---- private final static URI ZIPURI = URI.create("jar:" + Path.of(ZIPFILENAME).toUri()); private static Path file; private static int count; private static Set<PosixFilePermission> permsSet; private static String expectedJarPerms; ! private static final String WARNING_MSG = "POSIX file permission and/or symlink " + ! "attributes detected. These attributes are ignored when signing and are not " + ! "protected by the signature."; public static void main(String[] args) throws Exception { if (!FileSystems.getDefault().supportedFileAttributeViews().contains("posix")) { System.out.println("No posix support. Skipping"); return;
*** 102,112 **** "-verbose", ZIPFILENAME, "-storepass", "password", "-keypass", "password", "examplekey") .shouldHaveExitValue(0) ! .shouldContain(POSIXWARNING); // zip file now signed. Recheck file permissions verifyFilePermissions(ZIPURI, true); // sign jar file - no posix warning message expected --- 103,113 ---- "-verbose", ZIPFILENAME, "-storepass", "password", "-keypass", "password", "examplekey") .shouldHaveExitValue(0) ! .shouldContain(WARNING_MSG); // zip file now signed. Recheck file permissions verifyFilePermissions(ZIPURI, true); // sign jar file - no posix warning message expected
*** 114,144 **** "-verbose", JARFILENAME, "-storepass", "password", "-keypass", "password", "examplekey") .shouldHaveExitValue(0) ! .shouldNotContain(POSIXWARNING); // default attributes expected verifyFilePermissions(JARURI, false); SecurityTools.jarsigner("-keystore", "examplekeystore", "-storepass", "password", "-keypass", "password", "-verbose", "-verify", ZIPFILENAME) .shouldHaveExitValue(0) ! .shouldContain(POSIXWARNING); // no warning expected for regular jar file SecurityTools.jarsigner("-keystore", "examplekeystore", "-storepass", "password", "-keypass", "password", "-verbose", "-verify", JARFILENAME) .shouldHaveExitValue(0) ! .shouldNotContain(POSIXWARNING); } private static void createFiles() throws Exception { String fileList = " "; --- 115,145 ---- "-verbose", JARFILENAME, "-storepass", "password", "-keypass", "password", "examplekey") .shouldHaveExitValue(0) ! .shouldNotContain(WARNING_MSG); // default attributes expected verifyFilePermissions(JARURI, false); SecurityTools.jarsigner("-keystore", "examplekeystore", "-storepass", "password", "-keypass", "password", "-verbose", "-verify", ZIPFILENAME) .shouldHaveExitValue(0) ! .shouldContain(WARNING_MSG); // no warning expected for regular jar file SecurityTools.jarsigner("-keystore", "examplekeystore", "-storepass", "password", "-keypass", "password", "-verbose", "-verify", JARFILENAME) .shouldHaveExitValue(0) ! .shouldNotContain(WARNING_MSG); } private static void createFiles() throws Exception { String fileList = " ";
< prev index next >