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

Create directories with 755 permissions #129

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Conversation

jimmykarily
Copy link
Contributor

because otherwise the rootfs / has permissions 755 which results in all users except "root" to not be able to login or run any commands

because otherwise the rootfs `/` has permissions 755 which results in
all users except "root" to not be able to login or run any commands

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
@jimmykarily jimmykarily self-assigned this Dec 4, 2024
@@ -72,7 +72,7 @@ func TempDir(fs v1.FS, dir, prefix string) (name string, err error) {
}
// This skips adding random stuff to the created temp dir so the temp dir created is predictable for testing
if _, isTestFs := fs.(*vfst.TestFS); isTestFs {
err = MkdirAll(fs, filepath.Join(dir, prefix), 0700)
err = MkdirAll(fs, filepath.Join(dir, prefix), 0755)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is not necessary as it's only for testing IIRC

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but doesn't hurt either, right? Better be consistent.

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 15.48%. Comparing base (5d5bd27) to head (921f757).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/utils/fs.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #129   +/-   ##
=======================================
  Coverage   15.48%   15.48%           
=======================================
  Files          10       10           
  Lines        1614     1614           
=======================================
  Hits          250      250           
  Misses       1348     1348           
  Partials       16       16           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -12,22 +12,22 @@ import (
func (d *Deployer) StepPrepNetbootDir() error {
return d.Add(opPrepareNetboot, herd.WithCallback(
func(ctx context.Context) error {
return os.MkdirAll(d.dstNetboot(), 0700)
return os.MkdirAll(d.dstNetboot(), 0755)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably use a constant for this as we do on other places, but lets fix it first

@jimmykarily jimmykarily merged commit 243b444 into main Dec 4, 2024
9 of 10 checks passed
@jimmykarily jimmykarily deleted the fix-rootfs-permissions branch December 4, 2024 14:23
jimmykarily added a commit to kairos-io/kairos that referenced this pull request Dec 4, 2024
kairos-io/AuroraBoot#129

without this, the isos we generate will not allow any non-root user to
login after installation

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
jimmykarily added a commit to kairos-io/kairos that referenced this pull request Dec 5, 2024
kairos-io/AuroraBoot#129

without this, the isos we generate will not allow any non-root user to
login after installation

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants