carvel-dev / carvel-dev/ytt

Remember input file permissions for when using --output-files.

Open
#625 7 comments 0 reactions 0 assignees View on GitHub
enhancement priority/unprioritized-backlog surprising to users
Dominant language
Go
Stars
1.9k
Forks
167
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem/challenge you have**

When you use ``--output-files``, files are always generated with user permissions of `rwx------` and the original user permissions are not used. Further, output files have no group/other permissions at all.

This can cause problems due to execute bits being added to files.

**Describe the solution you'd like**

Remember the user permissions for input files, and when written to disk as separate files when `--output-files` is used, keep the same user permissions.

It is arguable that the group/other permissions should also be remembered and used as well. Alternatively, at least copy user permissions to group/other, with what permissions persist for those being dependent on users umask.

At the same time directories should always be created with `0777` and allow the active umask to then modify this to remove group/other write bit for example.

**Anything else you would like to add:**

Nope.

---
Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

Contributor guide

Open the contributing guide

Research direction

Start by locating the Go entry point and tests for the --output-files option, then trace how input file modes and output directories are created. Done means separate output files preserve the intended input permissions, directories respect the active umask, and tests cover the execute-bit and group/other permission behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.