From ee82969e5217b611137b11c8a6205ad729159d36 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 22 Oct 2024 16:28:38 -0700 Subject: [PATCH 1/2] capability: improve Apply documentation Signed-off-by: Kir Kolyshkin --- capability/capability.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/capability/capability.go b/capability/capability.go index 1b36f5f..7ab679b 100644 --- a/capability/capability.go +++ b/capability/capability.go @@ -56,8 +56,8 @@ type Capabilities interface { // outstanding changes. Load() error - // Apply apply the capabilities settings, so all changes will take - // effect. + // Apply apply the capabilities settings, so all changes made by + // [Set], [Unset], [Fill], or [Clear] will take effect. Apply(kind CapType) error } From b51fd69631fadde0522d025425f2d1c8e4a1aae2 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 22 Oct 2024 16:29:02 -0700 Subject: [PATCH 2/2] capability: improve New{File,Pid}[2] documentation Signed-off-by: Kir Kolyshkin --- capability/capability.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/capability/capability.go b/capability/capability.go index 7ab679b..aee08ed 100644 --- a/capability/capability.go +++ b/capability/capability.go @@ -64,8 +64,8 @@ type Capabilities interface { // NewPid initializes a new [Capabilities] object for given pid when // it is nonzero, or for the current process if pid is 0. // -// Deprecated: Replace with [NewPid2] followed by [Capabilities.Load]. -// For example, replace: +// Deprecated: replace with [NewPid2] followed by optional [Capabilities.Load] +// (only if needed). For example, replace: // // c, err := NewPid(0) // if err != nil { @@ -93,16 +93,16 @@ func NewPid(pid int) (Capabilities, error) { // NewPid2 initializes a new [Capabilities] object for given pid when // it is nonzero, or for the current process if pid is 0. This -// does not load the process's current capabilities; to do that you -// must call [Capabilities.Load] explicitly. +// does not load the process's current capabilities; if needed, +// call [Capabilities.Load]. func NewPid2(pid int) (Capabilities, error) { return newPid(pid) } // NewFile initializes a new Capabilities object for given file path. // -// Deprecated: Replace with [NewFile2] followed by [Capabilities.Load]. -// For example, replace: +// Deprecated: replace with [NewFile2] followed by optional [Capabilities.Load] +// (only if needed). For example, replace: // // c, err := NewFile(path) // if err != nil { @@ -130,7 +130,7 @@ func NewFile(path string) (Capabilities, error) { // NewFile2 creates a new initialized [Capabilities] object for given // file path. This does not load the process's current capabilities; -// to do that you must call [Capabilities.Load] explicitly. +// if needed, call [Capabilities.Load]. func NewFile2(path string) (Capabilities, error) { return newFile(path) }