apache / apache/iotdb

org.apache.commons.io.FileSystem.isLegalFileName(CharSequence candidate) method is unreasonable

Open
#13,036 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
115

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Motivation

FileSystem.isLegalFileName(CharSequence candidate) method, there is a verification logic : candidate.length() > maxFileNameLength. maxFileNameLength is string length. but when file name bytes exceed 255 will cause system errors. java.io.FileNotFoundException : File name too long.

### Solution

maxFileNameLength verify file name bytes length

### Alternatives

no

### Are you willing to submit a PR?

- [X] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Research direction

Start by locating the use of org.apache.commons.io.FileSystem.isLegalFileName(CharSequence candidate) in the repository and inspect how maxFileNameLength is applied. Verify the behavior with a filename whose encoded byte length exceeds the filesystem limit, and consider the issue done when validation rejects such names before the resulting FileNotFoundException occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.