[Openvpn-devel] resolvconf fails with -p

Message ID 20210529013516.767555-1-sergio@outerface.net
State Accepted
Headers show
Series [Openvpn-devel] resolvconf fails with -p | expand

Commit Message

sergio May 28, 2021, 3:35 p.m. UTC
From: "Sergio E. Nemirowski" <sergio@outerface.net>

resolvconf -p
resolvconf: Error: Command not recognized

Signed-off-by: Sergio E. Nemirowski <sergio@outerface.net>
---
 contrib/pull-resolv-conf/client.up | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gert Doering May 28, 2021, 9:16 p.m. UTC | #1
Hi,

On Sat, May 29, 2021 at 04:35:16AM +0300, sergio wrote:
> From: "Sergio E. Nemirowski" <sergio@outerface.net>
> 
> resolvconf -p
> resolvconf: Error: Command not recognized

Which platform does this fail on?  The fact that the -p is currently there
hints at "on some other platforms this works and is useful"...

gert
sergio May 29, 2021, 2:23 a.m. UTC | #2
> Which platform does this fail on?  The fact that the -p is currently there
> hints at "on some other platforms this works and is useful"...

Debian bullseye & sid, v1.87
David Sommerseth Nov. 6, 2021, 8:36 a.m. UTC | #3
On 29/05/2021 03:35, sergio wrote:
> From: "Sergio E. Nemirowski" <sergio@outerface.net>

> 

> resolvconf -p

> resolvconf: Error: Command not recognized

> 

> Signed-off-by: Sergio E. Nemirowski <sergio@outerface.net>

> ---

>   contrib/pull-resolv-conf/client.up | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/contrib/pull-resolv-conf/client.up b/contrib/pull-resolv-conf/client.up

> index f0769740..220aeb74 100644

> --- a/contrib/pull-resolv-conf/client.up

> +++ b/contrib/pull-resolv-conf/client.up

> @@ -91,7 +91,7 @@ out="# resolv.conf autogenerated by ${0} (${dev})${nl}${dns}${ds}${domains}"

>   

>   # use resolvconf if it's available

>   if type resolvconf >/dev/null 2>&1; then

> -  printf "%s\n" "${out}" | resolvconf -p -a "${dev}"

> +  printf "%s\n" "${out}" | resolvconf -a "${dev}"

>   else

>     # Preserve the existing resolv.conf

>     if [ -e /etc/resolv.conf ] ; then

> 


I quickly checked resolveconf on Ubuntu {18,20,21}.04 and Debian 9-11. 
Neither of them supports the '-p' argument.

I've checked Fedora 34, RHEL-{7,8} too, where I could not find any 
obvious alternative to the old version of resolvconf tool.  On RHEL-8 
and Fedora, systemd-resolved is available and provides a different 
resolveconf which targets to replace this old utility.  This replacement 
neither support '-p'.

This option got added in commit 3adf2f558e157ef508 back in 2010, but 
there's too little information why it was needed back then.  But given 
that neither relevant Linux distributions supports this option today, 
it's reasonable to remove it now.

Acked-By: David Sommerseth <davids@openvpn.net>


-- 
kind regards,

David Sommerseth
OpenVPN Inc
Gert Doering Nov. 6, 2021, 8:42 a.m. UTC | #4
Sorry that it took so long.  But here we go.

Your patch has been applied to the master and release/2.5 branch.

commit e739f41d05084c1bc9bfb6c5d49c74de37e53dc7 (master)
commit 8fcce5042865b6bed7dcde5d7d0372ae83d54708 (release/2.5)
Author: Sergio E. Nemirowski
Date:   Sat May 29 04:35:16 2021 +0300

     resolvconf fails with -p

     Signed-off-by: Sergio E. Nemirowski <sergio@outerface.net>
     Acked-by: David Sommerseth <davids@openvpn.net>
     Message-Id: <20210529013516.767555-1-sergio@outerface.net>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22467.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
