You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fesod.apache.org by "AhmedYoussef98 (via GitHub)" <gi...@apache.org> on 2026/09/30 13:05:33 UTC
[I] [Bug] CompatibilityTest deletes the whole system temp dir, and FileUtils.delete follows symlinks out of it [fesod]
AhmedYoussef98 opened a new issue, #1169:
URL: https://github.com/apache/fesod/issues/1169
### Search before asking
- [x] I searched in the issues and found nothing similar.
### Fesod version
2.1.0-incubating (current `main`, 5a9a16b)
### JDK version
17.0.20.1
### Operating system
macOS 27 (arm64)
### Steps To Reproduce
1. Have any symbolic link inside the system temp directory that points outside it. Mounted installer disk images commonly contain one: for example, Docker Desktop's installer mounts a DMG under `$TMPDIR/com.docker.install/DockerDesktop-<n>/`, and it contains `Applications -> /Applications`.
2. Run the test suite, e.g. `./mvnw clean package -Dmaven.test.skip=false -pl fesod-common,fesod-shaded,fesod-sheet`.
### Current Behavior
`CompatibilityTest#readWithCacheAfterTempDeletion` calls
```java
FileUtils.delete(new File(System.getProperty(TempFile.JAVA_IO_TMPDIR)));
```
This recursively deletes the **entire system temp directory**, including files that belong to other running processes. On macOS that is the user's per-user temp directory.
`FileUtils.delete` also follows symbolic links, because `File.isDirectory()` and `File.listFiles()` resolve them. When the walk reaches a link that points outside the temp directory, it goes on deleting through the link target.
On my machine, the link `Applications -> /Applications` inside a mounted Docker installer image led the test to delete every file inside 17 application bundles in `/Applications` within a few seconds. The apps were left as empty directory skeletons and had to be reinstalled. The deletion ran as the normal user, so there was no permission prompt.
### Expected Behavior
- A test never deletes directories it did not create. It should delete only Fesod's own temp directory (`FileUtils.getTempFilePrefix()`, i.e. `<tmpdir>/<uuid>/`), which is what the test is meant to simulate: Fesod's temp files being cleaned up while idle.
- `FileUtils.delete` deletes a symbolic link itself and never follows it. That way, deletion can't escape the directory it was given, and this protects the production caller in `ExcelAnalyserImpl` too.
### Anything else?
Anyone who runs the full `fesod-sheet` test suite locally is exposed, and so is any CI runner that shares its temp directory. I have a fix with a regression test ready.
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [I] [Bug] CompatibilityTest deletes the whole system temp dir, and FileUtils.delete follows symlinks out of it [fesod]
Posted by "bengbengbalabalabeng (via GitHub) via commits" <co...@fesod.apache.org>.
bengbengbalabalabeng closed issue #1169: [Bug] CompatibilityTest deletes the whole system temp dir, and FileUtils.delete follows symlinks out of it
URL: https://github.com/apache/fesod/issues/1169
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org