Page MenuHomeFreeBSD

reboot: Add sanity checking of write to nextboot.conf
ClosedPublic

Authored by imp on Feb 9 2024, 4:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 21, 1:12 AM
Unknown Object (File)
Mon, Oct 21, 1:12 AM
Unknown Object (File)
Mon, Oct 21, 1:12 AM
Unknown Object (File)
Mon, Oct 21, 1:12 AM
Unknown Object (File)
Mon, Oct 21, 1:12 AM
Unknown Object (File)
Sat, Oct 19, 10:36 PM
Unknown Object (File)
Fri, Oct 18, 7:30 PM
Unknown Object (File)
Fri, Oct 18, 8:25 AM
Subscribers

Details

Summary

Add sanity checking to the write to nextboot. Move to separate function
and allow force to override all errors. If we can't write nextboot.conf,
don't silently fail anymore.

Sponsored by: Netflix

Diff Detail

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

Event Timeline

imp requested review of this revision.Feb 9 2024, 4:24 PM
imp created this revision.
sbin/reboot/reboot.c
77

Since you use asprintf() anyway, why not use stdio to write the nextboot.conf? IMO it would trim a lot of convoluted code.

update per kib to use stdio directly.

This revision is now accepted and ready to land.Feb 10 2024, 12:50 AM
This revision now requires review to proceed.Feb 11 2024, 2:26 AM

Not a problem with this revision, but does this functionality work at all on ZFS? There's no use of zfsbootcfg.

sbin/reboot/reboot.c
92

Extra newline.

Not a problem with this revision, but does this functionality work at all on ZFS? There's no use of zfsbootcfg.

See later changes in the series. I may have forgotten to include you on all of them.

Not a problem with this revision, but does this functionality work at all on ZFS? There's no use of zfsbootcfg.

Never mind, I see the later patches in the series.

This revision is now accepted and ready to land.Feb 11 2024, 3:12 PM
kevans added inline comments.
sbin/reboot/reboot.c
83

Would perhaps be a bit more consistent

imp marked 2 inline comments as done.Feb 12 2024, 7:54 PM
imp added inline comments.
sbin/reboot/reboot.c
83

I overlooked this before I pushed. You are correct.