Page MenuHomeFreeBSD

Remove asprintf from prison_add_allow
Needs ReviewPublic

Authored by jamie on Aug 21 2025, 9:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 23, 3:53 PM
Unknown Object (File)
Mon, Mar 23, 12:10 PM
Unknown Object (File)
Fri, Mar 20, 12:39 AM
Unknown Object (File)
Thu, Mar 19, 9:58 PM
Unknown Object (File)
Thu, Mar 19, 5:05 AM
Unknown Object (File)
Thu, Mar 19, 5:05 AM
Unknown Object (File)
Wed, Mar 18, 6:40 AM
Unknown Object (File)
Sun, Mar 8, 7:29 AM
Subscribers

Details

Reviewers
kevans
Group Reviewers
Jails
Summary

asprintf(9) uses as non-blocking malloc(9), which might fail. Since prison_add_allow is only ever expected in a non-blocking context, there's no reason to accept that failure.

There's no blocking or flagged version of asprintf(9), but it's no more than a simple wrapper around malloc and snprintf, so use those instead.

As a bonus, fix to it will compile without NO_SYSCTL_DESCR defined.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped