From patchwork Sat Jun 30 06:58:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Cox X-Patchwork-Id: 390 X-Patchwork-Delegate: davids@openvpn.net Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net (Dovecot) with LMTP id VNzZBgu9N1u8WgAAIUCqbw for ; Sat, 30 Jun 2018 13:25:31 -0400 Received: from proxy16.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net (Dovecot) with LMTP id Q64aEAu9N1vDFgAAovjBpQ ; Sat, 30 Jun 2018 13:25:31 -0400 Received: from smtp5.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy16.mail.ord1d.rsapps.net with LMTP id ML78Dwu9N1vpTAAAetu3IA ; Sat, 30 Jun 2018 13:25:31 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp5.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=mozilla.com; dmarc=fail (p=none; dis=none) header.from=mozilla.com X-Suspicious-Flag: YES X-Classification-ID: 9606bc88-7c8a-11e8-a751-525400d73c44-1-1 Received: from [216.105.38.7] ([216.105.38.7:47195] helo=lists.sourceforge.net) by smtp5.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id E1/CC-16920-A0DB73B5; Sat, 30 Jun 2018 13:25:30 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1fZJbf-0004Ed-Af; Sat, 30 Jun 2018 17:24:19 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fZJbd-0004EW-CF for openvpn-devel@lists.sourceforge.net; Sat, 30 Jun 2018 17:24:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:To:Subject:Message-ID:Date:From: MIME-Version:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YdO41rZ58iWwAtgwDI4uaCek5ojhnYQRtirRW0skt+Q=; b=TTpGPqChLe4ZA9CU0/3isTjiGL NeoaUcPjXTe+kH/ncusugKeINaIV6MmajuB5FAx/XXwD6MtL2bC+sAIqGV7WTuDj8+XWDKblTqpGm J84EUxPE9Ndzjr7ghqXmDjF8uH1dZCmqMuZs1PDjcGY/UpHiKuXLEUuwaj2VBP3ahg0E=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:To:Subject:Message-ID:Date:From:MIME-Version:Sender:Reply-To :Cc:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=YdO41rZ58iWwAtgwDI4uaCek5ojhnYQRtirRW0skt+Q=; b=e N+cYTooHwtPH9c71gQINZ2HHqBLjo6yW5XUg0I5UI+XDlcVN2Qx4MA2mG153cRprRYI97S1zmVu4O zHeplsj6qSav84VV0PYaqb4yt9coHPg3MxJlC28Vo1zN7ucZFa/fzlu8uBTzZzWy3uvXq/qfWEHeQ lVo8CW6moCLIaZGw=; Received: from mail-it0-f67.google.com ([209.85.214.67]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1fZJbb-00E2ci-0g for openvpn-devel@lists.sourceforge.net; Sat, 30 Jun 2018 17:24:17 +0000 Received: by mail-it0-f67.google.com with SMTP id k17-v6so5101707ita.0 for ; Sat, 30 Jun 2018 10:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mozilla.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=YdO41rZ58iWwAtgwDI4uaCek5ojhnYQRtirRW0skt+Q=; b=QmJ+yiEagc82ymRwaKeyJLsN/vzmPiSdFtS2LdbphOG/BcaAjMPLdG3YvT1FhLK2pV FABjBrQ62C5YU/hxXoY9sd9wsWggYARt4yweHaM+VR6cHKxJDVIlTMMLM3z1tq5kfLYk LzVe/a9GUFVwbQIFeVIptORfV2M6zq6sL0EX4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=YdO41rZ58iWwAtgwDI4uaCek5ojhnYQRtirRW0skt+Q=; b=J8fl2O9k51WsWlBDeM8kGE2hyr9HaLph+L1W4yessf0eVdEaZ6wzMB9SEIBTx7LBJD +dPqc9Zt1vZD48dLFqkPTFSsCT3Aqv89Y55ElnbA4/sbFpy7UnNk6EP1IAbq19SjTlEX 9zWVkvQoZTdYJOrtLyfvS+jJz7CU8OKpaxy1QffdzlrS4f50l/TGQ8JexuhM8UjBJHPJ wl+Tgc6kXVQEUYl9BAvVPpe5aHU6vIsdy145IPhcPjM9D5wV47esZLQR9FaTR+NoEwZc TOIAIeRQqpHuY8ycLbAiDMJ3KQIicW7ZeM+X16B1XUDzm1GTvZbtt0EMSQ5i8xQ6YOTI zAdw== X-Gm-Message-State: APt69E0gGn40RzEy1ywjY+EmarS7Z9S80UudesHCzPuGdUqs5f0O2gi6 0xLoAmMO3dN/1BMe6yfaNJdrWuQYtjtzkcfpXlXr52WOPHE= X-Google-Smtp-Source: AAOMgpdw9hlBcZPsqosvS1N5Mh3M4M1ftZYaYPuG3kwL6jgGp7x7Lfj6nOuHp6NA5P/qlEK9Ndip7/jQgabIrliAEz4= X-Received: by 2002:a24:6506:: with SMTP id u6-v6mr5644295itb.118.1530377889543; Sat, 30 Jun 2018 09:58:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8d05:0:0:0:0:0 with HTTP; Sat, 30 Jun 2018 09:58:09 -0700 (PDT) From: Greg Cox Date: Sat, 30 Jun 2018 16:58:09 +0000 Message-ID: To: openvpn-devel@lists.sourceforge.net X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.214.67 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.214.67 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 1.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1fZJbb-00E2ci-0g Subject: [Openvpn-devel] [PATCH] Remove deprecated plugin functions from code samples X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox 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 --- 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(-) -- 2.15.2 (Apple Git-101.1) ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot 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