ecryptfs does not handle symlinks within bzr
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bzr (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
ecryptfs-utils (Ubuntu) |
Invalid
|
High
|
Tyler Hicks | ||
linux (Ubuntu) |
Fix Released
|
High
|
Tim Gardner |
Bug Description
Binary package hint: ecryptfs-utils
I have an encrypted ~/Private directory. If I have a bzr tree with symlinks in it, then the bzr tree is corrupted and unusable. Attached is a tarball of a bzr tree. Here is how to reproduce:
$ tar -zxvf ./bzr_links.tar.gz
bzr_links/
bzr_links/.bzr/
bzr_links/
...
bzr_links/bar
bzr_links/foo
$ cd bzr_links/
$ bzr status
modified:
bar@
$ bzr diff
bzr: ERROR: The dirstate file (DirState(
Do the above in a non-encrypted directory (on an ext3 partition) yields:
$ tar -zxvf ./bzr_links.tar.gz
bzr_links/
bzr_links/.bzr/
bzr_links/
...
bzr_links/bar
bzr_links/foo
$ cd bzr_links/
$ bzr status
$ bzr diff
$
The bzr tree was created like so:
$ mkdir bzr_links
$ cd bzr_links
$ bzr init
$ touch foo
$ bzr add
$ bzr ci
$ ln -s foo bar
$ bzr add
$ bzr ci
$ cd ../
$ tar -zcvf ./bzr_links.tar.gz ./bzr_links
Jamie-
A few notes...
* I'm going to add bzr to the affected packages, in case those guys have an idea of what might be going on, and what this error actually means. Its possible that bzr is doing something "smart" by looking at underlying data, perhaps?
This looks to be a regression in the ecryptfs kernel code, probably introduced by the filename encryption patch.
Testing your methodology on an ecryptfs WITH filename encryption, it seems to work fine. However, WITHOUT filename encryption, symlink creation seems to break.
I'm pretty sure it has something to do with the actual creation of the symlink. If I untar the tarball in /tmp first, and then rsync -aP to my Private directory, the problem does not exist. I don't understand the difference between the way tar creates symlinks and rsync does, but whatever that difference is, seems to trigger the problem.
I'm subscribing Tyler to the bug. Hopefully he can track down the fix.
:-Dustin