plakar icon indicating copy to clipboard operation
plakar copied to clipboard

follow symlinks in VFS layer

Open poolpOrg opened this issue 1 year ago • 2 comments

We don't want to follow symlinks during a backup, however once the VFS is built, symlinks should be honored otherwise you end up with counter-intuitive failures when browsing.

poolpOrg avatar Dec 29 '24 21:12 poolpOrg

To reproduce on OSX:

  • plakar backup /etc (which is a symlink to /private/etc)
  • the field importer.directory is /etc
  • browsing the snapshot at /etc returns an error

brmzkw avatar Jan 10 '25 13:01 brmzkw

On linux, with plakar v0.4.22-alpha, steps:

  • plakar backup /bin
  • plakar ls # note dbca776b is the hash
  • plakar restore dbca776b
  • inspect the restored bin/ folder

Notice the symlinks from /bin, are missing in the restored bin/ For example,

$ ls -al /bin/bzcmp
lrwxrwxrwx 1 root root 6 Jul  6  2021 /bin/bzcmp -> bzdiff
$ ls -al /bin/ypdomainname 
lrwxrwxrwx 1 root root 8 Jul  6  2021 /bin/ypdomainname -> hostname

# looking at the restored folder bin/
$ ls -al bin/bzcmp
ls: cannot access 'bin/bzcmp': No such file or directory
$ ls -al bin/ypdomainname 
ls: cannot access 'bin/ypdomainname': No such file or directory
$ 

glycerine avatar Feb 18 '25 02:02 glycerine

This has been fixed in a recent commit and is already part of main:

$ ./plakar ls cb:/private/etc|grep aliases
2025-02-04T16:57:51Z Lrwxr-xr-x     root    wheel     15 B aliases

$ ./plakar cat cb:/private/etc/aliases| head -5
2025-04-03T16:17:57+02:00 warn: failed to connect to agent, falling back to -no-agent
#
# Sample aliases file. Install in the location as specified by the
# output from the command "postconf alias_maps". Typical path names
# are /etc/aliases or /etc/mail/aliases.
# 

poolpOrg avatar Apr 03 '25 14:04 poolpOrg