Page MenuHomeFreeBSD

tests: unix: add SCM_RIGHTS tests for SO_PASSRIGHTS
ClosedPublic

Authored by kevans on Thu, Jun 4, 5:05 AM.
Tags
None
Referenced Files
F160031228: D57426.id179647.diff
Sat, Jun 20, 6:13 PM
F160006658: D57426.id179647.diff
Sat, Jun 20, 11:55 AM
Unknown Object (File)
Mon, Jun 15, 5:00 PM
Unknown Object (File)
Mon, Jun 15, 2:36 PM
Unknown Object (File)
Mon, Jun 15, 2:29 PM
Unknown Object (File)
Mon, Jun 15, 2:20 PM
Unknown Object (File)
Sun, Jun 14, 8:34 PM
Unknown Object (File)
Sat, Jun 13, 2:09 PM
Subscribers

Details

Summary

We test both the standard case where we want to reject any SCM_RIGHTS
message, as well as the case where the kernel discards the unwanted file
upon receipt.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 73653
Build 70536: arc lint + arc unit

Event Timeline

kevans requested review of this revision.Thu, Jun 4, 5:05 AM
This revision is now accepted and ready to land.Mon, Jun 8, 5:53 PM

You might add a test case which checks whether the option is inherited by accept().

tests/sys/kern/unix_passfd_test.c
601
kevans marked an inline comment as done.

Add a test that SO_PASSRIGHTS isn't inherited from a listening socket. The new
test does stop just short of actually sending an fd over the socket, assuming
we won't mess up and return a false-positive in getsockopt(2)

This revision now requires review to proceed.Fri, Jun 12, 3:48 AM
markj added inline comments.
tests/sys/kern/unix_passfd_test.c
713

I'm not sure that you actually need a separate process? AFAIR connect() does not block waiting for the server to accept().

This revision is now accepted and ready to land.Fri, Jun 12, 1:45 PM
kevans marked an inline comment as done.

Simplify noinherit case- I did the dumb, unix(4) sockets won't inherently block
on connect(2).

This revision now requires review to proceed.Fri, Jun 12, 3:17 PM
This revision is now accepted and ready to land.Sat, Jun 13, 1:05 PM