BoundingSet returns the capabilities in the current bounding set
()
| 71 | |
| 72 | // BoundingSet returns the capabilities in the current bounding set |
| 73 | func BoundingSet() ([]string, error) { |
| 74 | boundingSetOnce.Do(func() { |
| 75 | currentCaps, err := capability.NewPid2(0) |
| 76 | if err != nil { |
| 77 | boundingSetErr = err |
| 78 | return |
| 79 | } |
| 80 | err = currentCaps.Load() |
| 81 | if err != nil { |
| 82 | boundingSetErr = err |
| 83 | return |
| 84 | } |
| 85 | var r []string |
| 86 | for _, c := range capsList { |
| 87 | if !currentCaps.Get(capability.BOUNDING, c) { |
| 88 | continue |
| 89 | } |
| 90 | r = append(r, getCapName(c)) |
| 91 | } |
| 92 | boundingSetRet = r |
| 93 | sort.Strings(boundingSetRet) |
| 94 | boundingSetErr = err |
| 95 | }) |
| 96 | return boundingSetRet, boundingSetErr |
| 97 | } |
| 98 | |
| 99 | // AllCapabilities returns all known capabilities. |
| 100 | func AllCapabilities() []string { |
searching dependent graphs…