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)
Wed, Apr 29, 1:25 AM
Unknown Object (File)
Wed, Apr 29, 1:20 AM
Unknown Object (File)
Sat, Apr 18, 9:42 PM
Unknown Object (File)
Sat, Apr 18, 3:35 AM
Unknown Object (File)
Thu, Apr 16, 12:14 AM
Unknown Object (File)
Fri, Apr 10, 11:21 PM
Unknown Object (File)
Mon, Apr 6, 3:49 AM
Unknown Object (File)
Sun, Apr 5, 12:02 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