Skip to content
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

Attic stores hard link to inaccessible file #393

Open
cestrauss opened this issue Jan 21, 2017 · 0 comments
Open

Attic stores hard link to inaccessible file #393

cestrauss opened this issue Jan 21, 2017 · 0 comments

Comments

@cestrauss
Copy link

cestrauss commented Jan 21, 2017

When there is a inaccessible file (ex. "chmod 0 file"), attic does not stores the file. However, if there is a hard link to this file, it is stored as a hard link to an unexisting file. Example:

$ mkdir work
$ echo hello > work/forbidden.txt
$ chmod 0 work/forbidden.txt 
$ ln work/forbidden.txt work/link.txt
$ attic init repo
Initializing repository at "repo"
Encryption NOT enabled.
Use the "--encryption=passphrase|keyfile" to enable encryption.
Initializing cache...
$ attic create repo::1 work
attic: work/forbidden.txt: [Errno 13] Permission denied: 'work/forbidden.txt'
attic: Exiting with failure status due to previous errors
$ attic list repo::1
drwxr-xr-x cstrauss cstrauss        0 Jan 21 16:06 work
h--------- cstrauss cstrauss        0 Jan 21 16:06 work/link.txt link to work/forbidden.txt
$ mkdir mnt
$ attic mount repo::1 mnt
Traceback (most recent call last):
  File "/usr/bin/attic", line 3, in <module>
    main()
  File "/usr/lib/python3.6/site-packages/attic/archiver.py", line 730, in main
    exit_code = archiver.run(sys.argv[1:])
  File "/usr/lib/python3.6/site-packages/attic/archiver.py", line 720, in run
    return args.func(args)
  File "/usr/lib/python3.6/site-packages/attic/archiver.py", line 262, in do_mount
    operations = AtticOperations(key, repository, manifest, archive)
  File "/usr/lib/python3.6/site-packages/attic/fuse.py", line 48, in __init__
    self.process_archive(archive)
  File "/usr/lib/python3.6/site-packages/attic/fuse.py", line 82, in process_archive
    inode = self._find_inode(item[b'source'], prefix)
  File "/usr/lib/python3.6/site-packages/attic/fuse.py", line 127, in _find_inode
    inode = self.contents[inode][segment]
KeyError: b'forbidden.txt'

$ mkdir extract
$ cd extract/
$ attic extract ../repo::1
attic: work/link.txt: [Errno 2] No such file or directory: '/tmp/attic2/extract/work/forbidden.txt' -> '/tmp/attic2/extract/work/link.txt'
attic: Exiting with failure status due to previous errors

I'm using Attic 0.16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant