HasCapabilityOnFile returns true if creds has the given capability with respect to a file with the given owning UID and GID, consistent with Linux's kernel/capability.c:capable_wrt_inode_uidgid().
(cp linux.Capability, kuid KUID, kgid KGID)
| 228 | // respect to a file with the given owning UID and GID, consistent with Linux's |
| 229 | // kernel/capability.c:capable_wrt_inode_uidgid(). |
| 230 | func (c *Credentials) HasCapabilityOnFile(cp linux.Capability, kuid KUID, kgid KGID) bool { |
| 231 | return c.HasSelfCapability(cp) && c.UserNamespace.MapFromKUID(kuid).Ok() && c.UserNamespace.MapFromKGID(kgid).Ok() |
| 232 | } |
| 233 | |
| 234 | // UseUID checks that c can use uid in its user namespace, then translates it |
| 235 | // to the root user namespace. |
no test coverage detected