Page MenuHomeFreeBSD

bsdinstall: Add quotes around error message argument
ClosedPublic

Authored by thj on Jan 17 2022, 4:54 PM.
Tags
None
Referenced Files
F102417113: D33918.diff
Mon, Nov 11, 11:58 PM
Unknown Object (File)
Fri, Nov 8, 5:57 AM
Unknown Object (File)
Fri, Nov 8, 4:02 AM
Unknown Object (File)
Wed, Oct 30, 1:53 AM
Unknown Object (File)
Mon, Oct 14, 4:29 PM
Unknown Object (File)
Oct 5 2024, 7:54 AM
Unknown Object (File)
Oct 5 2024, 12:53 AM
Unknown Object (File)
Oct 2 2024, 3:11 PM
Subscribers

Details

Summary

bsdinstall: Add quotes around error message argument

When error is called with a message with spaces (and probably multiple lines)
these are passed into dialog unquoted and an error message is presented in the
form:

"Expected no more than 3 tokens for --msgbox have 9"

This has been seen on recent snapshots which also suffer from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261272

Test Plan

The following script shows the bug and the fix

	#!/bin/sh

	error()                                                                       
	{                                                                             
		dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox $1 0 0
	}                                                                             

	error_fixed()                                                                       
	{                                                                             
		dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox "$1" 0 0
	}                                                                             

	error "bug not fixed"
	read tmp
	error_fixed "bug fixed"

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43954
Build 40842: arc lint + arc unit

Event Timeline

thj requested review of this revision.Jan 17 2022, 4:54 PM

yeah, --msgbox complains "Expected no more than 3 tokens for --msgbox, have 9." or however many words there were in your error message, plus the "0 0" parameters.

It seems we just didn't encounter this very often previously.

This revision is now accepted and ready to land.Jan 17 2022, 5:03 PM

Did this end up being EN'd for currently supported RELEASE's ?

We've been seeing increasing reports of this issue for people customising the distribution list or similar