Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only 143 max filename length for crypt remote #2040

Closed
olihey opened this issue Jan 31, 2018 · 1 comment
Closed

Only 143 max filename length for crypt remote #2040

olihey opened this issue Jan 31, 2018 · 1 comment

Comments

@olihey
Copy link
Contributor

olihey commented Jan 31, 2018

The documentation of the filename encryption using the standard method says a filename (and directory name) can have up to 156 characters. But I just ran into an issue with a name of 156 characters length and a crypt remote.
After some trial and error I could get up to 143 characters (see below).

C:\>rclone.exe mkdir "localenc:/Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas at elit augue. Maecenas vitae eros tempus dui mattis egestas. Sed ornare orci "
2018/01/31 18:39:06 ERROR : Attempt 1/3 failed with 1 errors and: mkdir \s2uv1i79cph8peena5qj91ir578i1ubdrokc5l03etvb6lhdebvh8pa82468net5427lsis2c3flrlb7j6kkfbnfdc0hl436buj5rgu5l6osotdpcghu0ovg404lc6od4gtt1r4tr9ihoks4vlhrckj5j3puskers364qih3tquemuf4ogud8kvce87d3odjv7a5u4ujns3jr99uikk986fhg33u932i7ooq38e4in2r6lat050fblg0lj4305qg: The filename or extension is too long.
2018/01/31 18:39:06 ERROR : Attempt 2/3 failed with 1 errors and: mkdir \s2uv1i79cph8peena5qj91ir578i1ubdrokc5l03etvb6lhdebvh8pa82468net5427lsis2c3flrlb7j6kkfbnfdc0hl436buj5rgu5l6osotdpcghu0ovg404lc6od4gtt1r4tr9ihoks4vlhrckj5j3puskers364qih3tquemuf4ogud8kvce87d3odjv7a5u4ujns3jr99uikk986fhg33u932i7ooq38e4in2r6lat050fblg0lj4305qg: The filename or extension is too long.
2018/01/31 18:39:06 ERROR : Attempt 3/3 failed with 1 errors and: mkdir \s2uv1i79cph8peena5qj91ir578i1ubdrokc5l03etvb6lhdebvh8pa82468net5427lsis2c3flrlb7j6kkfbnfdc0hl436buj5rgu5l6osotdpcghu0ovg404lc6od4gtt1r4tr9ihoks4vlhrckj5j3puskers364qih3tquemuf4ogud8kvce87d3odjv7a5u4ujns3jr99uikk986fhg33u932i7ooq38e4in2r6lat050fblg0lj4305qg: The filename or extension is too long.
2018/01/31 18:39:06 Failed to mkdir: mkdir \s2uv1i79cph8peena5qj91ir578i1ubdrokc5l03etvb6lhdebvh8pa82468net5427lsis2c3flrlb7j6kkfbnfdc0hl436buj5rgu5l6osotdpcghu0ovg404lc6od4gtt1r4tr9ihoks4vlhrckj5j3puskers364qih3tquemuf4ogud8kvce87d3odjv7a5u4ujns3jr99uikk986fhg33u932i7ooq38e4in2r6lat050fblg0lj4305qg: The filename or extension is too long.

C:\>rclone.exe mkdir "localenc:/Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas at elit augue. Maecenas vitae eros tempus dui mattis egestas. Sed ornare orci"

Maybe we should update the documentation?

Relevant .rclone.conf snippet

[local]
type = local
nounc = true

[localenc]
type = crypt
remote = local:/
filename_encryption = standard
password = sdMYVIRrPJMKUEnW-BxBAXSLMzC50O1h
password2 = S1tK9bm7Yw6fS6tUCOF2ONd7L_w

Tested with latest master

@ncw
Copy link
Member

ncw commented Jan 31, 2018

That number varies acording to exactly which remote you use. I ran rclone info secret hidden command on linux and got the same number so I agree - want to send a PR?

$ rclone mkdir secret:
$ rclone info secret:
2018/01/31 20:28:19 EME operates on 1 to 128 block-cipher blocks, you passed 513
2018/01/31 20:28:19 EME operates on 1 to 128 block-cipher blocks, you passed 257
2018/01/31 20:28:19 EME operates on 1 to 128 block-cipher blocks, you passed 129
// secret
charNeedsEscaping = []byte{
	0x00, 0x2F
}
maxFileLength = 143
canWriteUnnormalized = true
canReadUnnormalized   = true
canReadRenormalized   = false
canStream = true
$ rclone config show secret
--------------------
[secret]
type = crypt
remote = /tmp/secret
filename_encryption = standard
password = *** ENCRYPTED ***
--------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants