diff options
author | Fabricio Voznika <fvoznika@google.com> | 2019-06-21 10:55:38 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-06-21 10:56:42 -0700 |
commit | 054b5632ef9f2ce72b4aaa32f68ecb83b1c41834 (patch) | |
tree | 1319f656cbeeb2dc4f54ef32a427e0faa57312f1 | |
parent | dc36c34a766500507e4ac90547b58b88625bbc0d (diff) |
Update comment
PiperOrigin-RevId: 254428866
-rw-r--r-- | pkg/abi/linux/capability.go | 7 | ||||
-rw-r--r-- | pkg/sentry/kernel/auth/capability_set.go | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/pkg/abi/linux/capability.go b/pkg/abi/linux/capability.go index 65dd77e6e..965f74663 100644 --- a/pkg/abi/linux/capability.go +++ b/pkg/abi/linux/capability.go @@ -60,13 +60,14 @@ const ( CAP_BLOCK_SUSPEND = Capability(36) CAP_AUDIT_READ = Capability(37) - // MaxCapability is the highest-numbered capability. - MaxCapability = CAP_AUDIT_READ + // CAP_LAST_CAP is the highest-numbered capability. + // Seach for "CAP_LAST_CAP" to find other places that need to change. + CAP_LAST_CAP = CAP_AUDIT_READ ) // Ok returns true if cp is a supported capability. func (cp Capability) Ok() bool { - return cp >= 0 && cp <= MaxCapability + return cp >= 0 && cp <= CAP_LAST_CAP } // String returns the capability name. diff --git a/pkg/sentry/kernel/auth/capability_set.go b/pkg/sentry/kernel/auth/capability_set.go index a21fa6f0f..fc8c6745c 100644 --- a/pkg/sentry/kernel/auth/capability_set.go +++ b/pkg/sentry/kernel/auth/capability_set.go @@ -24,7 +24,7 @@ import ( type CapabilitySet uint64 // AllCapabilities is a CapabilitySet containing all valid capabilities. -var AllCapabilities = CapabilitySetOf(linux.MaxCapability+1) - 1 +var AllCapabilities = CapabilitySetOf(linux.CAP_LAST_CAP+1) - 1 // CapabilitySetOf returns a CapabilitySet containing only the given // capability. |