Skip to content

Commit

Permalink
libcontainer/keys: var should be sessKeyID/ringID (golint)
Browse files Browse the repository at this point in the history
    libcontainer/keys/keyctl.go:17:2: var `sessKeyId` should be `sessKeyID` (golint)
        sessKeyId, err := unix.KeyctlJoinSessionKeyring(name)
        ^

    libcontainer/keys/keyctl.go:27:21: func parameter `ringId` should be `ringID` (golint)
    func ModKeyringPerm(ringId KeySerial, mask, setbits uint32) error {
                        ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Jun 2, 2021
1 parent 1fb56f9 commit 3e1bcb1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libcontainer/keys/keyctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ import (
type KeySerial uint32

func JoinSessionKeyring(name string) (KeySerial, error) {
sessKeyId, err := unix.KeyctlJoinSessionKeyring(name)
sessKeyID, err := unix.KeyctlJoinSessionKeyring(name)
if err != nil {
return 0, errors.Wrap(err, "create session key")
}
return KeySerial(sessKeyId), nil
return KeySerial(sessKeyID), nil
}

// ModKeyringPerm modifies permissions on a keyring by reading the current permissions,
// anding the bits with the given mask (clearing permissions) and setting
// additional permission bits
func ModKeyringPerm(ringId KeySerial, mask, setbits uint32) error {
dest, err := unix.KeyctlString(unix.KEYCTL_DESCRIBE, int(ringId))
func ModKeyringPerm(ringID KeySerial, mask, setbits uint32) error {
dest, err := unix.KeyctlString(unix.KEYCTL_DESCRIBE, int(ringID))
if err != nil {
return err
}
Expand All @@ -43,5 +43,5 @@ func ModKeyringPerm(ringId KeySerial, mask, setbits uint32) error {

perm := (uint32(perm64) & mask) | setbits

return unix.KeyctlSetperm(int(ringId), perm)
return unix.KeyctlSetperm(int(ringID), perm)
}

0 comments on commit 3e1bcb1

Please sign in to comment.