Gert Doering has uploaded a new patch set (#3) to the change originally created 
by Răzvan Cojocaru. ( https://gerrit.openvpn.net/c/openvpn/+/2161?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by Antonio Quartulli, Code-Review+2 by Heiko Hund


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. Record the undo data first, as done for NRPT rules, and
drop it if adding the domains fails.

Broken since ae90cbad ("dns: support multiple domains without DHCP").

Change-Id: I7ffae4da3b29521844a31d234fe6a9dd08954cf4
Signed-off-by: Razvan Cojocaru <[email protected]>
Acked-by: Antonio Quartulli <[email protected]>
Acked-by: Heiko Hund <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2161
Message-Id: <[email protected]>
URL: 
https://www.mail-archive.com/[email protected]/msg41181.html
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpnserv/interactive.c
1 file changed, 10 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/61/2161/3

diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 81205d6..5d2abeb 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -1823,13 +1823,19 @@
         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)
+        /* Add undo information first in case there's no heap left */
+        if (AddListItem(&(*lists)[undo_domains], undo_data) != NO_ERROR)
         {
-            RemoveDnsSearchDomains(list_key, wide_domains);
             free(wide_domains);
             free(undo_data);
-            undo_data = NULL;
+            goto out;
+        }
+
+        if (!AddDnsSearchDomains(list_key, have_list, wide_domains))
+        {
+            RemoveListItem(&(*lists)[undo_domains], CmpAny, NULL);
+            free(wide_domains);
+            free(undo_data);
             goto out;
         }
     }

--
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: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7ffae4da3b29521844a31d234fe6a9dd08954cf4
Gerrit-Change-Number: 2161
Gerrit-PatchSet: 3
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Antonio Quartulli <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Heiko Hund <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to