Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Apr 2022 11:03:45 -0700
From:      Enji Cooper <yaneurabeya@gmail.com>
To:        Shawn Webb <shawn.webb@hardenedbsd.org>
Cc:        "Alfonso S. Siciliano" <asiciliano@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: 9b4c606b96ce - main - bsdinstall/partedit: Fix UFS auto partitioning
Message-ID:  <96AF5357-134A-4427-90C4-7DFBBCA9B1B6@gmail.com>
In-Reply-To: <20220430002011.4zpqn3l4c3wsc3vm@mutt-hbsd>
References:  <202204292324.23TNOusA058900@gitrepo.freebsd.org> <20220430002011.4zpqn3l4c3wsc3vm@mutt-hbsd>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_F5145C38-FDCB-48FF-83FB-6AA942E79810
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


> On Apr 29, 2022, at 5:20 PM, Shawn Webb <shawn.webb@hardenedbsd.org> =
wrote:
>=20
> On Fri, Apr 29, 2022 at 11:24:56PM +0000, Alfonso S. Siciliano wrote:
>> The branch main has been updated by asiciliano:
>>=20
>> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3D9b4c606b96ce8a8b011dc50295c71c38=
741a0f4f
>>=20
>> commit 9b4c606b96ce8a8b011dc50295c71c38741a0f4f
>> Author:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
>> AuthorDate: 2022-04-29 23:19:30 +0000
>> Commit:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
>> CommitDate: 2022-04-29 23:24:23 +0000
>>=20
>>    bsdinstall/partedit: Fix UFS auto partitioning
>>=20
>>    Fix bsdinstall "Auto (UFS) Guided Disk Setup" and sade(8) "Auto".
>>    The problem is a string comparison failure, it arose during the
>>    dialog(3)/bsddialog(3) form conversion:
>>=20
>>     * dialog uses only form.text while bsdialog differentiates =
between
>>       form.init and form.value.
>>     * dialog always allocates memory for form values while bsddialog =
only
>>       when a button is pressed.
>>=20
>>    Reviewed by:            bapt
>>    Differential Revision:  https://reviews.freebsd.org/D35033
>> ---
>> usr.sbin/bsdinstall/partedit/gpart_ops.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>=20
>> diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c =
b/usr.sbin/bsdinstall/partedit/gpart_ops.c
>> index 65cda247e146..26aedb58ef39 100644
>> --- a/usr.sbin/bsdinstall/partedit/gpart_ops.c
>> +++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c
>> @@ -1154,6 +1154,12 @@ addpartform:
>> 			init_allocated =3D true;
>> 			goto addpartform;
>> 		}
>> +	} else { /* auto partitioning */
>> +		items[0].value =3D strdup(items[0].init);
>> +		items[1].value =3D strdup(items[1].init);
>> +		items[2].value =3D strdup(items[2].init);
>> +		if (nitems > 3)
>> +			items[3].value =3D strdup(items[3].init);
>> 	}
>>=20
>> 	/*
>>=20
>=20
> Hey Alfonso,
>=20
> Would it be a good idea to check the return value of strdup in this
> particular case?

An assert would work here, but the program wouldn=E2=80=99t get very =
far. It would be nice if we had a macro or function that does this like =
(IIRC) some of the other BSDs do.
-Enji

--Apple-Mail=_F5145C38-FDCB-48FF-83FB-6AA942E79810
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAmJtegEACgkQ5JFNMZeD
GN7urBAAm8Nb0lHMRxqLwaLcZhUgmmavgPzMArk2/RiFkC/LSsUUxV8gs8Fk7ruQ
OvD1RGl33JW2y5siN42R9/tMQ6Q9fSs90PhMYvYaMBA/nexAF/FeFw5VON0EdbUQ
+8VuFwHk5kuajsdeTvD1GIcJWF3Mlfal5XLOtWpQHYYNn/qGLr/bUo6RBy3zO7tK
DzfF9n1vFArIKkeHjphAHAXz5EzzlrDJ1+z2OYBhJwCmtYHthkRWV6xtsUr2L7dx
uXDbtD/e0sfKCl58ZOzYAqPtDvXjXqtzextyEbSzctL80kKBhc5EwPK7I1D4sK0q
XNTXbCyFaVD2e+Tll71Txn5K6G0B7fYbssO8/BeV3ZKIR6JFsCTZO9Gl4cSBwwzi
u2UvNBYiMcwNpB6OvzqPSqRjT4VQEeSvX74lBLusk0HjZd4oovxX3GdEIpSZAca+
bFiigsiUIMYJPcyCqwE5tu4qEuH/48jSvXzwfrSxheV9EaB+sFOFjWnCIA64gHmQ
3LrybKkwx4+MrBQ6m0mHK8j2252X4EqcqrBXoD9NdHyyY2ZRJ7jG2Pm3RfQsv9NZ
9ACpUpPh5RqB16mBvmghOuyvtXxnyP8x5UUyZtpokO7fUwIqGpcmE1Nb5aVv7Bk3
DRt0hITf7a9R/hShlgAfyBOBTJ4SveNfFiWm08vjRFmNhA2D17w=
=qcXv
-----END PGP SIGNATURE-----

--Apple-Mail=_F5145C38-FDCB-48FF-83FB-6AA942E79810--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?96AF5357-134A-4427-90C4-7DFBBCA9B1B6>