Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Olivier Vielpeau <olivielpeau@users.noreply.github.com>
  • Loading branch information
clamoriniere and olivielpeau authored Sep 17, 2020
1 parent 84ce814 commit f80a75d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/secrets/check_rights_nix.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func checkGroupPermission(stat *syscall.Stat_t, usr *user.User, userGroups []str
if fmt.Sprintf("%d", stat.Uid) == usr.Uid {
isUserFile = true
}
// If the file is not own by the user, lets check for on of his groups
// If the file is not owned by the user, let's check for one of his groups
if !isUserFile {
var isGroupFile bool
for _, userGroup := range userGroups {
Expand All @@ -76,7 +76,7 @@ func checkGroupPermission(stat *syscall.Stat_t, usr *user.User, userGroups []str

// Check that *group* can at least exec.
if stat.Mode&(syscall.S_IXGRP) == 0 {
return fmt.Errorf("invalid executable: '%s' is not readable or executable by group", path)
return fmt.Errorf("invalid executable: '%s' is not executable by group", path)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/secrets/check_rights_nix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestGroupOtherRights(t *testing.T) {

allowGroupExec = true

// event if allowGroupExec=true, group may have no permission
// even if allowGroupExec=true, group may have no permission
require.Nil(t, os.Chmod(tmpfile.Name(), 0700))
require.Nil(t, checkRights(tmpfile.Name(), allowGroupExec))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
enhancements:
- |
Add new configuration parameter to allow 'GroupExec' permission on the secret-backend command.
Set to 'true' the new parameter 'secret_backend_command_allow_group_exec_perm' to activate it.
The new parameter ('secret_backend_command_allow_group_exec_perm') is now enabled by default in the cluster-agent image.
fixes:
- |
Fix 'readsecret.sh' permission in Cluster-Agent dockerfiles that removes `other` permission.

0 comments on commit f80a75d

Please sign in to comment.