Page MenuHomeFreeBSD

libcasper: Create a minimal cap_netdb service
AcceptedPublic

Authored by freqlabs on May 13 2020, 10:46 PM.

Details

Reviewers
oshogbo
Group Reviewers
manpages
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
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

bcr added a subscriber: bcr.

OK from manpages.

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

SHLIB_MAJOR should probably start at 1 for a new lib.

lib/libcasper/services/cap_netdb/tests/Makefile
14

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
67

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
50

if pp == NULL return ?

61

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

66

Why we start by free?

136

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
2

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