Message ID | CACDCbPo_kdRDHe7-zJZnELyBGBpLEan=hKv6ScTHzE1KT=inzg@mail.gmail.com |
---|---|
State | Changes Requested |
Delegated to: | David Sommerseth |
Headers | show |
Series | [Openvpn-devel] Remove deprecated plugin functions from code samples | expand |
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..d55e47be01aa346cfc9c70aa24f8722e5a1d67f9 > 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..556f362308bc6ce81829253f7a7fae9898be221a > 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..efa8e5184db34f36a311fb61436cdfd61dd02f78 > 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..66695950abfcbc6ebb0a4d4fa621627a6099ba76 > 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..556f362308bc6ce81829253f7a7fae9898be221a > 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,
Hi, On Sun, Jul 01, 2018 at 01:49:26AM +0800, Antonio Quartulli wrote: [..] > did you concatenate two patches? or what happened? It seems that the > part after this is not recognised as proper patch. If the patch gets an ACK otherwise, I can (usually) fix this on commit. gert
On Sat, Jun 30, 2018 at 5:49 PM, Antonio Quartulli <a@unstable.cc> wrote: > I'd remove the last paragraph and the greetings from the commit message. > But this might be done at commit time. > It was unclear how to handle "explain what I'm wanting" in one mail. Sorry. > did you concatenate two patches? or what happened? It seems that the > part after this is not recognised as proper patch. > I think I dropped a few lines from `git format-patch HEAD~1 --stdout` on accident. Take two: From 2f221fe6111572dc897dc91cfd9ad4929df478ec Mon Sep 17 00:00:00 2001 From: Greg Cox <gcox@mozilla.com> Date: Fri, 29 Jun 2018 21:53:54 +0000 Subject: [PATCH] Remove deprecated plugin functions from code samples --- 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..d55e47be01aa346cfc9c70aa24f8722e5a1d67f9 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..556f362308bc6ce81829253f7a7fae9898be221a 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..efa8e5184db34f36a311fb61436cdfd61dd02f78 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..66695950abfcbc6ebb0a4d4fa621627a6099ba76 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..556f362308bc6ce81829253f7a7fae9898be221a 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) <div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 30, 2018 at 5:49 PM, Antonio Quartulli <span dir="ltr"><<a href="mailto:a@unstable.cc" target="_blank">a@unstable.cc</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'd remove the last paragraph and the greetings from the commit message.<br> But this might be done at commit time.<br></blockquote><div><br></div><div style="font-family:courier new,monospace" class="gmail_default">It was unclear how to handle "explain what I'm wanting" in one mail. Sorry.<br></div><div style="font-family:courier new,monospace" class="gmail_default"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">did you concatenate two patches? or what happened? It seems that the<br> part after this is not recognised as proper patch.<br></blockquote><div> </div><div style="font-family:courier new,monospace" class="gmail_default">I think I dropped a few lines from `git format-patch HEAD~1 --stdout` on accident. Take two:</div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><div style="font-family:courier new,monospace" class="gmail_default">From 2f221fe6111572dc897dc91cfd9ad4929df478ec Mon Sep 17 00:00:00 2001<br>From: Greg Cox <<a href="mailto:gcox@mozilla.com">gcox@mozilla.com</a>><br>Date: Fri, 29 Jun 2018 21:53:54 +0000<br>Subject: [PATCH] Remove deprecated plugin functions from code samples<br><br>---<br> sample/sample-plugins/defer/simple.c | 5 +++--<br> sample/sample-plugins/defer/simple.def | 4 ++--<br> sample/sample-plugins/log/log.c | 6 ++++--<br> sample/sample-plugins/simple/simple.c | 6 ++++--<br> sample/sample-plugins/simple/simple.def | 4 ++--<br> 5 files changed, 15 insertions(+), 10 deletions(-)<br><br>diff --git a/sample/sample-plugins/defer/simple.c b/sample/sample-plugins/defer/simple.c<br>index d18695b59d6966e5cc84a19e176ea9ec18d0b452..d55e47be01aa346cfc9c70aa24f8722e5a1d67f9 100644<br>--- a/sample/sample-plugins/defer/simple.c<br>+++ b/sample/sample-plugins/defer/simple.c<br>@@ -131,11 +131,12 @@ atoi_null0(const char *str)<br> }<br><br> OPENVPN_EXPORT openvpn_plugin_handle_t<br>-openvpn_plugin_open_v1(unsigned int *type_mask, const char *argv[], const char *envp[])<br>+openvpn_plugin_open_v2(unsigned int *type_mask, const char *argv[], const char *envp[],<br>+ struct openvpn_plugin_string_list **return_list)<br> {<br> struct plugin_context *context;<br><br>- printf("FUNC: openvpn_plugin_open_v1\n");<br>+ printf("FUNC: openvpn_plugin_open_v2\n");<br><br> /*<br> * Allocate our context<br>diff --git a/sample/sample-plugins/defer/simple.def b/sample/sample-plugins/defer/simple.def<br>index a87507d1fdc0f0bfd0434de577a818ef0cc62afb..556f362308bc6ce81829253f7a7fae9898be221a 100755<br>--- a/sample/sample-plugins/defer/simple.def<br>+++ b/sample/sample-plugins/defer/simple.def<br>@@ -1,6 +1,6 @@<br> LIBRARY OpenVPN_PLUGIN_SAMPLE<br> DESCRIPTION "Sample OpenVPN plug-in module."<br> EXPORTS<br>- openvpn_plugin_open_v1 @1<br>- openvpn_plugin_func_v1 @2<br>+ openvpn_plugin_open_v2 @1<br>+ openvpn_plugin_func_v2 @2<br> openvpn_plugin_close_v1 @3<br>diff --git a/sample/sample-plugins/log/log.c b/sample/sample-plugins/log/log.c<br>index ecf62c0e653c8ec852ab641e75363747b795c1af..efa8e5184db34f36a311fb61436cdfd61dd02f78 100644<br>--- a/sample/sample-plugins/log/log.c<br>+++ b/sample/sample-plugins/log/log.c<br>@@ -70,7 +70,8 @@ get_env(const char *name, const char *envp[])<br> }<br><br> OPENVPN_EXPORT openvpn_plugin_handle_t<br>-openvpn_plugin_open_v1(unsigned int *type_mask, const char *argv[], const char *envp[])<br>+openvpn_plugin_open_v2(unsigned int *type_mask, const char *argv[], const char *envp[],<br>+ struct openvpn_plugin_string_list **return_list)<br> {<br> struct plugin_context *context;<br><br>@@ -164,7 +165,8 @@ show(const int type, const char *argv[], const char *envp[])<br> }<br><br> OPENVPN_EXPORT int<br>-openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[])<br>+openvpn_plugin_func_v2(openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[],<br>+ void *per_client_context, struct openvpn_plugin_string_list **return_list)<br> {<br> struct plugin_context *context = (struct plugin_context *) handle;<br><br>diff --git a/sample/sample-plugins/simple/simple.c b/sample/sample-plugins/simple/simple.c<br>index 950c547e22c1d44c59812eb90606fbdb52981021..66695950abfcbc6ebb0a4d4fa621627a6099ba76 100644<br>--- a/sample/sample-plugins/simple/simple.c<br>+++ b/sample/sample-plugins/simple/simple.c<br>@@ -72,7 +72,8 @@ get_env(const char *name, const char *envp[])<br> }<br><br> OPENVPN_EXPORT openvpn_plugin_handle_t<br>-openvpn_plugin_open_v1(unsigned int *type_mask, const char *argv[], const char *envp[])<br>+openvpn_plugin_open_v2(unsigned int *type_mask, const char *argv[], const char *envp[],<br>+ struct openvpn_plugin_string_list **return_list)<br> {<br> struct plugin_context *context;<br><br>@@ -97,7 +98,8 @@ openvpn_plugin_open_v1(unsigned int *type_mask, const char *argv[], const char *<br> }<br><br> OPENVPN_EXPORT int<br>-openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[])<br>+openvpn_plugin_func_v2(openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[],<br>+ void *per_client_context, struct openvpn_plugin_string_list **return_list)<br> {<br> struct plugin_context *context = (struct plugin_context *) handle;<br><br>diff --git a/sample/sample-plugins/simple/simple.def b/sample/sample-plugins/simple/simple.def<br>index a87507d1fdc0f0bfd0434de577a818ef0cc62afb..556f362308bc6ce81829253f7a7fae9898be221a 100755<br>--- a/sample/sample-plugins/simple/simple.def<br>+++ b/sample/sample-plugins/simple/simple.def<br>@@ -1,6 +1,6 @@<br> LIBRARY OpenVPN_PLUGIN_SAMPLE<br> DESCRIPTION "Sample OpenVPN plug-in module."<br> EXPORTS<br>- openvpn_plugin_open_v1 @1<br>- openvpn_plugin_func_v1 @2<br>+ openvpn_plugin_open_v2 @1<br>+ openvpn_plugin_func_v2 @2<br> openvpn_plugin_close_v1 @3<br>--<br>2.15.2 (Apple Git-101.1)<br><br></div><br></div></div></div> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
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 > > <br><br>Minggu, 01 Juli 2018, Antonio Quartulli <a@unstable.cc> menulis:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br> <br> On 01/07/18 00:58, Greg Cox wrote:<br> > While writing up a plugin, I found that the sample plugin code was using<br> > openvpn_plugin_open_v1. Since that and openvpn_plugin_func_v1 are listed<br> > as 'deprecated' in openvpn-plugin.h, it made sense to me that you shouldn't<br> > list those functions as sample code for others to clone.<br> > <br> > This edits only sample code and since it's my first patch I thought I'd<br> > limit to that. src/plugins/auth-pam and src/plugins/down-root have similar<br> > 'issues', though, and may need the same treatment, if I have the right idea.<br> > <br> > Thanks for reading.<br> > -Greg<br> > <br> <br> I'd remove the last paragraph and the greetings from the commit message.<br> But this might be done at commit time.<br> <br> > ---<br> > sample/sample-plugins/defer/<wbr>simple.c | 5 +++--<br> > sample/sample-plugins/defer/<wbr>simple.def | 4 ++--<br> > sample/sample-plugins/log/log.<wbr>c | 6 ++++--<br> > sample/sample-plugins/simple/<wbr>simple.c | 6 ++++--<br> > sample/sample-plugins/simple/<wbr>simple.def | 4 ++--<br> > 5 files changed, 15 insertions(+), 10 deletions(-)<br> > <br> > diff --git a/sample/sample-plugins/defer/<wbr>simple.c<br> > b/sample/sample-plugins/defer/<wbr>simple.c<br> > index<br> > d18695b59d6966e5cc84a19e176ea9<wbr>ec18d0b452..<wbr>d55e47be01aa346cfc9c70aa24f872<wbr>2e5a1d67f9<br> > 100644<br> > --- a/sample/sample-plugins/defer/<wbr>simple.c<br> > +++ b/sample/sample-plugins/defer/<wbr>simple.c<br> > @@ -131,11 +131,12 @@ atoi_null0(const char *str)<br> > }<br> > <br> > OPENVPN_EXPORT openvpn_plugin_handle_t<br> > -openvpn_plugin_open_v1(<wbr>unsigned int *type_mask, const char *argv[], const<br> > char *envp[])<br> > +openvpn_plugin_open_v2(<wbr>unsigned int *type_mask, const char *argv[], const<br> > char *envp[],<br> > + struct openvpn_plugin_string_list **return_list)<br> > {<br> > struct plugin_context *context;<br> > <br> > - printf("FUNC: openvpn_plugin_open_v1\n");<br> > + printf("FUNC: openvpn_plugin_open_v2\n");<br> > <br> > /*<br> > * Allocate our context<br> > diff --git a/sample/sample-plugins/defer/<wbr>simple.def<br> > b/sample/sample-plugins/defer/<wbr>simple.def<br> > index<br> > a87507d1fdc0f0bfd0434de577a818<wbr>ef0cc62afb..<wbr>556f362308bc6ce81829253f7a7fae<wbr>9898be221a<br> > 100755<br> > --- a/sample/sample-plugins/defer/<wbr>simple.def<br> > +++ b/sample/sample-plugins/defer/<wbr>simple.def<br> > @@ -1,6 +1,6 @@<br> > LIBRARY OpenVPN_PLUGIN_SAMPLE<br> > DESCRIPTION "Sample OpenVPN plug-in module."<br> > EXPORTS<br> > - openvpn_plugin_open_v1 @1<br> > - openvpn_plugin_func_v1 @2<br> > + openvpn_plugin_open_v2 @1<br> > + openvpn_plugin_func_v2 @2<br> > openvpn_plugin_close_v1 @3<br> > diff --git a/sample/sample-plugins/log/<wbr>log.c<br> > b/sample/sample-plugins/log/<wbr>log.c<br> > index<br> > ecf62c0e653c8ec852ab641e753637<wbr>47b795c1af..<wbr>efa8e5184db34f36a311fb61436cdf<wbr>d61dd02f78<br> > 100644<br> > --- a/sample/sample-plugins/log/<wbr>log.c<br> > +++ b/sample/sample-plugins/log/<wbr>log.c<br> > @@ -70,7 +70,8 @@ get_env(const char *name, const char *envp[])<br> > }<br> > <br> > OPENVPN_EXPORT openvpn_plugin_handle_t<br> > -openvpn_plugin_open_v1(<wbr>unsigned int *type_mask, const char *argv[], const<br> > char *envp[])<br> > +openvpn_plugin_open_v2(<wbr>unsigned int *type_mask, const char *argv[], const<br> > char *envp[],<br> > + struct openvpn_plugin_string_list **return_list)<br> > {<br> > struct plugin_context *context;<br> > <br> > @@ -164,7 +165,8 @@ show(const int type, const char *argv[], const char<br> > *envp[])<br> > }<br> > <br> > OPENVPN_EXPORT int<br> > -openvpn_plugin_func_v1(<wbr>openvpn_plugin_handle_t handle, const int type,<br> > const char *argv[], const char *envp[])<br> > +openvpn_plugin_func_v2(<wbr>openvpn_plugin_handle_t handle, const int type,<br> > const char *argv[], const char *envp[],<br> > + void *per_client_context, struct<br> > openvpn_plugin_string_list **return_list)<br> > {<br> > struct plugin_context *context = (struct plugin_context *) handle;<br> > <br> > diff --git a/sample/sample-plugins/<wbr>simple/simple.c<br> > b/sample/sample-plugins/<wbr>simple/simple.c<br> > index<br> > 950c547e22c1d44c59812eb90606fb<wbr>db52981021..<wbr>66695950abfcbc6ebb0a4d4fa62162<wbr>7a6099ba76<br> > 100644<br> > --- a/sample/sample-plugins/<wbr>simple/simple.c<br> > +++ b/sample/sample-plugins/<wbr>simple/simple.c<br> > @@ -72,7 +72,8 @@ get_env(const char *name, const char *envp[])<br> > }<br> > <br> > OPENVPN_EXPORT openvpn_plugin_handle_t<br> > -openvpn_plugin_open_v1(<wbr>unsigned int *type_mask, const char *argv[], const<br> > char *envp[])<br> > +openvpn_plugin_open_v2(<wbr>unsigned int *type_mask, const char *argv[], const<br> > char *envp[],<br> > + struct openvpn_plugin_string_list **return_list)<br> > {<br> > struct plugin_context *context;<br> > <br> > @@ -97,7 +98,8 @@ openvpn_plugin_open_v1(<wbr>unsigned int *type_mask, const<br> > char *argv[], const char *<br> > }<br> > <br> > OPENVPN_EXPORT int<br> > -openvpn_plugin_func_v1(<wbr>openvpn_plugin_handle_t handle, const int type,<br> > const char *argv[], const char *envp[])<br> > +openvpn_plugin_func_v2(<wbr>openvpn_plugin_handle_t handle, const int type,<br> > const char *argv[], const char *envp[],<br> > + void *per_client_context, struct<br> > openvpn_plugin_string_list **return_list)<br> > {<br> > struct plugin_context *context = (struct plugin_context *) handle;<br> > <br> > diff --git a/sample/sample-plugins/<wbr>simple/simple.def<br> > b/sample/sample-plugins/<wbr>simple/simple.def<br> > index<br> > a87507d1fdc0f0bfd0434de577a818<wbr>ef0cc62afb..<wbr>556f362308bc6ce81829253f7a7fae<wbr>9898be221a<br> > 100755<br> > --- a/sample/sample-plugins/<wbr>simple/simple.def<br> > +++ b/sample/sample-plugins/<wbr>simple/simple.def<br> > @@ -1,6 +1,6 @@<br> > LIBRARY OpenVPN_PLUGIN_SAMPLE<br> > DESCRIPTION "Sample OpenVPN plug-in module."<br> > EXPORTS<br> > - openvpn_plugin_open_v1 @1<br> > - openvpn_plugin_func_v1 @2<br> > + openvpn_plugin_open_v2 @1<br> > + openvpn_plugin_func_v2 @2<br> > openvpn_plugin_close_v1 @3<br> > --<br> > 2.15.2 (Apple Git-101.1)<br> <br> did you concatenate two patches? or what happened? It seems that the<br> part after this is not recognised as proper patch.<br> <br> <br> Cheers,<br> <br> <br> -- <br> Antonio Quartulli<br> <br> </blockquote> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Minggu, 01 Juli 2018, Yovie Ramadhan <ramadhanyovie99@gmail.com> menulis: > > > 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..d55e47be01aa346cfc >> 9c70aa24f8722e5a1d67f9 >> > 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..556f362308bc6ce818 >> 29253f7a7fae9898be221a >> > 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..efa8e5184db34f36a3 >> 11fb61436cdfd61dd02f78 >> > 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..66695950abfcbc6ebb >> 0a4d4fa621627a6099ba76 >> > 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..556f362308bc6ce818 >> 29253f7a7fae9898be221a >> > 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 >> >> <br><br>Minggu, 01 Juli 2018, Yovie Ramadhan <<a href="mailto:ramadhanyovie99@gmail.com">ramadhanyovie99@gmail.com</a>> menulis:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br>Minggu, 01 Juli 2018, Antonio Quartulli <a@unstable.cc> menulis:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br> <br> On 01/07/18 00:58, Greg Cox wrote:<br> > While writing up a plugin, I found that the sample plugin code was using<br> > openvpn_plugin_open_v1. Since that and openvpn_plugin_func_v1 are listed<br> > as 'deprecated' in openvpn-plugin.h, it made sense to me that you shouldn't<br> > list those functions as sample code for others to clone.<br> > <br> > This edits only sample code and since it's my first patch I thought I'd<br> > limit to that. src/plugins/auth-pam and src/plugins/down-root have similar<br> > 'issues', though, and may need the same treatment, if I have the right idea.<br> > <br> > Thanks for reading.<br> > -Greg<br> > <br> <br> I'd remove the last paragraph and the greetings from the commit message.<br> But this might be done at commit time.<br> <br> > ---<br> > sample/sample-plugins/defer/si<wbr>mple.c | 5 +++--<br> > sample/sample-plugins/defer/si<wbr>mple.def | 4 ++--<br> > sample/sample-plugins/log/log.<wbr>c | 6 ++++--<br> > sample/sample-plugins/simple/s<wbr>imple.c | 6 ++++--<br> > sample/sample-plugins/simple/s<wbr>imple.def | 4 ++--<br> > 5 files changed, 15 insertions(+), 10 deletions(-)<br> > <br> > diff --git a/sample/sample-plugins/defer/<wbr>simple.c<br> > b/sample/sample-plugins/defer/<wbr>simple.c<br> > index<br> > d18695b59d6966e5cc84a19e176ea9<wbr>ec18d0b452..d55e47be01aa346cfc<wbr>9c70aa24f8722e5a1d67f9<br> > 100644<br> > --- a/sample/sample-plugins/defer/<wbr>simple.c<br> > +++ b/sample/sample-plugins/defer/<wbr>simple.c<br> > @@ -131,11 +131,12 @@ atoi_null0(const char *str)<br> > }<br> > <br> > OPENVPN_EXPORT openvpn_plugin_handle_t<br> > -openvpn_plugin_open_v1(unsign<wbr>ed int *type_mask, const char *argv[], const<br> > char *envp[])<br> > +openvpn_plugin_open_v2(unsign<wbr>ed int *type_mask, const char *argv[], const<br> > char *envp[],<br> > + struct openvpn_plugin_string_list **return_list)<br> > {<br> > struct plugin_context *context;<br> > <br> > - printf("FUNC: openvpn_plugin_open_v1\n");<br> > + printf("FUNC: openvpn_plugin_open_v2\n");<br> > <br> > /*<br> > * Allocate our context<br> > diff --git a/sample/sample-plugins/defer/<wbr>simple.def<br> > b/sample/sample-plugins/defer/<wbr>simple.def<br> > index<br> > a87507d1fdc0f0bfd0434de577a818<wbr>ef0cc62afb..556f362308bc6ce818<wbr>29253f7a7fae9898be221a<br> > 100755<br> > --- a/sample/sample-plugins/defer/<wbr>simple.def<br> > +++ b/sample/sample-plugins/defer/<wbr>simple.def<br> > @@ -1,6 +1,6 @@<br> > LIBRARY OpenVPN_PLUGIN_SAMPLE<br> > DESCRIPTION "Sample OpenVPN plug-in module."<br> > EXPORTS<br> > - openvpn_plugin_open_v1 @1<br> > - openvpn_plugin_func_v1 @2<br> > + openvpn_plugin_open_v2 @1<br> > + openvpn_plugin_func_v2 @2<br> > openvpn_plugin_close_v1 @3<br> > diff --git a/sample/sample-plugins/log/lo<wbr>g.c<br> > b/sample/sample-plugins/log/lo<wbr>g.c<br> > index<br> > ecf62c0e653c8ec852ab641e753637<wbr>47b795c1af..efa8e5184db34f36a3<wbr>11fb61436cdfd61dd02f78<br> > 100644<br> > --- a/sample/sample-plugins/log/lo<wbr>g.c<br> > +++ b/sample/sample-plugins/log/lo<wbr>g.c<br> > @@ -70,7 +70,8 @@ get_env(const char *name, const char *envp[])<br> > }<br> > <br> > OPENVPN_EXPORT openvpn_plugin_handle_t<br> > -openvpn_plugin_open_v1(unsign<wbr>ed int *type_mask, const char *argv[], const<br> > char *envp[])<br> > +openvpn_plugin_open_v2(unsign<wbr>ed int *type_mask, const char *argv[], const<br> > char *envp[],<br> > + struct openvpn_plugin_string_list **return_list)<br> > {<br> > struct plugin_context *context;<br> > <br> > @@ -164,7 +165,8 @@ show(const int type, const char *argv[], const char<br> > *envp[])<br> > }<br> > <br> > OPENVPN_EXPORT int<br> > -openvpn_plugin_func_v1(openvp<wbr>n_plugin_handle_t handle, const int type,<br> > const char *argv[], const char *envp[])<br> > +openvpn_plugin_func_v2(openvp<wbr>n_plugin_handle_t handle, const int type,<br> > const char *argv[], const char *envp[],<br> > + void *per_client_context, struct<br> > openvpn_plugin_string_list **return_list)<br> > {<br> > struct plugin_context *context = (struct plugin_context *) handle;<br> > <br> > diff --git a/sample/sample-plugins/simple<wbr>/simple.c<br> > b/sample/sample-plugins/simple<wbr>/simple.c<br> > index<br> > 950c547e22c1d44c59812eb90606fb<wbr>db52981021..66695950abfcbc6ebb<wbr>0a4d4fa621627a6099ba76<br> > 100644<br> > --- a/sample/sample-plugins/simple<wbr>/simple.c<br> > +++ b/sample/sample-plugins/simple<wbr>/simple.c<br> > @@ -72,7 +72,8 @@ get_env(const char *name, const char *envp[])<br> > }<br> > <br> > OPENVPN_EXPORT openvpn_plugin_handle_t<br> > -openvpn_plugin_open_v1(unsign<wbr>ed int *type_mask, const char *argv[], const<br> > char *envp[])<br> > +openvpn_plugin_open_v2(unsign<wbr>ed int *type_mask, const char *argv[], const<br> > char *envp[],<br> > + struct openvpn_plugin_string_list **return_list)<br> > {<br> > struct plugin_context *context;<br> > <br> > @@ -97,7 +98,8 @@ openvpn_plugin_open_v1(unsigne<wbr>d int *type_mask, const<br> > char *argv[], const char *<br> > }<br> > <br> > OPENVPN_EXPORT int<br> > -openvpn_plugin_func_v1(openvp<wbr>n_plugin_handle_t handle, const int type,<br> > const char *argv[], const char *envp[])<br> > +openvpn_plugin_func_v2(openvp<wbr>n_plugin_handle_t handle, const int type,<br> > const char *argv[], const char *envp[],<br> > + void *per_client_context, struct<br> > openvpn_plugin_string_list **return_list)<br> > {<br> > struct plugin_context *context = (struct plugin_context *) handle;<br> > <br> > diff --git a/sample/sample-plugins/simple<wbr>/simple.def<br> > b/sample/sample-plugins/simple<wbr>/simple.def<br> > index<br> > a87507d1fdc0f0bfd0434de577a818<wbr>ef0cc62afb..556f362308bc6ce818<wbr>29253f7a7fae9898be221a<br> > 100755<br> > --- a/sample/sample-plugins/simple<wbr>/simple.def<br> > +++ b/sample/sample-plugins/simple<wbr>/simple.def<br> > @@ -1,6 +1,6 @@<br> > LIBRARY OpenVPN_PLUGIN_SAMPLE<br> > DESCRIPTION "Sample OpenVPN plug-in module."<br> > EXPORTS<br> > - openvpn_plugin_open_v1 @1<br> > - openvpn_plugin_func_v1 @2<br> > + openvpn_plugin_open_v2 @1<br> > + openvpn_plugin_func_v2 @2<br> > openvpn_plugin_close_v1 @3<br> > --<br> > 2.15.2 (Apple Git-101.1)<br> <br> did you concatenate two patches? or what happened? It seems that the<br> part after this is not recognised as proper patch.<br> <br> <br> Cheers,<br> <br> <br> -- <br> Antonio Quartulli<br> <br> </blockquote> </blockquote> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
On 01/07/18 05:08, Greg Cox wrote: > On Sat, Jun 30, 2018 at 5:49 PM, Antonio Quartulli <a@unstable.cc> wrote: > >> I'd remove the last paragraph and the greetings from the commit message. >> But this might be done at commit time. >> > > It was unclear how to handle "explain what I'm wanting" in one mail. > Sorry. > When creating a patch with "git-format-patch" there are three dashes at the end of the commit message ("---") - anything you write after that will be dropped when merging the patch, thus that's where you can write what you want to explain :) > >> did you concatenate two patches? or what happened? It seems that the >> part after this is not recognised as proper patch. >> > > I think I dropped a few lines from `git format-patch HEAD~1 --stdout` on > accident. Take two: > Thanks. Normally "git format-patch" + "git send-email" take care of all the details for you (without --stdout, but by just using the produced file), so to ensure that the patch lands properly formatted. You can try next time :) Cheers,
On 30/06/2018 23:08, Greg Cox wrote: > > On Sat, Jun 30, 2018 at 5:49 PM, Antonio Quartulli <a@unstable.cc > <mailto:a@unstable.cc>> wrote: > > I'd remove the last paragraph and the greetings from the commit message. > But this might be done at commit time. > > > It was unclear how to handle "explain what I'm wanting" in one mail. Sorry. > > > did you concatenate two patches? or what happened? It seems that the > part after this is not recognised as proper patch. > > > I think I dropped a few lines from `git format-patch HEAD~1 --stdout` on > accident. Take two: > Hi Greg, Sorry for the way too long response time here. But on the plus side, I'm looking into this now - and will follow this one up more closely. Your "Take two" didn't work, as the patch got mangled by GMail. And also your initial patch was mangled too. I usually walk the extra mile to sort this out when patches has been lingering for so long. But in this case, the damage might add additional errors if I try to fix them manually. Copy-paste of mails into mail clients often corrupts patches in subtle ways, and in particular when graphical mail clients - including webmails. The alternative is to either submit the patch as an attachment, or use the more preferred 'git send-email' approach where it will connect to your SMTP server of your preference and send the patch properly formatted.
diff --git a/sample/sample-plugins/defer/simple.c b/sample/sample-plugins/defer/simple.c index d18695b59d6966e5cc84a19e176ea9ec18d0b452..d55e47be01aa346cfc9c70aa24f8722e5a1d67f9 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..556f362308bc6ce81829253f7a7fae9898be221a 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..efa8e5184db34f36a311fb61436cdfd61dd02f78 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..66695950abfcbc6ebb0a4d4fa621627a6099ba76 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..556f362308bc6ce81829253f7a7fae9898be221a 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