Page MenuHomeFreeBSD

bsdinstall: allow overriding DISTRIBUTIONS in the normal auto mode
ClosedPublic

Authored by brd on May 30 2022, 5:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 13 2024, 6:18 PM
Unknown Object (File)
Feb 13 2024, 6:18 PM
Unknown Object (File)
Feb 13 2024, 6:18 PM
Unknown Object (File)
Jan 14 2024, 9:44 AM
Unknown Object (File)
Jan 12 2024, 1:04 PM
Unknown Object (File)
Dec 20 2023, 3:13 AM
Unknown Object (File)
Dec 12 2023, 11:51 PM
Unknown Object (File)
Sep 27 2023, 3:16 PM
Subscribers

Diff Detail

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

Event Timeline

brd requested review of this revision.May 30 2022, 5:11 PM
dteske requested changes to this revision.May 30 2022, 5:54 PM

Changes required.

usr.sbin/bsdinstall/scripts/auto
155

The formatting here is not correct and also opens the program to a Denial-of-Service attack.

For example, were I to set "DISTRIBUTIONS" variable to "/* /*/* /*/*/* /*/*/*/*" then -- because the expansion of "${DISTRIBUTIONS:=...}" will place the wildcards into the argument scope of ":" command, cause the shell to attempt to expand all the globs which will result in massive filesystem access and hang the program.

See suggested edit for proper formatting that will also prevent Denial-of-Service

This revision now requires changes to proceed.May 30 2022, 5:54 PM

I will also note that the removal of the "export" may cause issues. There would be other acceptable solutions, such as:

export DISTRIBUTIONS="${DISTRIBUTIONS:-base.txz kernel.txz}"

Which I think I like more

usr.sbin/bsdinstall/scripts/auto
155

Current suggestion (prevent Denial-of-Service and keep export while still allowing underride)

Address feedback from dteske

brd marked 2 inline comments as done.Jun 1 2022, 3:06 PM

Aha, I got arc to do what I wanted!

Hmm, maybe I need to squash the two commits together? arc+git is kinda weird..

There we go. This looks to be all good.

This revision is now accepted and ready to land.Jun 2 2022, 5:20 PM