encfs filename too long

Bug #1359776 reported by Gilles Schintgen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Back In Time
New
Undecided
Unassigned

Bug Description

Hi, first of all thanks for providing the ssh and ssh+encfs options in backintime!

Unfortunately I can't use the sshfs+encfs mode. I'm getting "File name too long errors". Here is an extract from the logs:

[I] Take snapshot (rsync: JA-tGYW9HxC21cPbI7smjare/eWn4krRY0gwkUKYWeFJGX9u5/x8ew-s9XxzhKAMifGBfx1wqmyR1ewULTBxj-W-ibbYcKJ-/n0lxVMEx19Izm0W4cvbMGy0w/lnNRH9CBUPvVv2rbDQxB6DpMlYcTJbYMoxeeNGFKdvbyo0/XreDMzKpTyUtrpcKxUAzLnRZgfFAeYuNVhHls2ma,Zwnj0)
[I] Take snapshot (rsync: rsync: recv_generator: failed to stat "/share/backup/backintime/UqUO2ytveGGjBq3qzGsgX6Py/F,VDzqn3,cAbylQZJNwRWWYT/yqzTd8DssQsLmqZ5pqMeXtiC/0,m,z4Xv,uVJMJMq,7ElnUsh/dvP0RHayype,rqHv0XXDYFfF/grPaOkZAp08oDalSqosv0rZ0/JA-tGYW9HxC21cPbI7smjare/eWn4krRY0gwkUKYWeFJGX9u5/x8ew-s9XxzhKAMifGBfx1wqmyR1ewULTBxj-W-ibbYcKJ-/n0lxVMEx19Izm0W4cvbMGy0w/lnNRH9CBUPvVv2rbDQxB6DpMlYcTJbYMoxeeNGFKdvbyo0/mzomOpgVLgnB2yA9l5d3VMQ6X3Nu6TFfyMHfpZiyGggUoZv7aD3of4Z2OpbVaq,VH1R-cI5,8koUqXpCUJ84KcjeIH2fdxf2REeYc-nfDgEJkmpFPiwsGIuegSej-PUtZI7N,VOBtJdY-TcIzpOmJ6USxX7o2sx6Ja73KuCwCSJBAJCzYdcC5elNRprcVwIh72ZAL8tuI7lW6K0yt,SJW5iolvpY1jKxCRPiwJZauqjNWHyWv8XZdgSZ0lInsz088v8": File name too long (36))
[E] Error: rsync: recv_generator: failed to stat "/share/backup/backintime/UqUO2ytveGGjBq3qzGsgX6Py/F,VDzqn3,cAbylQZJNwRWWYT/yqzTd8DssQsLmqZ5pqMeXtiC/0,m,z4Xv,uVJMJMq,7ElnUsh/dvP0RHayype,rqHv0XXDYFfF/grPaOkZAp08oDalSqosv0rZ0/JA-tGYW9HxC21cPbI7smjare/eWn4krRY0gwkUKYWeFJGX9u5/x8ew-s9XxzhKAMifGBfx1wqmyR1ewULTBxj-W-ibbYcKJ-/n0lxVMEx19Izm0W4cvbMGy0w/lnNRH9CBUPvVv2rbDQxB6DpMlYcTJbYMoxeeNGFKdvbyo0/mzomOpgVLgnB2yA9l5d3VMQ6X3Nu6TFfyMHfpZiyGggUoZv7aD3of4Z2OpbVaq,VH1R-cI5,8koUqXpCUJ84KcjeIH2fdxf2REeYc-nfDgEJkmpFPiwsGIuegSej-PUtZI7N,VOBtJdY-TcIzpOmJ6USxX7o2sx6Ja73KuCwCSJBAJCzYdcC5elNRprcVwIh72ZAL8tuI7lW6K0yt,SJW5iolvpY1jKxCRPiwJZauqjNWHyWv8XZdgSZ0lInsz088v8": File name too long (36)
[I] Take snapshot (rsync: JA-tGYW9HxC21cPbI7smjare/eWn4krRY0gwkUKYWeFJGX9u5/x8ew-s9XxzhKAMifGBfx1wqmyR1ewULTBxj-W-ibbYcKJ-/n0lxVMEx19Izm0W4cvbMGy0w/lnNRH9CBUPvVv2rbDQxB6DpMlYcTJbYMoxeeNGFKdvbyo0/vnneRbw8oy43kglQEyhYK5SnH9KPGmCgvis7XgPfMTeY8RKZzXCu1l8V8,hVbZSez2qKHJvtGV-ZBIHOed6msQTOZntpIHbjnV7dynYUgkkyJfPfQ4zSPACzeqwrUy7ZUrKp5PZ--qbVlWsu-uc4v0CetsSIk5aEw8IPnhhVBKVHbCxSSOv-bTt61wTquXIM9p2L1gR1AXdCdQx-7aAAaJ1Q4GlsW5sL6aU3d7gz1snCTLLikqqWO1suMojq2Y9vlB9/)
[I] Take snapshot (rsync: rsync: recv_generator: mkdir "/share/backup/backintime/UqUO2ytveGGjBq3qzGsgX6Py/F,VDzqn3,cAbylQZJNwRWWYT/yqzTd8DssQsLmqZ5pqMeXtiC/0,m,z4Xv,uVJMJMq,7ElnUsh/dvP0RHayype,rqHv0XXDYFfF/grPaOkZAp08oDalSqosv0rZ0/JA-tGYW9HxC21cPbI7smjare/eWn4krRY0gwkUKYWeFJGX9u5/x8ew-s9XxzhKAMifGBfx1wqmyR1ewULTBxj-W-ibbYcKJ-/n0lxVMEx19Izm0W4cvbMGy0w/lnNRH9CBUPvVv2rbDQxB6DpMlYcTJbYMoxeeNGFKdvbyo0/vnneRbw8oy43kglQEyhYK5SnH9KPGmCgvis7XgPfMTeY8RKZzXCu1l8V8,hVbZSez2qKHJvtGV-ZBIHOed6msQTOZntpIHbjnV7dynYUgkkyJfPfQ4zSPACzeqwrUy7ZUrKp5PZ--qbVlWsu-uc4v0CetsSIk5aEw8IPnhhVBKVHbCxSSOv-bTt61wTquXIM9p2L1gR1AXdCdQx-7aAAaJ1Q4GlsW5sL6aU3d7gz1snCTLLikqqWO1suMojq2Y9vlB9" failed: File name too long (36))
[E] Error: rsync: recv_generator: mkdir "/share/backup/backintime/UqUO2ytveGGjBq3qzGsgX6Py/F,VDzqn3,cAbylQZJNwRWWYT/yqzTd8DssQsLmqZ5pqMeXtiC/0,m,z4Xv,uVJMJMq,7ElnUsh/dvP0RHayype,rqHv0XXDYFfF/grPaOkZAp08oDalSqosv0rZ0/JA-tGYW9HxC21cPbI7smjare/eWn4krRY0gwkUKYWeFJGX9u5/x8ew-s9XxzhKAMifGBfx1wqmyR1ewULTBxj-W-ibbYcKJ-/n0lxVMEx19Izm0W4cvbMGy0w/lnNRH9CBUPvVv2rbDQxB6DpMlYcTJbYMoxeeNGFKdvbyo0/vnneRbw8oy43kglQEyhYK5SnH9KPGmCgvis7XgPfMTeY8RKZzXCu1l8V8,hVbZSez2qKHJvtGV-ZBIHOed6msQTOZntpIHbjnV7dynYUgkkyJfPfQ4zSPACzeqwrUy7ZUrKp5PZ--qbVlWsu-uc4v0CetsSIk5aEw8IPnhhVBKVHbCxSSOv-bTt61wTquXIM9p2L1gR1AXdCdQx-7aAAaJ1Q4GlsW5sL6aU3d7gz1snCTLLikqqWO1suMojq2Y9vlB9" failed: File name too long (36)
[I] Take snapshot (rsync: *** Skipping any contents from this failed directory ***)
[I] Take snapshot (rsync: JA-tGYW9HxC21cPbI7smjare/eWn4krRY0gwkUKYWeFJGX9u5/x8ew-s9XxzhKAMifGBfx1wqmyR1ewULTBxj-W-ibbYcKJ-/qVhg5WLM4Cu6-m0PjX,yBXlS/)

