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
Save and restore extended attributes #25
Comments
I start working on this. |
I have xattrs for files working.
My question:
Thanks |
Why do you need a full path for reading the extended attributes? |
It works very well with relative paths, sample program here:
|
The problem is that in This relative path is evaluated in the context of the restic process, and does not coincide with the place in the backup. I either need the full path, or the path relative to the context of the restic process. |
Ah, so it's inconsistent. I understand now. Then just change the invocation of diff --git a/src/restic/archiver/archiver.go b/src/restic/archiver/archiver.go
index b579524..d95423c 100644
--- a/src/restic/archiver/archiver.go
+++ b/src/restic/archiver/archiver.go
@@ -385,7 +385,7 @@ func (arch *Archiver) dirWorker(wg *sync.WaitGroup, p *restic.Progress, done <-c
node := &restic.Node{}
if dir.Path() != "" && dir.Info() != nil {
- n, err := restic.NodeFromFileInfo(dir.Path(), dir.Info())
+ n, err := restic.NodeFromFileInfo(dir.Fullpath(), dir.Info())
if err != nil {
n.Error = err.Error()
dir.Result() <- n I have verified this change locally. |
For fuse support, I need the same thing. |
I'm sorry, but I don't understand. Why do you need the path of the (original) file/dir in the fuse code? The extended attributes are available after unmarshalling the Node from the repo, so why is the path needed? The |
I do not need the path of the original file, but the path of the file that is accessed via the fuse mount. I have added in the fuse code support for obtaining the full path name of the mounted file by adding for each file/directory a pointer to its parent, so that I can recursively traverse the tree until I reach the root. The remaining problem is that I also need the path for the selected snapshot, including the mount point. I have developed also code for this, but I am not really satisfied with it. I discovered that the snapshot dir is the first dir, (in terms of struct Dir). If I store the name of that snapshot directory, plus a pointer to the snapshots (which contains a reference to the mount point), I can obtain the full path. However, I would prefer to have a struct for the set of snapshots, and a separate one for the snapshot itself. What do you think? |
Thanks for the explanation. It's a bit hard to follow, could you push the code you already have somewhere so I can have a look? |
Sometimes things are simpler than you originally thought. Extended attribute support works now for fuse, with only a few additions to the code. |
Ok, cool! thanks for your work so far! |
This issue tracks saving and restoring extended attributes like POSIX ACL.
The text was updated successfully, but these errors were encountered: