)]}'
{"id":"openvpn~2341","triplet_id":"openvpn~master~Id05f3e4e32aeb806d762858e754adc82f42d4371","project":"openvpn","branch":"master","full_branch":"refs/heads/master","attention_set":{},"removed_from_attention_set":{"1000071":{"account":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"last_update":"2026-11-25 23:15:46.000000000","reason":"removed on reply"},"1000053":{"account":{"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"last_update":"2026-11-25 11:31:14.000000000","reason":"removed on reply"},"1000003":{"account":{"_account_id":1000003,"name":"Arne Schwabe","display_name":"Arne Schwabe","email":"arne-openvpn@rfc2549.org","username":"plaisthos"},"last_update":"2026-12-01 00:52:46.000000000","reason":"Change was abandoned"}},"hashtags":[],"change_id":"Id05f3e4e32aeb806d762858e754adc82f42d4371","subject":"dns-scripts: parse dns_vars_file as data instead of sourcing it","status":"ABANDONED","created":"2026-11-24 23:21:12.000000000","updated":"2026-12-01 00:52:46.000000000","total_comment_count":15,"unresolved_comment_count":0,"has_review_started":true,"meta_rev_id":"31fb7a799a4d8cfdc8341f995604b627f63f9d63","_number":2341,"virtual_id_number":2341,"owner":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"actions":{},"labels":{"Code-Review":{"all":[{"value":0,"date":"2026-11-28 09:54:36.000000000","permitted_voting_range":{"min":-2,"max":2},"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},{"value":0,"permitted_voting_range":{"min":-2,"max":2},"_account_id":1000003,"name":"Arne Schwabe","display_name":"Arne Schwabe","email":"arne-openvpn@rfc2549.org","username":"plaisthos"}],"values":{"-2":"This shall not be submitted","-1":"I would prefer this is not submitted as is"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me, approved"},"default_value":0},"Build-Request":{"all":[{"value":0,"permitted_voting_range":{"min":0,"max":1},"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},{"value":0,"permitted_voting_range":{"min":0,"max":1},"_account_id":1000003,"name":"Arne Schwabe","display_name":"Arne Schwabe","email":"arne-openvpn@rfc2549.org","username":"plaisthos"}],"values":{" 0":"No score","+1":"Please trigger a build"},"description":"Ask buildbot to do a full build on this change version","default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":1000003,"name":"Arne Schwabe","display_name":"Arne Schwabe","email":"arne-openvpn@rfc2549.org","username":"plaisthos"},{"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"}],"CC":[{"_account_id":1000006,"name":"Heiko Hund","display_name":"Heiko Hund","email":"heiko@ist.eigentlich.net","username":"d12fk"},{"_account_id":1000026,"name":"openvpn-devel","email":"openvpn-devel@lists.sourceforge.net","username":"openvpn-devel"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2026-11-24 23:21:12.000000000","updated_by":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"real_updated_by":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"reviewer":{"_account_id":1000026,"name":"openvpn-devel","email":"openvpn-devel@lists.sourceforge.net","username":"openvpn-devel"},"state":"CC"},{"updated":"2026-11-24 23:21:12.000000000","updated_by":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"real_updated_by":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"reviewer":{"_account_id":1000003,"name":"Arne Schwabe","display_name":"Arne Schwabe","email":"arne-openvpn@rfc2549.org","username":"plaisthos"},"state":"REVIEWER"},{"updated":"2026-11-25 08:45:07.000000000","updated_by":{"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"real_updated_by":{"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"reviewer":{"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"state":"REVIEWER"},{"updated":"2026-11-25 20:11:26.000000000","updated_by":{"_account_id":1000006,"name":"Heiko Hund","display_name":"Heiko Hund","email":"heiko@ist.eigentlich.net","username":"d12fk"},"real_updated_by":{"_account_id":1000006,"name":"Heiko Hund","display_name":"Heiko Hund","email":"heiko@ist.eigentlich.net","username":"d12fk"},"reviewer":{"_account_id":1000006,"name":"Heiko Hund","display_name":"Heiko Hund","email":"heiko@ist.eigentlich.net","username":"d12fk"},"state":"CC"}],"messages":[{"id":"b101ed2a674b1e56bc435bc86e894b545a288ea9","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"date":"2026-11-24 23:21:12.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"0017f201a0a0d81b17b80f1b6afd9420d84047c1","author":{"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"date":"2026-11-25 08:45:07.000000000","message":"Patch Set 1: Code-Review-1\n\n(2 comments)","accounts_in_message":[],"_revision_number":1},{"id":"19c093d186e7b22297592108990c5d35e534d115","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"date":"2026-11-25 09:34:53.000000000","message":"Uploaded patch set 2.\n\nOutdated Votes:\n* Code-Review-1 (copy condition: \"changekind:NO_CHANGE OR changekind:TRIVIAL_REBASE OR is:MIN\")\n","accounts_in_message":[],"_revision_number":2},{"id":"f5d127c857634683872dd101977a8e6c11f3ef5b","author":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"date":"2026-11-25 09:36:02.000000000","message":"Patch Set 2:\n\nPatch Set 2: addressed both comments (dev check in the reader plus %...% sed addresses, \u0027|| exit 1\u0027 on an unreadable vars file) and reworded the message accordingly.\n\nI also corrected the last paragraph of the message. The resolv.conf output is only byte-identical with 0 or 6 search domains; with 1-5 the old loop left fewer trailing blanks on the \u0027search\u0027 line.\n\nTested with dash and bash: crafted dev values (sed \u0027e\u0027, r, w, leading \u0027-\u0027, \u0027..\u0027, spaces, quotes, $(...)) are rejected or inert; tun0, eth0.100, wg0, utun3 and tun/0 still round-trip dns-up/dns-down to the original resolv.conf; normal resolvectl/resolvconf output is unchanged from PS1.","accounts_in_message":[],"_revision_number":2},{"id":"658884b9e4810eb9b5e7a14d4e31fe199a5d6a3b","author":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"date":"2026-11-25 09:49:42.000000000","message":"Patch Set 2:\n\n(2 comments)","accounts_in_message":[],"_revision_number":2},{"id":"2670af3deeb32b0e798cb84a9295f4acc1c5bb8b","author":{"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"date":"2026-11-25 10:38:49.000000000","message":"Patch Set 2: Code-Review-1\n\n(5 comments)","accounts_in_message":[],"_revision_number":2},{"id":"49718230e0ab82dd11ce79e82ee4b3d5e22de9fb","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"date":"2026-11-25 11:15:26.000000000","message":"Uploaded patch set 3.\n\nOutdated Votes:\n* Code-Review-1 (copy condition: \"changekind:NO_CHANGE OR changekind:TRIVIAL_REBASE OR is:MIN\")\n","accounts_in_message":[],"_revision_number":3},{"id":"ea579e971f2560259401e95b0b88b8e2310d8cc5","author":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"date":"2026-11-25 11:15:48.000000000","message":"Patch Set 3:\n\nPatch Set 3: error message on an unreadable vars file, your deny-list\nfor dev, and the search domain loop as suggested. The commit message now\ndescribes the dev check and the change to the search line.\n\nTested with dash and bash (reader and sed calls also with busybox sh and\nbusybox sed): the sed e/r/w dev values that now get past the reader are\ninert in the dns-down sed calls; dev values with a leading `-`, a `%`,\na `` or `..` are rejected; tun0, eth0.100, wg0, utun3, tun/0, _vpn, vpn+1 and\ntun@corp round-trip dns-up/dns-down; apart from the search line, the\nresolv.conf contents and the resolvectl/resolvconf arguments are\nunchanged.","accounts_in_message":[],"_revision_number":3},{"id":"6bca11ca2e8925958923716858e5ef77384992c8","author":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"date":"2026-11-25 11:21:55.000000000","message":"Patch Set 3:\n\n(5 comments)","accounts_in_message":[],"_revision_number":3},{"id":"360637cb7baa79c0afd24048b0f29f360d1b083e","author":{"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"date":"2026-11-25 11:31:14.000000000","message":"Patch Set 3: Code-Review+2","accounts_in_message":[],"_revision_number":3},{"id":"1bf7e7041c8c1bd199505a6079704a24501d4fff","author":{"_account_id":1000006,"name":"Heiko Hund","display_name":"Heiko Hund","email":"heiko@ist.eigentlich.net","username":"d12fk"},"date":"2026-11-25 20:11:26.000000000","message":"Patch Set 3:\n\n(1 comment)","accounts_in_message":[],"_revision_number":3},{"id":"d4f5d2dc3e588538bc392dcb50be5c4e395a2d80","author":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"date":"2026-11-25 23:15:46.000000000","message":"Patch Set 3:\n\nThanks Heiko, that sounds like the better fix. Passing the variables\ndirectly also gets rid of the path the runner currently trusts, which\nthis change could only document as left over. I\u0027ll review your change\nwhen it\u0027s up.\n\nIf anything from this one is still useful on top of yours, for example\nthe dev handling in the dns-down sed calls, I can rebase that as a\nseparate change. Otherwise I\u0027m fine with dropping this one once yours\nlands, whichever you and Gert prefer.","accounts_in_message":[],"_revision_number":3},{"id":"c3abc78a7d7ff30d24ff74fefcb0cec1154f2a67","author":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"date":"2026-11-28 00:57:28.000000000","message":"Patch Set 3:\n\nSuperseded by Heiko\u0027s stack +/2347..+/2349; please don\u0027t merge — will abandon once the stack lands.","accounts_in_message":[],"_revision_number":3},{"id":"6d6411b554d2f37fc2bb27f06aa2ee6eccf449c2","author":{"_account_id":1000053,"name":"Răzvan Cojocaru","display_name":"Razvan Cojocaru","email":"razvanc@mailbox.org","username":"razvanc"},"date":"2026-11-28 09:54:36.000000000","message":"Patch Set 3: -Code-Review","accounts_in_message":[],"_revision_number":3},{"id":"31fb7a799a4d8cfdc8341f995604b627f63f9d63","tag":"autogenerated:gerrit:abandon","author":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"date":"2026-12-01 00:52:46.000000000","message":"Abandoned\n\nAbandoning in favour of Heiko\u0027s series (#2347, #2348, #2349), which fixes this on the producer side. Thanks for the reviews.","accounts_in_message":[],"_revision_number":3}],"current_revision_number":3,"current_revision":"cafe4eab2d6f519bde8d4ebef000ab02a8e66006","revisions":{"01aa79f87f54bdbecb8f7a160c6ea0f8965ed29c":{"kind":"REWORK","_number":1,"created":"2026-11-24 23:21:12.000000000","uploader":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"ref":"refs/changes/41/2341/1","fetch":{"anonymous http":{"url":"https://gerrit.openvpn.net/openvpn","ref":"refs/changes/41/2341/1","commands":{"Branch":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/1 \u0026\u0026 git checkout -b change-2341 FETCH_HEAD","Checkout":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://gerrit.openvpn.net/openvpn refs/changes/41/2341/1","Reset To":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"66ea3e05b6c67cc0438c58140d6ca76be0c315a0","subject":"socket: Let an optional UDP socket give up on a failed bind"}],"author":{"name":"Deri Haerudi","email":"Abcderyscreenprinting@gmail.com","date":"2026-11-24 23:00:29.000000000","tz":480},"committer":{"name":"Deri Haerudi","email":"Abcderyscreenprinting@gmail.com","date":"2026-11-24 23:07:47.000000000","tz":480},"subject":"dns-scripts: parse dns_vars_file as data instead of sourcing it","message":"dns-scripts: parse dns_vars_file as data instead of sourcing it\n\nWhen --user is used, openvpn forks a privileged runner that executes the\ndns-updown script as root. The unprivileged process writes the DNS\nvariables to a temporary file (env_set_write_file(), raw NAME\u003dvalue lines)\nand passes its path to the runner, and all in-tree dns-updown scripts then\nload that file with \". $dns_vars_file\", i.e. they execute it as shell code.\n\nToday the values are restricted by validate_domain() and friends, so this\nis not exploitable from the network. But the design means (a) the safety\nof root code execution rests entirely on that validation, and (b) the\nprivilege separation the runner exists for does not hold: whoever controls\nthe unprivileged process controls a file root will execute.\n\nReplace the sourcing with a small reader that only accepts the variable\nnames openvpn writes (dns_server_*, dns_search_domain_*, dev, script_type),\nvalidates the name and assigns the value without evaluating it. Also stop\nre-evaluating already-collected search domains in the \"domains\" loop of\nthe resolvconf_file, haikuos_file and systemd scripts.\n\nNo functional change intended for valid values. For the resolvconf_file\nand systemd scripts, the resulting resolv.conf and resolvectl arguments\nwere compared byte for byte before and after the change.\n\nSigned-off-by: Deri Haerudi \u003cAbcderyscreenprinting@gmail.com\u003e\n\nChange-Id: Id05f3e4e32aeb806d762858e754adc82f42d4371\n"},"branch":"refs/heads/master"},"53542aefa682e59d804ae353be9731bf15ed9dfd":{"kind":"REWORK","_number":2,"created":"2026-11-25 09:34:53.000000000","uploader":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"ref":"refs/changes/41/2341/2","fetch":{"anonymous http":{"url":"https://gerrit.openvpn.net/openvpn","ref":"refs/changes/41/2341/2","commands":{"Branch":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/2 \u0026\u0026 git checkout -b change-2341 FETCH_HEAD","Checkout":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://gerrit.openvpn.net/openvpn refs/changes/41/2341/2","Reset To":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/2 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"66ea3e05b6c67cc0438c58140d6ca76be0c315a0","subject":"socket: Let an optional UDP socket give up on a failed bind"}],"author":{"name":"Deri Haerudi","email":"Abcderyscreenprinting@gmail.com","date":"2026-11-24 23:00:29.000000000","tz":480},"committer":{"name":"Deri Haerudi","email":"Abcderyscreenprinting@gmail.com","date":"2026-11-25 09:34:39.000000000","tz":480},"subject":"dns-scripts: parse dns_vars_file as data instead of sourcing it","message":"dns-scripts: parse dns_vars_file as data instead of sourcing it\n\nWhen --user is used, openvpn forks a privileged runner that executes the\ndns-updown script as root. The unprivileged process writes the DNS\nvariables to a temporary file (env_set_write_file(), raw NAME\u003dvalue lines)\nand passes its path to the runner, and all in-tree dns-updown scripts then\nload that file with \". $dns_vars_file\", i.e. they execute it as shell code.\n\nToday the values are restricted by validate_domain() and friends, so this\nis not exploitable from the network. But the design means (a) the safety\nof root code execution rests entirely on that validation, and (b) the\nprivilege separation the runner exists for does not hold: whoever controls\nthe unprivileged process controls a file root will execute.\n\nReplace the sourcing with a small reader that only accepts the variable\nnames openvpn writes (dns_server_*, dns_search_domain_*, dev, script_type),\nvalidates the name and assigns the value without evaluating it. Also stop\nre-evaluating already-collected search domains in the \"domains\" loop of\nthe resolvconf_file, haikuos_file and systemd scripts.\n\ndev is also pasted into a sed program by the dns-down code of the\nresolvconf_file, haikuos_file and systemd scripts. The reader therefore\nonly accepts a dev value that starts with a letter or digit, consists of\nletters, digits, \u0027_\u0027, \u0027.\u0027, \u0027-\u0027 and \u0027/\u0027 (\u0027/\u0027 because Haiku names its\ndevices tun/N) and does not contain \"..\". Those sed calls now use\n\\%regex% addresses, so a \u0027/\u0027 in dev cannot end the address either.\n\nIf the file cannot be read, the reader now exits with an error instead\nof letting the script carry on with nothing set. With \". file\" the\n/bin/sh scripts stopped there as well.\n\nThis addresses (b) only as far as the scripts are concerned: root no\nlonger executes the file, and dev can no longer inject sed commands. It\ndoes not make the file trusted input. The C side still trusts the path\nit receives from the unprivileged process, and the values are still\nhanded to resolv.conf, resolvectl, resolvconf and scutil as DNS\nconfiguration, as before.\n\nNo functional change intended for valid values. For the resolvconf_file\nand systemd scripts, the resulting resolv.conf and resolvectl arguments\nwere compared before and after the change. They are identical except\nfor the number of trailing blanks on the \"search\" line when fewer than\nsix search domains are pushed, which the old loop collapsed through word\nsplitting.\n\nChange-Id: Id05f3e4e32aeb806d762858e754adc82f42d4371\nSigned-off-by: Deri Haerudi \u003cAbcderyscreenprinting@gmail.com\u003e\n"},"branch":"refs/heads/master"},"cafe4eab2d6f519bde8d4ebef000ab02a8e66006":{"kind":"REWORK","_number":3,"created":"2026-11-25 11:15:26.000000000","uploader":{"_account_id":1000071,"name":"Deri Haerudi","email":"abcderyscreenprinting@gmail.com","username":"derioii"},"ref":"refs/changes/41/2341/3","fetch":{"anonymous http":{"url":"https://gerrit.openvpn.net/openvpn","ref":"refs/changes/41/2341/3","commands":{"Branch":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/3 \u0026\u0026 git checkout -b change-2341 FETCH_HEAD","Checkout":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://gerrit.openvpn.net/openvpn refs/changes/41/2341/3","Reset To":"git fetch https://gerrit.openvpn.net/openvpn refs/changes/41/2341/3 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"66ea3e05b6c67cc0438c58140d6ca76be0c315a0","subject":"socket: Let an optional UDP socket give up on a failed bind"}],"author":{"name":"Deri Haerudi","email":"Abcderyscreenprinting@gmail.com","date":"2026-11-24 23:00:29.000000000","tz":480},"committer":{"name":"Deri Haerudi","email":"Abcderyscreenprinting@gmail.com","date":"2026-11-25 11:12:36.000000000","tz":480},"subject":"dns-scripts: parse dns_vars_file as data instead of sourcing it","message":"dns-scripts: parse dns_vars_file as data instead of sourcing it\n\nWhen --user is used, openvpn forks a privileged runner that executes the\ndns-updown script as root. The unprivileged process writes the DNS\nvariables to a temporary file (env_set_write_file(), raw NAME\u003dvalue lines)\nand passes its path to the runner, and all in-tree dns-updown scripts then\nload that file with \". $dns_vars_file\", i.e. they execute it as shell code.\n\nToday the values are restricted by validate_domain() and friends, so this\nis not exploitable from the network. But the design means (a) the safety\nof root code execution rests entirely on that validation, and (b) the\nprivilege separation the runner exists for does not hold: whoever controls\nthe unprivileged process controls a file root will execute.\n\nReplace the sourcing with a small reader that only accepts the variable\nnames openvpn writes (dns_server_*, dns_search_domain_*, dev, script_type),\nvalidates the name and assigns the value without evaluating it. Also stop\nre-evaluating already-collected search domains in the \"domains\" loop of\nthe resolvconf_file, haikuos_file and systemd scripts.\n\ndev is also pasted into a sed program by the dns-down code of the\nresolvconf_file, haikuos_file and systemd scripts. Those sed calls now\nuse \\%regex% addresses, and the reader rejects a dev value containing\n\u0027%\u0027 or \u0027\\\u0027, so dev cannot end the address and is only ever matched as a\nregular expression. The reader also rejects a dev starting with \u0027-\u0027\n(it is passed as an argument to resolvconf and resolvectl) or containing\n\"..\" (resolvconf names a file after it). Any other interface name is\naccepted, including \u0027/\u0027 (Haiku names its devices tun/N).\n\nIf the file cannot be read, the reader now prints an error and exits\ninstead of letting the script carry on with nothing set. With \". file\"\nthe /bin/sh scripts stopped there as well.\n\nThis addresses (b) only as far as the scripts are concerned: root no\nlonger executes the file, and dev can no longer inject sed commands. It\ndoes not make the file trusted input. The C side still trusts the path\nit receives from the unprivileged process, and the values are still\nhanded to resolv.conf, resolvectl, resolvconf and scutil as DNS\nconfiguration, as before.\n\nValid values give the same result as before, except for the \"search\"\nline that the resolvconf_file, haikuos_file and systemd scripts write to\nresolv.conf: the domains are now separated by single blanks with no\ntrailing blank (the old loop left one or two), and the list stops at the\nfirst empty dns_search_domain_N. openvpn numbers the search domains\nwithout gaps, so the latter only matters for hand-written files. The\nrest of resolv.conf and the resolvectl and resolvconf arguments were\ncompared before and after the change and are identical.\n\nChange-Id: Id05f3e4e32aeb806d762858e754adc82f42d4371\nSigned-off-by: Deri Haerudi \u003cAbcderyscreenprinting@gmail.com\u003e\n"},"branch":"refs/heads/master"}},"requirements":[],"submit_records":[]}
