Page MenuHomeFreeBSD

Restore backward compatibility for "attach" verb.
ClosedPublic

Authored by delphij on Oct 24 2018, 6:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 20 2024, 2:29 AM
Unknown Object (File)
Feb 21 2024, 10:57 PM
Unknown Object (File)
Jan 7 2024, 5:54 AM
Unknown Object (File)
Jan 7 2024, 5:54 AM
Unknown Object (File)
Dec 30 2023, 10:11 PM
Unknown Object (File)
Dec 29 2023, 6:45 PM
Unknown Object (File)
Dec 20 2023, 7:55 AM
Unknown Object (File)
Dec 13 2023, 4:36 PM
Subscribers

Details

Summary

In r332361 and r333439, two new parameters were added to geli attach
verb using gctl_get_paraml, which requires the value to be present.
This would prevent old geli(8) binary from attaching geli(4) device
as they have no knowledge about the new parameters.

Restore backward compatibility by treating the absense of these two
values as seeing the default value supplied by userland.

Test Plan

Use old geli(8) binary to attach geli(4) device.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

oshogbo requested changes to this revision.Oct 24 2018, 4:20 PM

Thanks for catching that.

sys/geom/eli/g_eli_ctl.c
63 ↗(On Diff #49547)

Assigning values here is incorrect with style(9).

87 ↗(On Diff #49547)

Do we need to get values twice?
Wouldn't it work as:

valp = gctl_get_paraml(req, "keyno", sizeof(*valp));
if (valp != NULL)
    nkey = *valp;
else
    nkey = -1;
This revision now requires changes to proceed.Oct 24 2018, 4:20 PM
delphij added inline comments.
sys/geom/eli/g_eli_ctl.c
63 ↗(On Diff #49547)

Thanks, will fix.

87 ↗(On Diff #49547)

Yes because counter-intuitively, gctl_get_paraml would set error for non-existent parameters (while gctl_get_param won't, which is (ab)used as a check for whether the parameter was supplied).

Address style(9) issues pointed out by oshogbo.

Please take another look, thanks!

This revision is now accepted and ready to land.Oct 26 2018, 7:02 PM
This revision was automatically updated to reflect the committed changes.