127 Commits

Author SHA1 Message Date
Andrew G. Morgan
def8fab2a3 Up the release version to 2.74
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-03-02 16:09:34 -08:00
Andrew G. Morgan
805a6d3b3f Trim the examples for the cap package.
Added a couple of examples for lesser used functions: cap.Import()
and (*cap.Set) Export().

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-03-02 15:59:14 -08:00
Andrew G. Morgan
d510712a27 Clean up go documentation.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-03-02 10:02:45 -08:00
Andrew G. Morgan
2dda39e0e3 The go.dev site is unable to render this example.
As a workaround for the golang bug: 70630, specifically comment
70630#issuecomment-2513491664 provide an alias for the package.
Perhaps, at some point, that bug or the one it is duped into will
be fixed, and we can remove this workaround.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-12-26 19:26:54 -08:00
Andrew G. Morgan
6ef6a9d1e4 Up the release version to 2.73
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-12-01 20:18:58 -08:00
Andrew G. Morgan
a9a34483d8 Slightly briefer cap example.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-11-27 17:44:55 -08:00
Andrew G. Morgan
d35e7651b4 Third attempt to make a runnable example in the cap package docs.
Still trying to coax some go.dev documentation into providing runnable
examples. Iterating with a single simple one.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-11-10 20:02:36 -08:00
Andrew G. Morgan
1a02e34cc4 Up the release version to 2.72
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-11-10 15:26:15 -08:00
Andrew G. Morgan
3f109e422a Second attempt to make a runnable example in the cap package.
Trying to coax some go.dev documentation into providing runnable
examples. Starting with a single simple one.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-10-26 20:08:44 -07:00
Andrew G. Morgan
c7dbcf0bc9 Up the release version to 2.71
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-10-25 22:17:54 -07:00
Andrew G. Morgan
9e4b652f48 Lessen the situations where cap.SETPCAP is required for IAB setting.
Discussion and explanation of what is up here is in:

   https://bugzilla.kernel.org/show_bug.cgi?id=219169

This gets the Go cap package to parity with the recent changes to
libcap. This change will be live in cap/v1.2.71.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-10-19 16:37:56 -07:00
Andrew G. Morgan
30892a5d5b Add a test example.
First attempt to get the docs on go.dev to have ready to run examples.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-09-22 11:10:05 -07:00
Andrew G. Morgan
8fe536b53f Up the release version to 2.70
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2024-05-18 21:43:17 -07:00
Andrew G. Morgan
8785077d6c Tidy up the overview example for the "cap" package.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2023-05-24 06:55:47 -07:00
Andrew G. Morgan
8bed80f9b5 Up the release version to 2.69
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2023-05-14 19:10:04 -07:00
Andrew G. Morgan
3c7dda330b Up the release version to 2.68
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2023-03-25 17:03:17 -07:00
Andrew G. Morgan
5496a0e385 Tidy up some text explaining cap.NamedCaps.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2023-03-19 20:18:44 -07:00
Andrew G. Morgan
44ab72a6f9 Update documentation for all API functions.
There were a few straggler API functions in libcap and libpsx.
Also some functions that should be hidden from references outside
the library.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2023-02-19 19:43:13 -08:00
Andrew G. Morgan
34b0329dc7 Up the release version to 2.67
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2023-02-02 20:10:27 -08:00
Andrew G. Morgan
70998415a8 Reviewed license information and adde SPDX ids.
Günther Noack reported some issues with automated dependency checking in

  https://bugzilla.kernel.org/show_bug.cgi?id=216609

Perhaps these additional lines will help assist those things.

I did find a typo in pam_cap/execable.c so I've fixed that.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2022-10-19 19:05:11 -07:00
Andrew G. Morgan
4f96e6788d Up the release version to 2.66
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2022-09-24 13:37:39 -07:00
Andrew G. Morgan
a47d86dfb9 Up the release version to 2.65
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2022-07-17 15:33:06 -07:00
Andrew G. Morgan
38cfa2e958 Up the release version to 2.64
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2022-04-10 15:39:39 -07:00
Andrew G. Morgan
1d88048c31 Up the release version to 2.63
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2022-01-23 16:36:22 -08:00
Andrew G. Morgan
cc91f55960 Up the release version to 2.62
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-12-11 18:06:34 -08:00
Andrew G. Morgan
89b4b8021d Clean up cap package documentation for Launch.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-12-11 18:01:14 -08:00
Andrew G. Morgan
e458889fbd Complete launch thread exit sequence.
This should complete the fix for:

  https://bugzilla.kernel.org/show_bug.cgi?id=215283

Simplify the code, and add a test that the kernel has confirmed that
the thread is no longer running.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-12-11 14:56:07 -08:00
Andrew G. Morgan
806b53d13a Take more care post launch
Lorenz Bauer found a race condition in the cap.Launcher teardown
process and reported it here:

   https://bugzilla.kernel.org/show_bug.cgi?id=215283

