Page MenuHomeFreeBSD

libcasper: Create a minimal cap_netdb service
ClosedPublic

Authored by freqlabs on May 13 2020, 10:46 PM.
Referenced Files
Unknown Object (File)
Fri, Mar 22, 3:20 PM
Unknown Object (File)
Fri, Mar 22, 3:20 PM
Unknown Object (File)
Fri, Mar 22, 3:17 PM
Unknown Object (File)
Fri, Mar 22, 12:11 PM
Unknown Object (File)
Fri, Mar 22, 11:26 AM
Unknown Object (File)
Fri, Mar 22, 11:04 AM
Unknown Object (File)
Fri, Mar 8, 7:44 AM
Unknown Object (File)
Feb 9 2024, 12:48 PM

Details

Summary

Create a casper service for netdb functions.
Initially only cap_getprotobyname is implemented.

I'm working on capsicumizing sockstat and needed this one.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bcr added a subscriber: bcr.

OK from manpages.

kevans added inline comments.
lib/libcasper/services/cap_netdb/Makefile
10

SHLIB_MAJOR should probably start at 1 for a new lib.

lib/libcasper/services/cap_netdb/tests/Makefile
15

This test compiles fine with the default WARNS... as a matter of fact, all the casper service tests seem to compile with the default WARNS, which makes me wonder if it was for crufty GCC. This can be dropped at any rate. =-)

lib/libcasper/services/cap_netdb/tests/netdb_test.c
68

Consider spelling this as ATF_TC_WITHOUT_HEAD instead and dropping the empty ATF_TC_HEAD below.

I wonder if this should be incorporated as part of cap_net (D24688) instead?

I would prefer to commit this version. Sorry for me not responding for a while.

lib/libcasper/services/cap_netdb/cap_netdb.c
51

if pp == NULL return ?

62

Maybe we can consume nvlist_t here?
Instead of strdup just use take?

67

Why we start by free?

137

What if name won't be send?

Small nit for the copyright section of the man page.

lib/libcasper/services/cap_netdb/cap_netdb.3
3

The "All rights reserved." should be dropped.

LGTM.
Do you have commit bit or should I commit this?

This revision is now accepted and ready to land.Apr 6 2021, 8:21 AM