Greg Cox Nov. 6, 2021, 9:28 a.m. UTC | #5
On Sat, Nov 6, 2021 at 7:37 PM David Sommerseth <
openvpn@sf.lists.topphemmelig.net> wrote:

> I quickly checked resolveconf on Ubuntu {18,20,21}.04 and Debian 9-11.
> Neither of them supports the '-p' argument.
>
> I've checked Fedora 34, RHEL-{7,8} too, where I could not find any
> obvious alternative to the old version of resolvconf tool.  On RHEL-8
> and Fedora, systemd-resolved is available and provides a different
> resolveconf which targets to replace this old utility.  This replacement
> neither support '-p'.
>
> This option got added in commit 3adf2f558e157ef508 back in 2010, but
> there's too little information why it was needed back then.  But given
> that neither relevant Linux distributions supports this option today,
> it's reasonable to remove it now.
>

Openresolv uses it, and Arch offers that package.
https://github.com/NetworkConfiguration/openresolv/blob/master/resolvconf.in#L108
has a -p

That's my best guess where this came from.  And then, since this is off
buried in 'contrib', "nobody" noticed it for years.

(I don't disagree with removing it, I just like forensics).
<div dir="ltr"><div dir="ltr" class="gmail_attr">On Sat, Nov 6, 2021 at 7:37 PM David Sommerseth &lt;<a href="mailto:openvpn@sf.lists.topphemmelig.net" target="_blank">openvpn@sf.lists.topphemmelig.net</a>&gt; wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I quickly checked resolveconf on Ubuntu {18,20,21}.04 and Debian 9-11. <br>
Neither of them supports the &#39;-p&#39; argument.<br>
<br>
I&#39;ve checked Fedora 34, RHEL-{7,8} too, where I could not find any <br>
obvious alternative to the old version of resolvconf tool.  On RHEL-8 <br>
and Fedora, systemd-resolved is available and provides a different <br>
resolveconf which targets to replace this old utility.  This replacement <br>
neither support &#39;-p&#39;.<br>
<br>
This option got added in commit 3adf2f558e157ef508 back in 2010, but <br>
there&#39;s too little information why it was needed back then.  But given <br>
that neither relevant Linux distributions supports this option today, <br>
it&#39;s reasonable to remove it now.<br></blockquote><div><br></div><div style="font-family:courier new,monospace" class="gmail_default">Openresolv uses it, and Arch offers that package.</div><div style="font-family:courier new,monospace" class="gmail_default"> <a href="https://github.com/NetworkConfiguration/openresolv/blob/master/resolvconf.in#L108">https://github.com/NetworkConfiguration/openresolv/blob/master/resolvconf.in#L108</a> has a -p</div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><div style="font-family:courier new,monospace" class="gmail_default">That&#39;s my best guess where this came from.  And then, since this is off buried in &#39;contrib&#39;, &quot;nobody&quot; noticed it for years.<br></div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><div style="font-family:courier new,monospace" class="gmail_default">(I don&#39;t disagree with removing it, I just like forensics).<br></div></div>
</div>

Patch

diff --git a/contrib/pull-resolv-conf/client.up b/contrib/pull-resolv-conf/client.up
index f0769740..220aeb74 100644
--- a/contrib/pull-resolv-conf/client.up
+++ b/contrib/pull-resolv-conf/client.up
@@ -91,7 +91,7 @@  out="# resolv.conf autogenerated by ${0} (${dev})${nl}${dns}${ds}${domains}"
 
 # use resolvconf if it's available
 if type resolvconf >/dev/null 2>&1; then
-  printf "%s\n" "${out}" | resolvconf -p -a "${dev}"
+  printf "%s\n" "${out}" | resolvconf -a "${dev}"
 else
   # Preserve the existing resolv.conf
   if [ -e /etc/resolv.conf ] ; then