Page MenuHomeFreeBSD

Restore backward compatibility for "attach" verb.
ClosedPublic

Authored by delphij on Oct 24 2018, 6:39 AM.
Tags
None
Referenced Files
F82795618: D17680.diff
Thu, May 2, 4:14 PM
Unknown Object (File)
Tue, Apr 30, 10:45 AM
Unknown Object (File)
Tue, Apr 30, 10:30 AM
Unknown Object (File)
Tue, Apr 30, 5:11 AM
Unknown Object (File)
Mon, Apr 29, 8:06 PM
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
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 Passed
Unit
No Test Coverage
Build Status
Buildable 20440
Build 19878: arc lint + arc unit

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

Assigning values here is incorrect with style(9).

87

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

Thanks, will fix.

87

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.