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)
Tue, Oct 14, 4:56 AM
Unknown Object (File)
Sun, Oct 12, 11:25 AM
Unknown Object (File)
Sun, Oct 12, 11:25 AM
Unknown Object (File)
Sun, Oct 12, 12:31 AM
Unknown Object (File)
Mon, Sep 29, 11:29 PM
Unknown Object (File)
Wed, Sep 24, 12:18 PM
Unknown Object (File)
Tue, Sep 23, 7:04 PM
Unknown Object (File)
Thu, Sep 18, 4:12 PM
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