-
Notifications
You must be signed in to change notification settings - Fork 9
fix: [sc-118372] /var/lib/embedded-cluster is not exec by other non-root user #1729
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
Changes from all commits
eebfecf
c5e7097
d115dba
1d31f87
841e54a
67f728a
1bb7a9f
2ddbf46
c9fe8c3
13ebcf3
6563885
59bfc2d
98efb3c
a06c81b
80af595
646db33
67ba616
e5d2a27
acec990
fbc4e04
79db89b
048b806
c5b087f
1d7ba6a
83b1132
ce907b8
fc169e7
15d4856
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import ( | |
| "fmt" | ||
| "os" | ||
| "strings" | ||
| "syscall" | ||
|
|
||
| ecv1beta1 "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1" | ||
| "github.com/replicatedhq/embedded-cluster/pkg/addons" | ||
|
|
@@ -96,6 +97,10 @@ func preRunJoin(flags *JoinCmdFlags) error { | |
|
|
||
| flags.isAirgap = flags.airgapBundle != "" | ||
|
|
||
| // set the umask to 022 so that we can create files/directories with 755 permissions | ||
| // this does not return an error - it returns the previous umask | ||
| _ = syscall.Umask(0o022) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logrus.Debug the error |
||
|
|
||
| return nil | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import ( | |
| "errors" | ||
| "fmt" | ||
| "os" | ||
| "syscall" | ||
|
|
||
| "github.com/replicatedhq/embedded-cluster/pkg/dryrun" | ||
| "github.com/replicatedhq/embedded-cluster/pkg/metrics" | ||
|
|
@@ -68,6 +69,10 @@ func RootCmd(ctx context.Context, name string) *cobra.Command { | |
| metrics.DisableMetrics() | ||
| } | ||
|
|
||
| // set the umask to 022 so that we can create files/directories with 755 permissions | ||
| // this does not return an error - it returns the previous umask | ||
| _ = syscall.Umask(0o022) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i assume having this in root isn't sufficient, can you please add a comment to the other ones explaining why? also, are there no other commands that generate dirs and files other than install, join, and restore? what about
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll add it to the various 'main' functions, and try to come up with a better comment for it
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logrus.Debug the error
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The return value is not an error. Its the previous umask. |
||
|
|
||
| return nil | ||
| }, | ||
| PersistentPostRunE: func(cmd *cobra.Command, args []string) error { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you at the very least logrus.Debug this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't return an error, it returns the previous umask value