Attention is currently required from: Arne Schwabe, Deri Haerudi.

Răzvan Cojocaru has posted comments on this change by Deri Haerudi. ( 
https://gerrit.openvpn.net/c/openvpn/+/2341?usp=email )

Change subject: dns-scripts: parse dns_vars_file as data instead of sourcing it
......................................................................


Patch Set 2: Code-Review-1

(5 comments)

File distro/dns-scripts/haikuos_file-dns-updown.sh:

https://gerrit.openvpn.net/c/openvpn/+/2341/comment/e2fad090_07260b12?usp=email 
:
PS2, Line 53:     [ -r "$_f" ] || exit 1
Actually, could we also get an error message here? E.g.:

```
 dns_vars_load() {
     _f=$1
-    [ -r "$_f" ] || exit 1
+    [ -r "$_f" ] || {
+        echo "cannot read dns vars file ${_f}"
+        exit 1
+    }
     while IFS= read -r _line || [ -n "$_line" ]; do
```


https://gerrit.openvpn.net/c/openvpn/+/2341/comment/c6d2437f_ccccb43f?usp=email 
:
PS2, Line 67:                     [!A-Za-z0-9]* | *[!A-Za-z0-9_./-]* | *..*)
So on second thought, this causes a regression in what Linux actually allows 
(e.g. `_vpn`, `vpn+1`, `tun@corp` are actually accepted by Linux as interface 
names).

So this change would stop them from being accepted.

We could instead make this a deny list instead, e.g.:

```
             dev)
-                # dev is used in sed expressions and as a command argument:
-                # only accept interface name characters ("/" for Haiku tun/N)
+                # Reject what could end a \%re% sed address (% and \),
+                # pass as a command option (leading -) or walk up a path (..)
                 case $_value in
-                    [!A-Za-z0-9]* | *[!A-Za-z0-9_./-]* | *..*)
+                    -* | *%* | *\\* | *..*)
                         echo "invalid dev name in ${_f}"
                         exit 1
                         ;;
                 esac
                 ;;
```


https://gerrit.openvpn.net/c/openvpn/+/2341/comment/7542e6a6_3612c9ba?usp=email 
:
PS2, Line 114:             domains="$domains$d "
This could stop at the first empty domain. E.g.:

```
     test -z "$dns_search_domain_1" || {
         for i in $(seq 1 6); do
-            eval d=\"\$dns_search_domain_${i}\" || break
-            domains="$domains$d "
+            eval d=\"\$dns_search_domain_${i}\"
+            [ -n "$d" ] || break
+            domains="${domains:+$domains }$d"
         done
         text="${text}search $domains\n"
     }
```


File distro/dns-scripts/resolvconf_file-dns-updown.sh:

https://gerrit.openvpn.net/c/openvpn/+/2341/comment/3adbf885_902f6cf4?usp=email 
:
PS2, Line 114:             domains="$domains$d "
Same suggestion as for haikuos_file-dns-updown.sh (same hunk).


File distro/dns-scripts/systemd-dns-updown.sh:

https://gerrit.openvpn.net/c/openvpn/+/2341/comment/b3164433_5568c4aa?usp=email 
:
PS2, Line 266:                 domains="$domains$d "
This could stop at the first empty domain, e.g.:

```
         test -z "$dns_search_domain_1" || {
             for i in $(seq 1 6); do
-                eval d=\"\$dns_search_domain_${i}\" || break
-                domains="$domains$d "
+                eval d=\"\$dns_search_domain_${i}\"
+                [ -n "$d" ] || break
+                domains="${domains:+$domains }$d"
             done
             text="${text}search $domains\n"
         }
```



--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2341?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id05f3e4e32aeb806d762858e754adc82f42d4371
Gerrit-Change-Number: 2341
Gerrit-PatchSet: 2
Gerrit-Owner: Deri Haerudi <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Răzvan Cojocaru <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Deri Haerudi <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Comment-Date: Wed, 25 Nov 2026 10:38:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to