Minggu, 01 Juli 2018, Antonio Quartulli <a...@unstable.cc> menulis:

> Hi,
>
> On 01/07/18 00:58, Greg Cox wrote:
> > While writing up a plugin, I found that the sample plugin code was using
> > openvpn_plugin_open_v1.  Since that and openvpn_plugin_func_v1 are listed
> > as 'deprecated' in openvpn-plugin.h, it made sense to me that you
> shouldn't
> > list those functions as sample code for others to clone.
> >
> > This edits only sample code and since it's my first patch I thought I'd
> > limit to that.  src/plugins/auth-pam and src/plugins/down-root have
> similar
> > 'issues', though, and may need the same treatment, if I have the right
> idea.
> >
> > Thanks for reading.
> > -Greg
> >
>
> I'd remove the last paragraph and the greetings from the commit message.
> But this might be done at commit time.
>
> > ---
> >  sample/sample-plugins/defer/simple.c    | 5 +++--
> >  sample/sample-plugins/defer/simple.def  | 4 ++--
> >  sample/sample-plugins/log/log.c         | 6 ++++--
> >  sample/sample-plugins/simple/simple.c   | 6 ++++--
> >  sample/sample-plugins/simple/simple.def | 4 ++--
> >  5 files changed, 15 insertions(+), 10 deletions(-)
> >
> > diff --git a/sample/sample-plugins/defer/simple.c
> > b/sample/sample-plugins/defer/simple.c
> > index
> > d18695b59d6966e5cc84a19e176ea9ec18d0b452..d55e47be01aa346cfc9c70aa24f872
> 2e5a1d67f9
> > 100644
> > --- a/sample/sample-plugins/defer/simple.c
> > +++ b/sample/sample-plugins/defer/simple.c
> > @@ -131,11 +131,12 @@ atoi_null0(const char *str)
> >  }
> >
> >  OPENVPN_EXPORT openvpn_plugin_handle_t
> > -openvpn_plugin_open_v1(unsigned int *type_mask, const char *argv[],
> const
> > char *envp[])
> > +openvpn_plugin_open_v2(unsigned int *type_mask, const char *argv[],
> const
> > char *envp[],
> > +                       struct openvpn_plugin_string_list **return_list)
> >  {
> >      struct plugin_context *context;
> >
> > -    printf("FUNC: openvpn_plugin_open_v1\n");
> > +    printf("FUNC: openvpn_plugin_open_v2\n");
> >
> >      /*
> >       * Allocate our context
> > diff --git a/sample/sample-plugins/defer/simple.def
> > b/sample/sample-plugins/defer/simple.def
> > index
> > a87507d1fdc0f0bfd0434de577a818ef0cc62afb..556f362308bc6ce81829253f7a7fae
> 9898be221a
> > 100755
> > --- a/sample/sample-plugins/defer/simple.def
> > +++ b/sample/sample-plugins/defer/simple.def
> > @@ -1,6 +1,6 @@
> >  LIBRARY   OpenVPN_PLUGIN_SAMPLE
> >  DESCRIPTION "Sample OpenVPN plug-in module."
> >  EXPORTS
> > -   openvpn_plugin_open_v1   @1
> > -   openvpn_plugin_func_v1   @2
> > +   openvpn_plugin_open_v2   @1
> > +   openvpn_plugin_func_v2   @2
> >     openvpn_plugin_close_v1  @3
> > diff --git a/sample/sample-plugins/log/log.c
> > b/sample/sample-plugins/log/log.c
> > index
> > ecf62c0e653c8ec852ab641e75363747b795c1af..efa8e5184db34f36a311fb61436cdf
> d61dd02f78
> > 100644
> > --- a/sample/sample-plugins/log/log.c
> > +++ b/sample/sample-plugins/log/log.c
> > @@ -70,7 +70,8 @@ get_env(const char *name, const char *envp[])
> >  }
> >
> >  OPENVPN_EXPORT openvpn_plugin_handle_t
> > -openvpn_plugin_open_v1(unsigned int *type_mask, const char *argv[],
> const
> > char *envp[])
> > +openvpn_plugin_open_v2(unsigned int *type_mask, const char *argv[],
> const
> > char *envp[],
> > +                       struct openvpn_plugin_string_list **return_list)
> >  {
> >      struct plugin_context *context;
> >
> > @@ -164,7 +165,8 @@ show(const int type, const char *argv[], const char
> > *envp[])
> >  }
> >
> >  OPENVPN_EXPORT int
> > -openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const int type,
> > const char *argv[], const char *envp[])
> > +openvpn_plugin_func_v2(openvpn_plugin_handle_t handle, const int type,
> > const char *argv[], const char *envp[],
> > +                       void *per_client_context, struct
> > openvpn_plugin_string_list **return_list)
> >  {
> >      struct plugin_context *context = (struct plugin_context *) handle;
> >
> > diff --git a/sample/sample-plugins/simple/simple.c
> > b/sample/sample-plugins/simple/simple.c
> > index
> > 950c547e22c1d44c59812eb90606fbdb52981021..66695950abfcbc6ebb0a4d4fa62162
> 7a6099ba76
> > 100644
> > --- a/sample/sample-plugins/simple/simple.c
> > +++ b/sample/sample-plugins/simple/simple.c
> > @@ -72,7 +72,8 @@ get_env(const char *name, const char *envp[])
> >  }
> >
> >  OPENVPN_EXPORT openvpn_plugin_handle_t
> > -openvpn_plugin_open_v1(unsigned int *type_mask, const char *argv[],
> const
> > char *envp[])
> > +openvpn_plugin_open_v2(unsigned int *type_mask, const char *argv[],
> const
> > char *envp[],
> > +                       struct openvpn_plugin_string_list **return_list)
> >  {
> >      struct plugin_context *context;
> >
> > @@ -97,7 +98,8 @@ openvpn_plugin_open_v1(unsigned int *type_mask, const
> > char *argv[], const char *
> >  }
> >
> >  OPENVPN_EXPORT int
> > -openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const int type,
> > const char *argv[], const char *envp[])
> > +openvpn_plugin_func_v2(openvpn_plugin_handle_t handle, const int type,
> > const char *argv[], const char *envp[],
> > +                       void *per_client_context, struct
> > openvpn_plugin_string_list **return_list)
> >  {
> >      struct plugin_context *context = (struct plugin_context *) handle;
> >
> > diff --git a/sample/sample-plugins/simple/simple.def
> > b/sample/sample-plugins/simple/simple.def
> > index
> > a87507d1fdc0f0bfd0434de577a818ef0cc62afb..556f362308bc6ce81829253f7a7fae
> 9898be221a
> > 100755
> > --- a/sample/sample-plugins/simple/simple.def
> > +++ b/sample/sample-plugins/simple/simple.def
> > @@ -1,6 +1,6 @@
> >  LIBRARY   OpenVPN_PLUGIN_SAMPLE
> >  DESCRIPTION "Sample OpenVPN plug-in module."
> >  EXPORTS
> > -   openvpn_plugin_open_v1   @1
> > -   openvpn_plugin_func_v1   @2
> > +   openvpn_plugin_open_v2   @1
> > +   openvpn_plugin_func_v2   @2
> >     openvpn_plugin_close_v1  @3
> > --
> > 2.15.2 (Apple Git-101.1)
>
> did you concatenate two patches? or what happened? It seems that the
> part after this is not recognised as proper patch.
>
>
> Cheers,
>
>
> --
> Antonio Quartulli
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to