This seems to significantly improve the situation. I'm going to
study the test case some more, but this is definitely part of the
solution.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-12-10 20:59:19 -08:00
Andrew G. Morgan
42555598bf Recognize default secbits of 0 as "HYBRID" mode.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-11-21 09:39:02 -08:00
Andrew G. Morgan
d63835d491 Up the release version to 2.61
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-11-20 22:20:04 -08:00
Andrew G. Morgan
e0582d0aee Prune the the.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-11-17 09:21:31 -08:00
Andrew G. Morgan
5306fa23ff Up the release version to 2.60
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-10-22 21:29:14 -07:00
Andrew G. Morgan
687dc0b8fe Unify the cap package tests for good *Set or *IAB types.
We had somewhat inconsistent checks before, so this should cut
down on corner cases to worry about.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-10-22 16:32:51 -07:00
Andrew G. Morgan
3d60128581 Concurrency fixes for *cap.Set atomicity.
Previously, the atomicity was not uniformly enforced.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-10-22 15:58:53 -07:00
Andrew G. Morgan
140fa8438b Bugfix for (*IAB).Fill() and improve atomicity of API.
Improve atomicity of Launcher and IAB use within the cap package.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-10-22 15:33:36 -07:00
Andrew G. Morgan
2ffbc9d248 Implement cap_fill_flag() and cap.FillFlag() APIs.
This API avoids a complex use case that requires substantially
more code outside of libcap.

Signed-off-by: Andrew G. Morgan <agm@google.com>
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-10-01 19:18:48 -07:00
Andrew G. Morgan
d07df10aaa Fix miscellaneous build and lint warnings.
Addresses the issues listed here:

   https://bugzilla.kernel.org/show_bug.cgi?id=214579

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-29 21:42:33 -07:00
Andrew G. Morgan
9eb56596ee Up the release version to 2.59
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-26 18:20:33 -07:00
Andrew G. Morgan
f8b7549673 Update example to avoid reference to deprecated Compare function.
In 2.54 (*Set).Compare() was deprecated in favor of (*Set).Cf(),
so update the top level comment to reflect the preferred API.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-23 20:46:31 -07:00
Andrew G. Morgan
33a6686e2b More compliant cap.Differs documentation.
Deprecation has a stylized comment format as per go.dev.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-17 21:07:19 -07:00
Andrew G. Morgan
01627eae86 Up the release version to 2.58
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-17 19:35:42 -07:00
Andrew G. Morgan
e7297c1925 More standard deprecation comment for cap.Compare and cap.IABInit
Based on what I see on go.dev, there seems to be some preferred
comment style for deprecating a function. Use it to help spread
the word.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-10 16:02:28 -07:00
Andrew G. Morgan
3906730197 Up the release version to 2.57
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-09 13:57:36 -07:00
Andrew G. Morgan
8434c10a69 Be more systematic about POSIX.1e value group names
cap.Set's have Flag component Values
cap.IAB's have Vector component Values

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-07 10:47:45 -07:00
Andrew G. Morgan
0f286b584e Up the release version to 2.56
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-02 20:03:32 -07:00
Andrew G. Morgan
2bfe36c999 Up the release version to 2.55
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-08-29 18:54:03 -07:00
Andrew G. Morgan
386af0edbc Stop installing the cap and psx packages, but do install captree.
We also add the cap.ProcRoot() API to let the user redirect to their
local /proc/ directory - in case anyone runs with an unusual setup
like that.

I've been studying the downstream package definitions and no one
it doesn't seem popular to build the Go packages. Indeed, Go folk
themselves prefer to install via modules anyway, so we're getting
with the program.

However, if folk want to build test the Go stuff as part of a package
build and run an install as well, we reward them with the 'captree'
binary.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-08-26 22:26:56 -07:00
Andrew G. Morgan
07cdff9ac9 Up the release version to 2.54
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-08-25 21:09:19 -07:00
Andrew G. Morgan
ac297b51c6 Revamp the comparison API of *Set and *IAB tuples; add IABGetPID().
Older APIs remain but are documented as deprecated. If we ever need
to release a golang version "2" version of the library, I'll drop
support for deprecated functions, but I have no intention of needing
to do that. In the mean time, the deprecated functions are wrappers
around the new functions.

New API: *Set and *IAB have .Cf() functions now. That return a
[IAB]Diff value. This value, if 0, means the compared pointers
match one another. Non-zero values can be interogated with the
([IAB]Diff).Has() functions.

Also, add an IABGetPID() function. Since the kernel provides no
syscall support for this, we have to resort to parsing the /proc/
files. Implemented mostly for parity with the syscall backed
GetPID() *Set returning API.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-08-22 14:32:12 -07:00
Andrew G. Morgan
797050ca7f Up the release version to 2.53
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-08-15 19:06:35 -07:00