-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add further doc about long name and crash.
- Loading branch information
1 parent
84ab6ed
commit 0f3462c
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Long file name support | ||
|
||
In full format, each filename can be up to 255 bytes long (in UTF-8 encoding). This is in line with most filesystems. | ||
|
||
In lite format, each filename is encrypted by AES-SIV, and then converted by Base32. This means that a 143 bytes long filename will be transformed into a 255 bytes filename. Beyond that, the encrypted filename will exceed the maximum length on most filesystems. | ||
|
||
Originally this will cause an error, but starting on securefs 1.0.0, we introduce long name support feature. | ||
|
||
When filename length exceeds a predefined threshold (default: 128), it will be converted to an underlying filename by `Base32(Blake2b(name_master_key, filename))` plus three dots. Then this transformed name and the AES-SIV encrypted name will be stored in a per directory SQLite database. The database will be queried during `ls` call, and be updated when files are created, deleted or moved. | ||
|
||
This approach has some performance penalty, but given the rarity of such long filenames, the tradeoff should make sense for most people. | ||
|
||
## Migration | ||
For lite format repositories created before `securefs` 1.0.0, they do not support long file names, but this can be fixed. | ||
Run `securefs migrate-long-name` to perform the migration. | ||
|
||
With the long file name support, we've also changed how symbolic links are encrypted. As a result, migration can only happen if the repository does not include symbolic links. |
0f3462c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but can we disable long-name support for newly created lite formats? I don't want any SQlite databases... I'd rather have the limit so i don't accidentally go over it when naming files
0f3462c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
securefs create --long-name-threshold 0
@Owyn