Page MenuHomeFreeBSD

mfiutil: Use sbuf(3) to construct drive names in mfi_drive_name
ClosedPublic

Authored by jhb on Jun 16 2025, 5:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 28, 5:15 PM
Unknown Object (File)
Fri, Sep 26, 9:21 PM
Unknown Object (File)
Fri, Sep 26, 5:00 AM
Unknown Object (File)
Thu, Sep 18, 9:21 PM
Unknown Object (File)
Jul 27 2025, 12:12 AM
Unknown Object (File)
Jul 25 2025, 9:27 PM
Unknown Object (File)
Jul 24 2025, 11:04 PM
Unknown Object (File)
Jul 24 2025, 7:01 PM
Subscribers
None

Details

Summary

This replaces fragile uses of snprintf(). Note that I did not keep
the truncation check for the space separator in the middle of the
drive name since the same check was not applied to the second part, so
the name was truncated anyway. Just truncate the entire result if it
doesn't fit.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Jun 16 2025, 5:52 PM
jhb created this revision.
usr.sbin/mfiutil/mfi_drive.c
115

Using sbuf_trim() here might be useful, but it's probably overly complex to do so.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 7 2025, 5:23 PM
This revision was automatically updated to reflect the committed changes.