The backup is written to a QNAP fileserver. (linux-based; filesystem on the RAID is ext4.)
I'm using backintime 1.0.34 as provided by Ubuntu 14.04.

Here is one of the problematic path names broken up by directory/filename:
UqUO2ytveGGjBq3qzGsgX6Py/
F,VDzqn3,cAbylQZJNwRWWYT/
yqzTd8DssQsLmqZ5pqMeXtiC/
0,m,z4Xv,uVJMJMq,7ElnUsh/
dvP0RHayype,rqHv0XXDYFfF/
grPaOkZAp08oDalSqosv0rZ0/
JA-tGYW9HxC21cPbI7smjare/
eWn4krRY0gwkUKYWeFJGX9u5/
x8ew-s9XxzhKAMifGBfx1wqmyR1ewULTBxj-W-ibbYcKJ-/
n0lxVMEx19Izm0W4cvbMGy0w/
lnNRH9CBUPvVv2rbDQxB6DpMlYcTJbYMoxeeNGFKdvbyo0/
vnneRbw8oy43kglQEyhYK5SnH9KPGmCgvis7XgPfMTeY8RKZzXCu1l8V8,hVbZSez2qKHJvtGV-ZBIHOed6msQTOZntpIHbjnV7dynYUgkkyJfPfQ4zSPACzeqwrUy7ZUrKp5PZ--qbVlWsu-uc4v0CetsSIk5aEw8IPnhhVBKVHbCxSSOv-bTt61wTquXIM9p2L1gR1AXdCdQx-7aAAaJ1Q4GlsW5sL6aU3d7gz1snCTLLikqqWO1suMojq2Y9vlB9

