Skip to content

Commit

Permalink
capabilities: be more graceful in resetting ambient
Browse files Browse the repository at this point in the history
Similar to when SetAmbient() can fail, runc should be graceful about
ResetAmbient failing.

This functionality previously worked under gvisor, which doesn't
implement ambient capabilities atm. The hard error on reset broke gvisor
usage.
  • Loading branch information
evanphx committed Jan 20, 2025
1 parent a7d7645 commit 216d45c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcontainer/capabilities/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (c *Caps) ApplyCaps() error {
ambs := c.caps[capability.AMBIENT]
err := capability.ResetAmbient()
if err != nil {
return fmt.Errorf("can't reset ambient capabilities: %w", err)
logrus.Warnf("can't reset ambient capabilities %s", err)
}
for _, a := range ambs {
err := capability.SetAmbient(true, a)
Expand Down

0 comments on commit 216d45c

Please sign in to comment.