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

Hardlinks fuse mount breaks when script links files #1399

Open
Cynical-Optimist opened this issue Oct 14, 2020 · 3 comments
Open

Hardlinks fuse mount breaks when script links files #1399

Cynical-Optimist opened this issue Oct 14, 2020 · 3 comments

Comments

@Cynical-Optimist
Copy link

See original issue on GitLab
In GitLab by [Gitlab user @valentindavid] on Oct 2, 2020, 09:22

Summary

The way hardlinks copies linked files does not work when the file is not readable.

This was tested with 1.6.

The use case covers unpacking cpio files and install rpm files, when there are linked files. Linked files in packages are quite common, specially in toolchain packages.

Steps to reproduce

Consider the following:

kind: script

build-depends:
- freedesktop-sdk.bst:bootstrap-import.bst

config:
  commands:
  - touch /a
  - chmod 0000 /a
  - ln /a /b
  - chmod 0755 /a

This fails with:

chmod 0755 /a
chmod: changing permissions of '/a': Permission denied

The reason is that the fuse fs wants to copy /a. But it is not readable.

At no point did hardlinks have any reason to copy /a, because the file is safe as it does not link to the read only file.

Possible fixes

Before copying a file with multiple links, we should make sure whether this file is safe. If it is, there is no reason to copy it. One way to know if a file is safe could be to add a special extended attribute to it.

Other relevant information

  • BuildStream version affected: /milestone %"BuildStream_v1.6"

@Cynical-Optimist
Copy link
Author

In GitLab by [Gitlab user @valentindavid] on Oct 2, 2020, 09:22

changed title from Hardlinks fuse mount {-has improper linking-} to Hardlinks fuse mount {+breaks when script links files+}

@Cynical-Optimist
Copy link
Author

In GitLab by [Gitlab user @valentindavid] on Oct 2, 2020, 10:45

changed the description

1 similar comment
@Cynical-Optimist
Copy link
Author

In GitLab by [Gitlab user @valentindavid] on Oct 2, 2020, 10:45

changed the description

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