Jens wrote:
> Public bug reported:
>
> When trying to create a new file with a relatively long filename (f. ex. dfkmqsdgjfmqsldjfmlsqkjlqkdmfsmgjlqlskdqshgpoizehmlqkbgmlqbgmqbdfkmqsdgjfmqsldjfmlsqkjlqkdmfsmgjlqlskdqshgpoizehmlqkbgmlqbgmqbdfkmqsdgjfmqsldjfmlsqkjlqkdmfsmgjlqlskdqshgpoizehmlqkbgmlqbgmqb.txt)
> I get an error: file name to long, when in fact the file name is not to long, but the encrypted name created for this file is to long, so, the file was not created.
Unfortunately, this is a limitation of filename encryption. The
original plaintext name must be encrypted, encoded (to be printable,
POSIX compliant filenames after encryption), and prepended with some
eCryptfs specific data. This significantly increases the filename
length when written to the lower filesystem (ext4 in your case).
>
> this is no problem when I try to create a file, but when I'm copying a
> lot of files to my home folder I get some: filename to long error's and
> it's hard to fix (first locate the file, create shorter name, move
> again)
>
> so, maybe you could create a check for to long filenames?
We do have a check and you're hitting it. :)
I'll we can do it pass along the filename to the lower filesystem, if it
says the name is too long, we return an error to userspace. I'm open to
other ideas if you have them.
>
> I'm using ext4 here...
>
> mv dfkmqsdgjfmqsldjfmlsqkjlqkdmfsmgjlqlskdqshgpoizehmlqkbgmlqbgmqbdfkmqsdgjfmqsldjfmlsqkjlqkdmfsmgjlqlskdqshgpoizehmlqkbgmlqbgmqbdfkmqsdgjfmqsldjfmlsqkjlqkdmfsmgjlqlskdqshgpoizehmlqkbgmlqbgmqb.txt /home/jens/
> mv: cannot stat `/home/jens/dfkmqsdgjfmqsldjfmlsqkjlqkdmfsmgjlqlskdqshgpoizehmlqkbgmlqbgmqbdfkmqsdgjfmqsldjfmlsqkjlqkdmfsmgjlqlskdqshgpoizehmlqkbgmlqbgmqbdfkmqsdgjfmqsldjfmlsqkjlqkdmfsmgjlqlskdqshgpoizehmlqkbgmlqbgmqb.txt': File name too long
This is probably the best we can do for this case.
Jens wrote: jfmlsqkjlqkdmfs mgjlqlskdqshgpo izehmlqkbgmlqbg mqbdfkmqsdgjfmq sldjfmlsqkjlqkd mfsmgjlqlskdqsh gpoizehmlqkbgml qbgmqbdfkmqsdgj fmqsldjfmlsqkjl qkdmfsmgjlqlskd qshgpoizehmlqkb gmlqbgmqb. txt)
> Public bug reported:
>
> When trying to create a new file with a relatively long filename (f. ex. dfkmqsdgjfmqsld
> I get an error: file name to long, when in fact the file name is not to long, but the encrypted name created for this file is to long, so, the file was not created.
Unfortunately, this is a limitation of filename encryption. The
original plaintext name must be encrypted, encoded (to be printable,
POSIX compliant filenames after encryption), and prepended with some
eCryptfs specific data. This significantly increases the filename
length when written to the lower filesystem (ext4 in your case).
>
> this is no problem when I try to create a file, but when I'm copying a
> lot of files to my home folder I get some: filename to long error's and
> it's hard to fix (first locate the file, create shorter name, move
> again)
>
> so, maybe you could create a check for to long filenames?
We do have a check and you're hitting it. :)
I'll we can do it pass along the filename to the lower filesystem, if it
says the name is too long, we return an error to userspace. I'm open to
other ideas if you have them.
> jfmlsqkjlqkdmfs mgjlqlskdqshgpo izehmlqkbgmlqbg mqbdfkmqsdgjfmq sldjfmlsqkjlqkd mfsmgjlqlskdqsh gpoizehmlqkbgml qbgmqbdfkmqsdgj fmqsldjfmlsqkjl qkdmfsmgjlqlskd qshgpoizehmlqkb gmlqbgmqb. txt /home/jens/ jens/dfkmqsdgjf mqsldjfmlsqkjlq kdmfsmgjlqlskdq shgpoizehmlqkbg mlqbgmqbdfkmqsd gjfmqsldjfmlsqk jlqkdmfsmgjlqls kdqshgpoizehmlq kbgmlqbgmqbdfkm qsdgjfmqsldjfml sqkjlqkdmfsmgjl qlskdqshgpoizeh mlqkbgmlqbgmqb. txt': File name too long
> I'm using ext4 here...
>
> mv dfkmqsdgjfmqsld
> mv: cannot stat `/home/
This is probably the best we can do for this case.
Tyler Hicks