From: "flichtenheld (Code Review)" Date: Fri, 17 Jan 2025 15:11:17 +0000 In-Reply-To: References: Reply-To: frank@...2641..., arne-openvpn@...1227..., heiko@...515..., openvpn-devel@lists.sourceforge.net Message-ID: <10ba2d701dc42196bb789c3f400871e39012a193-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="GceHTI+sC5g="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: dns: apply settings via script on unixoid systems List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: d12fk Cc: plaisthos , openvpn-devel --GceHTI+sC5g= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: d12fk, plaisthos. flichtenheld has posted comments on this change. ( http://gerrit.openvpn.ne= t/c/openvpn/+/838?usp=3Demail ) Change subject: dns: apply settings via script on unixoid systems ...................................................................... Patch Set 7: Code-Review-2 (5 comments) Patchset: PS7: We need to talk about the user experience. File distro/dns-scripts/systemd-dns-updown.sh: http://gerrit.openvpn.net/c/openvpn/+/838/comment/2ff31b19_51522721 : PS7, Line 91: [[ "$(readlink /etc/resolv.conf)" =3D~ systemd ]] || retu= rn 1 This fallback is nice, but I really would like to see some kind of message = about it in the log. File src/openvpn/options.c: http://gerrit.openvpn.net/c/openvpn/+/838/comment/dbe1ec14_c2270313 : PS7, Line 911: o->dns_options.script =3D DNS_UPDOWN_PATH; This does not work well as an unconditional default I think. The problem he= re is that if you call openvpn without `--script-security 2` it will error = out. I think that should not happen as a default behavior. A warning seems appropriate, but a complete failure seems overkill? http://gerrit.openvpn.net/c/openvpn/+/838/comment/8fe2a8a7_b36878ef : PS7, Line 8045: else if (streq(p[0], "dns-script") && p[1]) New script should be documented in `doc/man-sections/script-options.rst` http://gerrit.openvpn.net/c/openvpn/+/838/comment/6ad4fbec_6e2fe02e : PS7, Line 8052: set_user_script(options, &options->dns_options.scri= pt, p[1], p[0], false); Again, this does not behave nice at all. This warns that the script is over= ridden even though it is only set once. And worse, there seems to be no way= to unset the script! ``` Options error: --dns-script script fails with '': No such file or directory= (errno=3D2) ``` I would change this so that the script is unset by default. IFF script-secu= rity 2 is set AND the user did not set their own dns-script, then fall back= to the default. However, we also need a way for users to disable the dns-s= cript, obviously. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/838?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ifbe4ffb44d3bfcaa50adb38cacb3436fcdc71b10 Gerrit-Change-Number: 838 Gerrit-PatchSet: 7 Gerrit-Owner: d12fk Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: d12fk Gerrit-Comment-Date: Fri, 17 Jan 2025 15:11:17 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment --GceHTI+sC5g= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: d12fk, plaisthos.

Patch set 7:Code-Review -2=

Vi= ew Change

5 comments:

  • Patchset:

  • File distro/dns-scr= ipts/systemd-dns-updown.sh:

      =
    • Patch Set #7, Line 91: [[ "$(readlink /etc/resolv.conf)" =3D~ systemd ]] ||= return 1

      This fallback is nice, but I really would like to see some kind of mess= age about it in the log.

  • File src/openvpn/options.c:

    • Patch Set #7, Line 911: o->dns_options.script =3D DNS_UPDOWN_PATH;<= /p>

      This does not= work well as an unconditional default I think. The problem here is that if= you call openvpn without `--script-security 2` it will error out. I think = that should not happen as a default behavior.

      A warning seems appropriate, but a complet= e failure seems overkill?

    • Patch Set #7, Line 8045: else if (streq(p[0], "= ;dns-script") && p[1])

      New script should be documented in `doc/man-s= ections/script-options.rst`

    • Patch Set #7, Line 8052: <= code style=3D"font-family:monospace,monospace"> set_user_script(opti= ons, &options->dns_options.script, p[1], p[0], false);

      Again, this does no= t behave nice at all. This warns that the script is overridden even though = it is only set once. And worse, there seems to be no way to unset the scrip= t!

      ```
      Opt= ions error: --dns-script script fails with '': No such file or dire= ctory (errno=3D2)
      ```

      I would change this so that the script is unset by default. IFF= script-security 2 is set AND the user did not set their own dns-script, th= en fall back to the default. However, we also need a way for users to disab= le the dns-script, obviously.

To view, visit change 838. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ifbe4ffb44d3bfcaa50adb38cacb= 3436fcdc71b10
Gerrit-Change-Number: 838
Gerrit-PatchSet: 7
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: d12fk <heiko@...515...>= ;
Gerrit-Comment-Date: Fri, 17 Jan 2025 15:11:17= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
--GceHTI+sC5g=--