Attention is currently required from: Arne Schwabe.
Hello Arne Schwabe,
I'd like you to do a code review.
Please visit
https://gerrit.openvpn.net/c/openvpn/+/2161?usp=email
to review the following change.
Change subject: openvpnserv: only remove search domains that were added
......................................................................
openvpnserv: only remove search domains that were added
When AddDnsSearchDomains() failed, SetDnsSearchDomains() still called
RemoveDnsSearchDomains() with the new domains, which removes matching
domains already in the search list, e.g. ones configured before the
VPN connected. Only remove them if they were added and recording the
undo data failed.
Broken since ae90cbad ("dns: support multiple domains without DHCP").
Change-Id: I7ffae4da3b29521844a31d234fe6a9dd08954cf4
Signed-off-by: Razvan Cojocaru <[email protected]>
---
M src/openvpnserv/interactive.c
1 file changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/61/2161/1
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 81205d6..4575b93 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -1823,10 +1823,13 @@
strncpy_s(undo_data->itf_name, sizeof(undo_data->itf_name), itf_name,
_TRUNCATE);
undo_data->domains = wide_domains;
- if (AddDnsSearchDomains(list_key, have_list, wide_domains) == FALSE
- || AddListItem(&(*lists)[undo_domains], undo_data) != NO_ERROR)
+ const BOOL added = AddDnsSearchDomains(list_key, have_list,
wide_domains);
+ if (!added || AddListItem(&(*lists)[undo_domains], undo_data) !=
NO_ERROR)
{
- RemoveDnsSearchDomains(list_key, wide_domains);
+ if (added)
+ {
+ RemoveDnsSearchDomains(list_key, wide_domains);
+ }
free(wide_domains);
free(undo_data);
undo_data = NULL;
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2161?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7ffae4da3b29521844a31d234fe6a9dd08954cf4
Gerrit-Change-Number: 2161
Gerrit-PatchSet: 1
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel