Skip to content

Commit 6cc4abb

Browse files
authored
Merge pull request #592 from jmtd/OPENJDK-3935-artifact-permissions
[OPENJDK-3935] Fix script permissions for artifacts
2 parents 64575a6 + c7f38c1 commit 6cc4abb

File tree

11 files changed

+63
-0
lines changed

11 files changed

+63
-0
lines changed

modules/jvm/configure.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# OPENJDK-3695: force +x for scripts
5+
chmod 0755 /opt/jboss/container/java/jvm/*

modules/jvm/module.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ artifacts:
99
- path: artifacts/jvm
1010
dest: /opt/jboss/container/java/jvm
1111

12+
execute:
13+
- script: configure.sh
14+
1215
modules:
1316
install:
1417
- name: jboss.container.user
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Feature: test file properties for JVM module
2+
3+
@ubi9
4+
Scenario: Ensure image scripts are executable (OPENJDK-3935)
5+
When container is started with args
6+
| arg | value |
7+
| command | find /opt/jboss/container/java/ -type f -printf "%h/%f %M\n" |
8+
Then available container log should contain /opt/jboss/container/java/jvm/debug-options -rwxr-xr-x
9+
And available container log should contain /opt/jboss/container/java/jvm/java-default-options -rwxr-xr-x

modules/maven/s2i/configure.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# OPENJDK-3695: force +x for scripts
5+
chmod 0755 /usr/libexec/s2i/save-artifacts

modules/maven/s2i/module.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ modules:
3030
- name: jboss.container.maven.default
3131
- name: jboss.container.util.logging
3232

33+
execute:
34+
- script: configure.sh
35+
3336
packages:
3437
install:
3538
- tar
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Feature: test file properties for Maven S2I module
2+
3+
# builder-only test
4+
@ubi9/openjdk-17
5+
@ubi9/openjdk-21
6+
Scenario: Ensure save-artifacts script is executable (OPENJDK-3935)
7+
When container is started with args
8+
| arg | value |
9+
| command | find /usr/local/s2i -type f -printf "%f %M\n" |
10+
Then available container log should contain save-artifacts -rwxr-xr-x

modules/run/configure.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ else
1717
javasecurity="${JAVA_HOME}/conf/security/java.security"
1818
fi
1919
sed -i 's/\(networkaddress.cache.negative.ttl\)=[0-9]\+$/\1=0/' "$javasecurity"
20+
21+
# OPENJDK-3695: force +x for scripts
22+
chmod 0755 /opt/jboss/container/java/run/run-java.sh

modules/run/tests/features/run.feature

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ Feature: OpenJDK run script tests
66
| JAVA_OPTS_APPEND | -Djavax.net.ssl.trustStorePassword=sensitiveString |
77
Then container log should not contain sensitiveString
88

9+
Scenario: Ensure image scripts are executable (OPENJDK-3935)
10+
When container is started with args
11+
| arg | value |
12+
| command | find /opt/jboss/container/java/ -type f -printf "%h/%f %M\n" |
13+
Then available container log should contain /opt/jboss/container/java/run/run-java.sh -rwxr-xr-x

modules/s2i/bash/configure.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# OPENJDK-3695: force +x for scripts
5+
chmod 0755 /usr/local/s2i/{assemble,run,usage}

modules/s2i/bash/module.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ artifacts:
2323
dest: /usr/local/s2i
2424
- path: artifacts/opt
2525
dest: /opt/jboss/container/java/s2i
26+
27+
execute:
28+
- script: configure.sh

0 commit comments

Comments
 (0)