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/+/2113?usp=email
to review the following change.
Change subject: openvpnserv: report error if the pipe cannot be created on start
......................................................................
openvpnserv: report error if the pipe cannot be created on start
If the first pipe instance could not be created, the service stopped
with exit code 0, e.g. when another process already owned the name.
Keep the error code of CreateClientPipeInstance() intact, logging it
before LocalFree() may change it, and use it as the exit code.
Change-Id: I056164a3016d62152dfcbd57f75d58534dda8fc8
Signed-off-by: Heiko Hund <[email protected]>
---
M src/openvpnserv/interactive.c
1 file changed, 8 insertions(+), 4 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/13/2113/1
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 5e4b555..bffc9da 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -3832,7 +3832,9 @@
if (!ConvertStringSecurityDescriptorToSecurityDescriptor(sddlString,
SDDL_REVISION_1, &sd,
NULL))
{
- MsgToEventLog(M_SYSERR,
L"ConvertStringSecurityDescriptorToSecurityDescriptor failed.");
+ DWORD error =
+ MsgToEventLog(M_SYSERR,
L"ConvertStringSecurityDescriptorToSecurityDescriptor failed.");
+ SetLastError(error);
return INVALID_HANDLE_VALUE;
}
@@ -3871,14 +3873,15 @@
&sa);
}
- LocalFree(sd);
-
if (pipe == INVALID_HANDLE_VALUE)
{
- MsgToEventLog(M_SYSERR, L"Could not create named pipe");
+ DWORD error = MsgToEventLog(M_SYSERR, L"Could not create named pipe");
+ LocalFree(sd);
+ SetLastError(error);
return INVALID_HANDLE_VALUE;
}
+ LocalFree(sd);
return pipe;
}
@@ -4043,6 +4046,7 @@
pipe = CreateClientPipeInstance();
if (pipe == INVALID_HANDLE_VALUE)
{
+ error = GetLastError();
goto out;
}
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2113?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: I056164a3016d62152dfcbd57f75d58534dda8fc8
Gerrit-Change-Number: 2113
Gerrit-PatchSet: 1
Gerrit-Owner: Heiko Hund <[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