Skip to content

Commit cbabe19

Browse files
committed
Merge branch 'release/2.6.9'
2 parents 6f04f2a + b5ff5a1 commit cbabe19

File tree

9 files changed

+58
-20
lines changed

9 files changed

+58
-20
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ updates:
66
interval: "weekly"
77
day: "monday"
88
time: "06:00"
9-
timezone: "UTC"
9+
timezone: "Etc/UTC"
1010
groups:
1111
java-test-dependencies:
1212
patterns:

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ jobs:
1010
with:
1111
fetch-depth: 0
1212
show-progress: false
13-
- uses: actions/setup-java@v3
13+
- uses: actions/setup-java@v4
1414
with:
1515
java-version: 17
1616
distribution: 'temurin'
1717
cache: 'maven'
1818
- name: Cache SonarCloud packages
19-
uses: actions/cache@v3
19+
uses: actions/cache@v4
2020
with:
2121
path: ~/.sonar/cache
2222
key: ${{ runner.os }}-sonar
2323
restore-keys: ${{ runner.os }}-sonar
2424
- name: Ensure to use tagged version
2525
if: startsWith(github.ref, 'refs/tags/')
26-
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
26+
run: mvn -B versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
2727
- name: Build and Test
2828
run: >
2929
mvn -B verify
@@ -36,7 +36,7 @@ jobs:
3636
env:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
3838
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
39-
- uses: actions/upload-artifact@v3
39+
- uses: actions/upload-artifact@v4
4040
with:
4141
name: artifacts
4242
path: target/*.jar

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ jobs:
2020
with:
2121
fetch-depth: 2
2222
show-progress: false
23-
- uses: actions/setup-java@v3
23+
- uses: actions/setup-java@v4
2424
with:
2525
java-version: 17
2626
distribution: 'temurin'
2727
cache: 'maven'
2828
- name: Initialize CodeQL
29-
uses: github/codeql-action/init@v2
29+
uses: github/codeql-action/init@v3
3030
with:
3131
languages: java
3232
- name: Build
3333
run: mvn -B install -DskipTests
3434
- name: Perform CodeQL Analysis
35-
uses: github/codeql-action/analyze@v2
35+
uses: github/codeql-action/analyze@v3
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: OWASP Maven Dependency Check
2+
on:
3+
schedule:
4+
- cron: '0 10 * * 0'
5+
push:
6+
branches:
7+
- 'release/**'
8+
workflow_dispatch:
9+
10+
11+
jobs:
12+
check-dependencies:
13+
uses: skymatic/workflows/.github/workflows/run-dependency-check.yml@v1
14+
with:
15+
runner-os: 'ubuntu-latest'
16+
java-distribution: 'temurin'
17+
java-version: 17
18+
secrets:
19+
nvd-api-key: ${{ secrets.NVD_API_KEY }}
20+
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/publish-central.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
ref: "refs/tags/${{ github.event.inputs.tag }}"
1616
show-progress: false
17-
- uses: actions/setup-java@v3
17+
- uses: actions/setup-java@v4
1818
with:
1919
java-version: 17
2020
distribution: 'temurin'

.github/workflows/publish-github.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v4
1111
with:
1212
show-progress: false
13-
- uses: actions/setup-java@v3
13+
- uses: actions/setup-java@v4
1414
with:
1515
java-version: 17
1616
distribution: 'temurin'

pom.xml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>org.cryptomator</groupId>
44
<artifactId>cryptofs</artifactId>
5-
<version>2.6.8</version>
5+
<version>2.6.9</version>
66
<name>Cryptomator Crypto Filesystem</name>
77
<description>This library provides the Java filesystem provider used by Cryptomator.</description>
88
<url>https://github.com/cryptomator/cryptofs</url>
@@ -20,19 +20,19 @@
2020
<!-- dependencies -->
2121
<cryptolib.version>2.1.2</cryptolib.version>
2222
<jwt.version>4.4.0</jwt.version>
23-
<dagger.version>2.48.1</dagger.version>
23+
<dagger.version>2.49</dagger.version>
2424
<guava.version>32.1.3-jre</guava.version>
2525
<caffeine.version>3.1.8</caffeine.version>
26-
<slf4j.version>2.0.9</slf4j.version>
26+
<slf4j.version>2.0.12</slf4j.version>
2727

2828
<!-- test dependencies -->
29-
<junit.jupiter.version>5.10.1</junit.jupiter.version>
29+
<junit.jupiter.version>5.10.2</junit.jupiter.version>
3030
<mockito.version>5.2.0</mockito.version>
3131
<hamcrest.version>2.2</hamcrest.version>
3232
<jimfs.version>1.3.0</jimfs.version>
3333

3434
<!-- build plugin dependencies -->
35-
<dependency-check.version>9.0.1</dependency-check.version>
35+
<dependency-check.version>9.0.9</dependency-check.version>
3636
<junit-tree-reporter.version>1.2.1</junit-tree-reporter.version>
3737
<jacoco.version>0.8.11</jacoco.version>
3838
<nexus-staging.version>1.6.13</nexus-staging.version>
@@ -143,7 +143,7 @@
143143
<plugin>
144144
<groupId>org.apache.maven.plugins</groupId>
145145
<artifactId>maven-compiler-plugin</artifactId>
146-
<version>3.11.0</version>
146+
<version>3.12.1</version>
147147
<configuration>
148148
<showWarnings>true</showWarnings>
149149
<annotationProcessorPaths>
@@ -158,7 +158,7 @@
158158
<plugin>
159159
<groupId>org.apache.maven.plugins</groupId>
160160
<artifactId>maven-surefire-plugin</artifactId>
161-
<version>3.2.2</version>
161+
<version>3.2.5</version>
162162
<dependencies>
163163
<dependency>
164164
<groupId>me.fabriciorby</groupId>
@@ -197,7 +197,7 @@
197197
</plugin>
198198
<plugin>
199199
<artifactId>maven-javadoc-plugin</artifactId>
200-
<version>3.6.2</version>
200+
<version>3.6.3</version>
201201
<executions>
202202
<execution>
203203
<id>attach-javadocs</id>
@@ -247,17 +247,19 @@
247247
<artifactId>dependency-check-maven</artifactId>
248248
<version>${dependency-check.version}</version>
249249
<configuration>
250-
<cveValidForHours>24</cveValidForHours>
250+
<nvdValidForHours>24</nvdValidForHours>
251251
<failBuildOnCVSS>0</failBuildOnCVSS>
252252
<skipTestScope>true</skipTestScope>
253253
<detail>true</detail>
254254
<suppressionFile>suppression.xml</suppressionFile>
255+
<nvdApiKey>${env.NVD_API_KEY}</nvdApiKey>
255256
</configuration>
256257
<executions>
257258
<execution>
258259
<goals>
259260
<goal>check</goal>
260261
</goals>
262+
<phase>validate</phase>
261263
</execution>
262264
</executions>
263265
</plugin>

src/main/java/org/cryptomator/cryptofs/ch/CleartextFileChannel.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.cryptomator.cryptofs.ch;
22

3+
import com.google.common.annotations.VisibleForTesting;
34
import com.google.common.base.Preconditions;
45
import org.cryptomator.cryptofs.CryptoFileSystemStats;
56
import org.cryptomator.cryptofs.EffectiveOpenOptions;
@@ -245,7 +246,8 @@ private void flush() throws IOException {
245246
*
246247
* @throws IOException
247248
*/
248-
private void persistLastModified() throws IOException {
249+
@VisibleForTesting
250+
void persistLastModified() throws IOException {
249251
FileTime lastModifiedTime = isWritable() ? FileTime.from(lastModified.get()) : null;
250252
FileTime lastAccessTime = FileTime.from(Instant.now());
251253
var p = currentFilePath.get();
@@ -322,6 +324,7 @@ long beginOfChunk(long cleartextPos) {
322324
protected void implCloseChannel() throws IOException {
323325
try {
324326
flush();
327+
ciphertextFileChannel.force(true);
325328
try {
326329
persistLastModified();
327330
} catch (NoSuchFileException nsfe) {

src/test/java/org/cryptomator/cryptofs/ch/CleartextFileChannelTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
import static org.mockito.ArgumentMatchers.anyLong;
5252
import static org.mockito.Mockito.doNothing;
5353
import static org.mockito.Mockito.doThrow;
54+
import static org.mockito.Mockito.inOrder;
5455
import static org.mockito.Mockito.mock;
56+
import static org.mockito.Mockito.spy;
5557
import static org.mockito.Mockito.verify;
5658
import static org.mockito.Mockito.when;
5759

@@ -240,6 +242,17 @@ public void testCloseTriggersCloseListener() throws IOException {
240242
verify(closeListener).closed(inTest);
241243
}
242244

245+
@Test
246+
@DisplayName("On close, first flush channel, then persist lastModified")
247+
public void testCloseFlushBeforePersist() throws IOException {
248+
var inSpy = spy(inTest);
249+
inSpy.implCloseChannel();
250+
251+
var ordering = inOrder(inSpy, ciphertextFileChannel);
252+
ordering.verify(ciphertextFileChannel).force(true);
253+
ordering.verify(inSpy).persistLastModified();
254+
}
255+
243256
@Test
244257
public void testCloseUpdatesLastModifiedTimeIfWriteable() throws IOException {
245258
when(options.writable()).thenReturn(true);

0 commit comments

Comments
 (0)