Page MenuHomeFreeBSD

Fix jls -n (segmentation fault in powerpc64)
AbandonedPublic

Authored by fernando.valle_eldorado.org.br on Oct 29 2020, 8:11 PM.
Referenced Files
F137039656: D27013.id.diff
Fri, Nov 21, 12:59 AM
F137036018: D27013.id78922.diff
Fri, Nov 21, 12:51 AM
F137035047: D27013.diff
Fri, Nov 21, 12:49 AM
Unknown Object (File)
Mon, Nov 17, 11:57 PM
Unknown Object (File)
Mon, Nov 17, 5:11 PM
Unknown Object (File)
Mon, Nov 17, 4:20 PM
Unknown Object (File)
Sat, Nov 15, 8:41 PM
Unknown Object (File)
Thu, Nov 13, 8:01 AM

Details

Reviewers
rodrigc
allanjude
Group Reviewers
PowerPC
Summary

The tests done on /usr/tests/usr.sbin/jail were failing. The command 'jls -n' was giving segmentation fault in the last releases(13) for powerpc.

The problem happens when the quoted_print function is called with an empty value for the 'value' parameter.

In fact, if the 'value' parameter is empty, the behavior is different in powerpc (key=(null)"" (tested in an old release)) and amd64 (key=/""}""), but it should be the same.

With the correction proposed in the patch, the segmentation fault no longer occurs and the behavior is the same for powerpc and amd64 (key=""), as commented in the code 'An empty string needs quoting'.

Test Plan

cd /usr/tests/usr.sbin/jail/ && kyua test

or

jail -c name=test persist ip4.addr=192.0.1.1
jls -n

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 34483
Build 31583: arc lint + arc unit