On Fri, 11 Sep 2026 17:48:32 GMT, Sean Mullan <[email protected]> wrote:

>> Alternate implementation - this version only contains one argument - the 
>> name of the properties file. If an include statement is needed, it should be 
>> inserted in the properties file and it will always be added as the last line 
>> of the the conf/security/java.security configuration file.. 
>> 
>> See https://github.com/openjdk/jdk/pull/30635 for the other implementation. 
>> 
>> This is a new jlink plugin which allows the user to specify values of 
>> security properties it wants to override in the conf/security/java.security 
>> configuration file in a custom runtime image. This enhancement, along with 
>> https://github.com/openjdk/jdk/pull/29700 allow users to more easily create 
>> runtimes that address the specific security requirements of their 
>> applications.
>> 
>> The command-line syntax takes a file containing properties that the user 
>> wants to override. The file can also contain an include statement which will 
>> be added as the last line of the conf/security/java.security configuration 
>> file.
>> 
>> For example:
>> 
>> jlink --security-properties props.security
>> 
>> where props.security is a file containing one more more properties in the 
>> java.security file syntax.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Sean Mullan has updated the pull request incrementally with eight additional 
> commits since the last revision:
> 
>  - Remove whitespace, fix continuation char.
>  - Test property with EOF immediately after continuation character
>  - Disallow include statement in java.security file.
>  - Check for duplicates in java.security file.
>  - Remove redundant prop.
>  - Remove extra back-tick.
>  - Test more properties with different escape characters.
>  - Store properties as specified by Properties.store(OutputStream, String).

src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SecurityPropertiesPlugin.java
 line 145:

> 143:                 Properties props = new Properties();
> 144:                 props.load(bais);
> 145:                 Set<String> propNames = props.stringPropertyNames();

There will be corner cases where this isn't 100% consistent with Properties, 
esp. if a line only has continuation and it is followed by a comment line or 
blank line. It would add a lot of complexity to handle it so I think what you 
have is okay.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31884#discussion_r4258682687

Reply via email to