As you can see the encrypted filename itself is 259 characters long, which exceeds the max. filename length of ext4.

Just as I'm typing this, I've found it to be an encfs bug:
https://code.google.com/p/encfs/issues/detail?id=157
Until this is fixed, the only workaround seems to be to shorten my filenames.

Revision history for this message
Gilles Schintgen (shigi) wrote :

Addendum:
Using
      find | egrep '.[^/]{200}'
(with different numeric values) I found that the longest (cleartext) file name was actually a directory name and it's less than 190 characters!
(FWIW the directory name was automatically created by Firefox while saving an offline copy of a web page.)

Revision history for this message
Germar (germar) wrote :

You could try out to manually create a new encfs config with standard settings but filename encoding set to stream.

From 'man encfs':

Filename Encoding
           New in 1.1. A choice is given between stream encoding of filename and block encoding.
           The advantage of stream encoding is that the encoded filenames will be as
           short as possible. If you have a filename with a single letter, it will be very short in the
           encoded form, where as block encoded filenames are always rounded
           up to the block size of the encryption cipher (8 bytes for Blowfish and 16 bytes for AES).

           The advantage of block encoding mode is that filename lenths all come out as a multiple
           of the cipher block size. This means that someone looking at your
           encrypted data can't tell as much about the length of your filenames. It is on by default,
           as it takes a similar amount of time to using the stream cipher.
           However stream cipher mode may be useful if you want shorter encrypted filenames for
           some reason.

           Prior to version 1.1, only stream encoding was supported.

Revision history for this message
Gilles Schintgen (shigi) wrote :

Thanks, Germar, for your reply. Unfortunately I don't see how I could tell backintime to use non-default encryption parameters without resorting to manually building a new encfs backup destination. It'd take some digging to find the parameters used by backintime and adapting them.

IMHO the default settings shouldn't fail for obscure technical reasons. Maybe the default for new encfs backups could be changed to stream encoding of filenames? Additionally a short security notecould be added informing the user that a more secure filename encryption is possible but that it artifically restricts filename length. (Maximum filename length is even further reduced due to utf-8 encoding. Bytes vs. characters)

I've also noticed that encfs has moved. So here's the updated link to the encfs issue: https://github.com/vgough/encfs/issues/7

Revision history for this message
Germar (germar) wrote :

You can create a new .encfs6.xml with these commands:
mkdir -p ~/tmp/plain
mkdir -p ~/tmp/enc
encfs --reverse ~/tmp/plain ~/tmp/enc
  - select x for expert modus
  - type 1 for AES
  - type 256 for key length
  - hit Enter for default blocksize
  - type 3 for stream-cipher
  - enter your new password twice

now you can copy the new .encfs6.xml to your destination drive and set up a new profile in BIT for this. Be careful not to override your existing .encfs6.xml as you will loose access to your current backup.

I prefer to keep default with block-cipher. This is a bug in encfs which I suspect to be fixed soon and I don't want to make users backups less secure in the meantime.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.