Bug 208447

Summary: Go cap package should document the cap.CHOWN etc Values
Product: Tools Reporter: Andrew G. Morgan (morgan)
Component: libcapAssignee: Andrew G. Morgan (morgan)
Status: RESOLVED CODE_FIX    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: n/a Subsystem:
Regression: No Bisected commit-id:

Description Andrew G. Morgan 2020-07-05 21:39:20 UTC
Since the list of capabilities is derived from a header with comments in it,
we should be able to extend the parsing of that header to propagate the
comments too in such a way that the Go code's auto-documentation reveals it.
Comment 1 Andrew G. Morgan 2020-07-12 14:29:59 UTC
This was "fixed" in 2.39, with a more manual solution:

https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=cae0e745e07cf8f4cabea9e293642f1e025f7eef

With some code that required the existence of the strings.ReplaceAll() function. Unfortunately, it turns out that this function is quite new, and caused the build to fail against older Go build tools. I've replaced this with a strings.Replace(...,-1) call with this post libcap-2.39 patch:

https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=ae095f0130a0c9780ad8ff560a9106a206179412