All of lore.kernel.org
 help / color / mirror / Atom feed
* [Openvpn-devel] [PATCH] Fix "--dev null"
@ 2017-02-24 13:52 Gert Doering
  2017-02-24 14:32 ` 
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gert Doering @ 2017-02-24 13:52 UTC (permalink / raw)
  To: openvpn-devel

To test whether a server is reachable and all the key handling is
right, openvpn can connect with "--dev null --ifconfig-noexec" to
avoid needing to the client with elevated privileges.

This was erroring out for no good reason (because the "set environment
variables appropriately" code didn't know if this is a tun or tap
device...) - treat --dev null as "tap", done.

Signed-off-by: Gert Doering <gert@...1296...>
---
 src/openvpn/tun.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 31585b32..12ce99d5 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -560,7 +560,9 @@ is_tun_p2p(const struct tuntap *tt)
 {
     bool tun = false;
 
-    if (tt->type == DEV_TYPE_TAP || (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET))
+    if (tt->type == DEV_TYPE_TAP ||
+        (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET) ||
+	tt->type == DEV_TYPE_NULL )
     {
         tun = false;
     }
-- 
2.11.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Openvpn-devel] [PATCH] Fix "--dev null"
  2017-02-24 13:52 [Openvpn-devel] [PATCH] Fix "--dev null" Gert Doering
@ 2017-02-24 14:32 ` 
  2017-02-24 14:34   ` Gert Doering
  2017-02-24 14:42 ` Steffan Karger
  2017-02-24 19:59 ` [Openvpn-devel] [PATCH applied] Re: Fix '--dev null' Gert Doering
  2 siblings, 1 reply; 5+ messages in thread
From:  @ 2017-02-24 14:32 UTC (permalink / raw)
  To: Gert Doering <gert@

Hi,

On 24/02/2017 15:52, Gert Doering wrote:
> To test whether a server is reachable and all the key handling is
> right, openvpn can connect with "--dev null --ifconfig-noexec" to
> avoid needing to the client with elevated privileges.

There seems to be a typo here. Did you mean "to avoid needing to
_connect to_ the client with elevated privileges"?

> 
> This was erroring out for no good reason (because the "set environment
> variables appropriately" code didn't know if this is a tun or tap
> device...) - treat --dev null as "tap", done.
> 
> Signed-off-by: Gert Doering <gert@...1296...>
> ---
>  src/openvpn/tun.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
> index 31585b32..12ce99d5 100644
> --- a/src/openvpn/tun.c
> +++ b/src/openvpn/tun.c
> @@ -560,7 +560,9 @@ is_tun_p2p(const struct tuntap *tt)
>  {
>      bool tun = false;
>  
> -    if (tt->type == DEV_TYPE_TAP || (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET))
> +    if (tt->type == DEV_TYPE_TAP ||
> +        (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET) ||
> +	tt->type == DEV_TYPE_NULL )
>      {
>          tun = false;
>      }
> 


-- 
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Openvpn-devel] [PATCH] Fix "--dev null"
  2017-02-24 14:32 ` 
@ 2017-02-24 14:34   ` Gert Doering
  0 siblings, 0 replies; 5+ messages in thread
From: Gert Doering @ 2017-02-24 14:34 UTC (permalink / raw)
  Cc: openvpn-devel

[-- Attachment #1: Type: text/plain, Size: 766 bytes --]

Hi,

On Fri, Feb 24, 2017 at 04:32:14PM +0200, Samuli Seppänen wrote:
> On 24/02/2017 15:52, Gert Doering wrote:
> > To test whether a server is reachable and all the key handling is
> > right, openvpn can connect with "--dev null --ifconfig-noexec" to
> > avoid needing to the client with elevated privileges.
> 
> There seems to be a typo here. Did you mean "to avoid needing to
> _connect to_ the client with elevated privileges"?

Actually "to _run_ the client" - indeed.

gert
-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             gert@...1296...
fax: +49-89-35655025                        gert@...1297...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 630 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Openvpn-devel] [PATCH] Fix "--dev null"
  2017-02-24 13:52 [Openvpn-devel] [PATCH] Fix "--dev null" Gert Doering
  2017-02-24 14:32 ` 
@ 2017-02-24 14:42 ` Steffan Karger
  2017-02-24 19:59 ` [Openvpn-devel] [PATCH applied] Re: Fix '--dev null' Gert Doering
  2 siblings, 0 replies; 5+ messages in thread
From: Steffan Karger @ 2017-02-24 14:42 UTC (permalink / raw)
  To: openvpn-devel

Hi,

On 24-02-17 14:52, Gert Doering wrote:
> To test whether a server is reachable and all the key handling is
> right, openvpn can connect with "--dev null --ifconfig-noexec" to
> avoid needing to the client with elevated privileges.
> 
> This was erroring out for no good reason (because the "set environment
> variables appropriately" code didn't know if this is a tun or tap
> device...) - treat --dev null as "tap", done.
> 
> Signed-off-by: Gert Doering <gert@...1296...>
> ---
>  src/openvpn/tun.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
> index 31585b32..12ce99d5 100644
> --- a/src/openvpn/tun.c
> +++ b/src/openvpn/tun.c
> @@ -560,7 +560,9 @@ is_tun_p2p(const struct tuntap *tt)
>  {
>      bool tun = false;
>  
> -    if (tt->type == DEV_TYPE_TAP || (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET))
> +    if (tt->type == DEV_TYPE_TAP ||
> +        (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET) ||
> +	tt->type == DEV_TYPE_NULL )
>      {
>          tun = false;
>      }
> 

Code makes sense.  Code-ACK.

Style-wise, we went for pos_arith=lead (Knuth style), so

x = first_condition
      && second_condition
      && third_condition

and this patch is trying to sneak a tab into the code! ;)

I'd be fine with you fixing the style on the fly when applying.

-Steffan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Openvpn-devel] [PATCH applied] Re: Fix '--dev null'
  2017-02-24 13:52 [Openvpn-devel] [PATCH] Fix "--dev null" Gert Doering
  2017-02-24 14:32 ` 
  2017-02-24 14:42 ` Steffan Karger
@ 2017-02-24 19:59 ` Gert Doering
  2 siblings, 0 replies; 5+ messages in thread
From: Gert Doering @ 2017-02-24 19:59 UTC (permalink / raw)
  To: Gert Doering <gert@; +Cc: openvpn-devel

Patch has been applied to the master and release/2.4 branch.

As ordered, '||' have been moved to pos_arith=lead, and the tab 
has been extabinated.

commit 22c5381b71710ad0e1dbbccc1d5680fccb602311 (master)
commit 2085c1f3875b9c96ac739941712247b805677efa (release/2.4)
Author: Gert Doering
Date:   Fri Feb 24 14:52:22 2017 +0100

     Fix '--dev null'

     Signed-off-by: Gert Doering <gert@...1296...>
     Acked-by: Steffan Karger <steffan.karger@...1435...>
     Message-Id: <20170224135222.44640-1-gert@...1296...>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14186.html
     Signed-off-by: Gert Doering <gert@...1296...>


--
kind regards,

Gert Doering



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-24 19:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-24 13:52 [Openvpn-devel] [PATCH] Fix "--dev null" Gert Doering
2017-02-24 14:32 ` 
2017-02-24 14:34   ` Gert Doering
2017-02-24 14:42 ` Steffan Karger
2017-02-24 19:59 ` [Openvpn-devel] [PATCH applied] Re: Fix '--dev null' Gert Doering

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.