Bug 208447 - Go cap package should document the cap.CHOWN etc Values
Summary: Go cap package should document the cap.CHOWN etc Values
Status: RESOLVED CODE_FIX
Alias: None
Product: Tools
Classification: Unclassified
Component: libcap (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Andrew G. Morgan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-05 21:39 UTC by Andrew G. Morgan
Modified: 2020-07-12 14:29 UTC (History)
0 users

See Also:
Kernel Version: n/a
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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

Note You need to log in before you can comment on or make changes to this bug.