"Failed to spawn script" in log
The message doesn't look right to me:
script.c
Lines 642 to 649 in 3c34c4ac
if (ret < 0) {
char *errstr = openconnect__win32_strerror(GetLastError());
vpn_progress(vpninfo, PRG_ERR,
_("Failed to spawn script '%s' for %s: %s\n"),
vpninfo->vpnc_script, reason, errstr);
free(errstr);
goto cleanup;
}
There are multiple reasons for ret < 0
:
-
CreateProcessW fails and returns 0 (ret is set to
-EIO
). -
GetExitCodeProcess fails returns 0 (ret is set to
-EIO
). - The
exit_status
returned by GetExitCodeProcess is positive (ret is set to-EIO
).
Printing Failed to spawn script
seems OK in case 1, more or less OK in case 2, but certainly not OK in case 3. It results in the message seen in ocserv#590 (comment 1798360992):
2024-03-03 13:09:39 | 5468 | Script 'C:/Program Files/OpenConnect-GUI\vpnc-script.js' returned error 1
2024-03-03 13:09:39 | 5468 | Failed to spawn script 'C:/Program Files/OpenConnect-GUI\vpnc-script.js' for connect: Операция успешно завершена.
where Операция успешно завершена
means "operation completed successfully".
Edited by Dimitri Papadopoulos Orfanos