Changes between Initial Version and Version 1 of Ticket #1155, comment 2


Ignore:
Timestamp:
01/20/19 00:30:32 (4 years ago)
Author:
Selva Nair
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1155, comment 2

    initial v1  
     1The purpose of this version arg is to indicate the version of the argument structs passed around in the {{{openvpn_plugin_open_v3}}} and {{{openvpn_plugin_func_v3}}} calls, so I think the code in {{{plugin.c}}} is correct. But the documentation in the header file is not. So the caller should check this version argument against {{{OPENVPN_PLUGINv3_STRUCTVER}}}.
     2
     3It would be better to rename this argument in both {{{.._open_v3()}}} and {{{..func_v3()}}} signatures from {{{version}}} to {{{structver}}} and document it as the version of the argument struct of plugin v3 structures, not that of the plugin API. In case of {{{openvpn_plugin_open_v3}}}, the doc string already states it should be matched against {{{OPENVPN_PLUGINv3_STRUCTVER}}}. The same wording should apply to {{{openvpn_plugin_func_v3}}} as well.
     4
     5That said, instead of requiring an exact match, checking that its >= certain value should be enough and that would ease the burden of keeping plugins up to date. That's how we use it in the auth-pam plugin (though only openv_v3 used there, not func_v3). If we can guarantee that structs will only be extended (offset of old members preserved), we could document it like that.
     6
     7David is the authority on this, so the rest I defer to him.