135 Commits

Author SHA1 Message Date
Andrew G. Morgan
3b2513a1ba Up the release version to 2.77
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-10-26 11:29:03 -07:00
Garret Kelly
da06dc98d2 Fix bug in IABGetPID
Using NewIAB ensures that common startup initialization happens before trying
to use `words`. Also switch to using IAB.good to determine if the parsed IAB
is valid.

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

Signed-off-by: Garret Kelly <gkelly@gkel.ly>
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-08-06 06:22:35 -07:00
Andrew G. Morgan
5f3e12ca39 Up the release version to 2.76
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-04-13 09:47:12 -07:00
Andrew G. Morgan
8ff33c7ffd Drop example workaround for go.dev execution.
The go.dev website was previously overzealous in rejecting source
code when preparing examples. This has now been fixed. See

  https://github.com/golang/go/issues/70611
  https://github.com/golang/go/issues/70630

for prior behavior.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-04-13 08:48:40 -07:00
Andrew G. Morgan
824333d997 Some more runnable documentation examples.
All examples so far:

https://pkg.go.dev/kernel.org/pub/linux/libs/security/libcap/cap@v1.2.76-rc3#pkg-examples

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-03-08 15:44:04 -08:00
Andrew G. Morgan
fc8a50743b Delete one cap package example that fails and add two more.
The cap.GetMode() example causes an exception on go.dev, likely because of some
system call blocking, on the website.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-03-06 09:29:39 -08:00
Andrew G. Morgan
1b436ee55e Add more live examples to the cap package documentation.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-03-05 18:55:04 -08:00
Andrew G. Morgan
f02e46a44a Up the release version to 2.75
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-03-04 08:56:39 -08:00
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