Page MenuHomeFreeBSD

unix: factor `unp_sun_path()` out of bind and connect
AcceptedPublic

Authored by inquire_JohnEricson.me on Sat, Jul 25, 8:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 6, 11:31 AM
Unknown Object (File)
Wed, Aug 5, 5:18 PM
Unknown Object (File)
Wed, Aug 5, 7:38 AM
Unknown Object (File)
Tue, Aug 4, 6:23 PM
Unknown Object (File)
Mon, Aug 3, 8:13 PM
Unknown Object (File)
Mon, Aug 3, 7:47 PM
Unknown Object (File)
Mon, Aug 3, 7:21 PM
Unknown Object (File)
Mon, Aug 3, 7:03 PM
Subscribers

Details

Reviewers
markj
kib
Summary

Extract the AF_UNIX validation plus sun_path/length lookup shared by
uipc_bindat(), unp_connect(), and unp_connectat() into a helper that
hands back the path pointer and its length. Each caller keeps its own
empty-path policy and, where needed, its own copy of the path.

Signed-off-by: John Ericson <John.Ericson@Obsidian.Systems>
Assisted-by: Claude Code (Claude Opus 4.8 and Fable 5)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
No Test Coverage
Build Status
Buildable 75132
Build 72015: arc lint + arc unit

Event Timeline

markj added inline comments.
sys/kern/uipc_usrreq.c
610

FreeBSD style puts parents around all return values.

This revision is now accepted and ready to land.Tue, Jul 28, 10:37 PM

Fix the return statement to match the style guide

This revision now requires review to proceed.Fri, Jul 31, 11:36 PM

OK I update the diff via the web form, which I noticed messes up the diff-to-diff comparison, since the base commit is gone, but hopefully that does not matter when landing this.

OK I update the diff via the web form, which I noticed messes up the diff-to-diff comparison, since the base commit is gone, but hopefully that does not matter when landing this.

It doesn't matter for landing.

For what it's worth I find it much easier to upload patches from the command-line, e.g. with git-arc: https://wiki.freebsd.org/Phabricator#Create_a_Revision_via_command_line_.28using_git-arc.29

This revision is now accepted and ready to land.Tue, Aug 4, 8:57 PM

For what it's worth I find it much easier to upload patches from the command-line, e.g. with git-arc: https://wiki.freebsd.org/Phabricator#Create_a_Revision_via_command_line_.28using_git-arc.29

OK cool I'll check that out! I do have Arcanist installed locally (I was just on a different computer when I did that small revision) but there is definitely room for improvement. I'll give you wrapper a shot.