apache / apache/buildstream

BuildStream refuses to cache artifacts with files that have very strict permissions

Open
#429 20 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
140
Forks
45
Avg merge
1d 3h
Merged PRs (30d)
6

Description

[See original issue on GitLab](https://gitlab.com/BuildStream/buildstream/-/issues/429)
In GitLab by [[Gitlab user @tlater]](https://gitlab.com/tlater) on Jun 18, 2018, 15:24

## Summary

[//]: # (Summarize the bug encountered concisely)

When trying to build an element that produces an artifact which contains a file without write permissions, BuildStream will fail to cache the artifact.

This is particularly annoying when trying to depend on a base platform with, say, a `/etc/shadow` file.

## Steps to reproduce

[//]: # (How one can reproduce the issue - this is very important)

1. Create a simple BuildStream project.
2. Create a tarfile containing a file with its permissions set to `400`.
3. Create a `.bst` file similar to:

```yaml
kind: import
sources:
- kind: tar
base-dir: ''
url: file:///src/src/permissions.tar.gz
```

4. Attempt to build the element.

## What is the current bug behavior?

[//]: # (What actually happens)

BuildStream will fail to cache the resulting files in an artifact.

## What is the expected correct behavior?

[//]: # (What you should see instead)

BuildStream caches the resulting artifact.

## Relevant logs and/or screenshots

[//]: # (Paste any relevant logs - please use code blocks ``` to format console output, logs, and code as it's hard to read otherwise. You can also add a Snippet and link it here. Check the markdown giude on Gitlab for further tips)

The error message given when BuildStream attempts to cache:

```
[--:--:--] START [readonly.bst] : Staging sources
[00:00:00] SUCCESS [readonly.bst] : Staging sources
[--:--:--] START [readonly.bst] : Caching artifact
[00:00:00] FAILURE [readonly.bst] : Caching artifact
[00:00:00] FAILURE [readonly.bst] : Failed to commit artifact: openat(none): Permission denied
======================================================================
```

## Other relevant information

[//]: # (Add the BuildStream version. Substitute below the "x" by "1", "2" or the right version. Add more than one version if necessary)

* BuildStream version affected: /milestone %"BuildStream\_v1.1"
* BuildStream version affected: /milestone %"BuildStream\_v1.2"
* BuildStream version affected: /milestone %"BuildStream\_v1.3"

----

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with the permissions.tar.gz archive and the shown import .bst element. Trace the artifact-caching path that produces the “openat(none): Permission denied” error; done means an artifact containing a mode-400 file is cached successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.