Persistent connections: show an error msg when connect fails

If '--management' option cannot be parsed in the config file of a
persistent profile (due to missing option, unreadable password etc.),
connecting it from the GUI menu fails.
In such cases show an error message instead of silently failing.
The message is shown only during manual connect attempts,
not during auto-connect or resume.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
pull/530/head
Selva Nair 2022-10-16 11:37:23 -04:00
parent 2ea4bf9229
commit d6775b9b71
23 changed files with 28 additions and 0 deletions

View File

@ -252,6 +252,7 @@
#define IDS_ERR_ADD_USER_TO_ADMIN_GROUP 1257
#define IDS_NFO_BYTECOUNT 1258
#define IDS_NFO_STATE_ONHOLD 1259
#define IDS_ERR_PARSE_MGMT_OPTION 1260
/* Program Startup Related */
#define IDS_ERR_OPEN_DEBUG_FILE 1301

View File

@ -2326,6 +2326,12 @@ StartOpenVPN(connection_t *c)
{
if (!ParseManagementAddress(c))
{
/* Show an error if manually connecting */
if (c->state == disconnected)
ShowLocalizedMsgEx(MB_OK|MB_ICONERROR, o.hWnd, TEXT(PACKAGE_NAME), IDS_ERR_PARSE_MGMT_OPTION,
c->config_dir, c->config_file);
else
c->state = disconnected;
TerminateThread(hThread, 1);
return false;
}

View File

@ -404,6 +404,7 @@ Více informací najdete v logu (%ls)."
IDS_NFO_SERVICE_STOPPED "Služba OpenVPN zastavena."
IDS_NFO_ACTIVE_CONN_EXIT "Některá spojení jsou stále aktivní. Pokud OpenVPN GUI ukončíte, budou přerušena.\
\n\nOpravdu chcete aplikaci ukončit?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Některá spojení jsou stále aktivní. Díky běžící službě OpenVPN \
zůstanete připojeni, i když ukončíte OpenVPN GUI.\n\n\
Chcete pokračovat a aplikaci ukončit?"

View File

@ -406,6 +406,7 @@ Konsultieren Sie die Log-Datei (%ls) für weitere Informationen."
IDS_NFO_SERVICE_STOPPED "OpenVPN-Dienst beendet."
IDS_NFO_ACTIVE_CONN_EXIT "Es exisiert noch eine aktive Verbindung, welche geschlossen wird, wenn Sie OpenVPN GUI beenden.\
\n\nSind Sie sicher, dass Sie das Programm beenden möchten?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Der OpenVPN-Dienst ist gestartet und verbunden. \
Die Verbindung besteht solange, bis Sie OpenVPN GUI beenden.\n\n\
\n\nSind Sie sicher, dass Sie das Programm beenden möchten?"

View File

@ -403,6 +403,7 @@ ligger i forskellige kataloger."
IDS_NFO_ACTIVE_CONN_EXIT "Aktive forbindelser vil blive afbrudt hvis du afslutter OpenVPN GUI. \
\n\nVil du afslutte?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Du er forbundet med OpenVPN (OpenVPN tjenesten kører). \
Aktive forbindelser vil forblive tilsluttet hvis du afslutter OpenVPN GUI.\n\n\
Vil du afslutte?"

View File

@ -418,6 +418,7 @@ View log file (%ls) for more details."
IDS_NFO_SERVICE_STOPPED "OpenVPN Service stopped."
IDS_NFO_ACTIVE_CONN_EXIT "There are still active connections that will be closed if you exit OpenVPN GUI.\
\n\nAre you sure you want to exit?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "You are currently connected (the OpenVPN Service is running). \
You will stay connected even if you exit OpenVPN GUI.\n\n\
Do you want to proceed and exit OpenVPN GUI?"

View File

@ -400,6 +400,7 @@ están en directorios diferentes."
IDS_NFO_SERVICE_STOPPED "Servicio OpenVPN detenido."
IDS_NFO_ACTIVE_CONN_EXIT "Aún hay conexiones activas que serán cerradas si se sale de OpenVPN GUI.\
\n\nEstá seguro de querer salir?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Ahora mismo está conectado (el servicio OpenVPN está corriendo). \
Seguriá conectado incluso si sale de OpenVPN GUI.\n\n\
¿Quiere proceder y salir de OpenVPN GUI?"

View File

@ -406,6 +406,7 @@ BEGIN
IDS_NFO_SERVICE_STOPPED "خدمت OpenVPN پایان یافت."
IDS_NFO_ACTIVE_CONN_EXIT "هنوز اتصالات فعال وجود دارد که در صورت خروج بسته خواهد شد - OpenVPN GUI.\
\n\nشما مطمئن هستید میخواهید خارج شوید?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "شما فعلا متصل هستید (سرویس OpenVPN در حالت اجراست). \
شما می توانید متصل بمانید حتی اگر از OpenVPN GUI خارج شدید.\n\n\
شما می خواهید پروسه خارج شدن رو انجام بدهید - OpenVPN GUI?"

View File

@ -403,6 +403,7 @@ Lisätietoja lokitiedostossa (%ls)."
IDS_NFO_SERVICE_STOPPED "OpenVPN-palvelu pysäytetty."
IDS_NFO_ACTIVE_CONN_EXIT "Jos OpenVPN GUI suljetaan, aktiiviset yhteydet katkeavat.\
\n\nHaluatko varmasti jatkaa?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Yhteys on muodostettu OpenVPN-palvelun avulla. \
Yhteydet eivät katkea, vaikka OpenVPN GUI suljettaisiinkin.\n\n\
Suljetaanko OpenVPN GUI?"

View File

@ -403,6 +403,7 @@ Afficher le fichier journal (%ls) pour plus de détails."
IDS_NFO_SERVICE_STOPPED "Service OpenVPN arreté."
IDS_NFO_ACTIVE_CONN_EXIT "Les connexions en cours seront interrompues si vous fermez OpenVPN GUI.\
\n\nVous êtes sûr de vouloir fermer l'application ?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Vous êtes actuellement connecté (Le service OpenVPN est actif). \
Vous restez connecté même si vous terminez l'OpenVPN GUI.\n\n\
Voulez-vous continuer et fermer l'OpenVPN GUI ?"

View File

@ -403,6 +403,7 @@ Consulta il file di log (%ls) per maggiori dettagli."
IDS_NFO_SERVICE_STOPPED "Servizio OpenVPN arrestato."
IDS_NFO_ACTIVE_CONN_EXIT "Ci sono ancora connessioni attive che verranno chiuse se esci dall'interfaccia di OpenVPN.\
\n\nSei sicuro di voler uscire?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Al momento sei connesso (il servizio di OpenVPN è in funzione). \
Rimarrai connesso anche se esci dall'interfaccia di OpenVPN.\n\n\
Vuoi continuare e uscire da dall'interfaccia di OpenVPN?"

View File

@ -404,6 +404,7 @@ BEGIN
IDS_NFO_SERVICE_STOPPED "OpenVPNサービスが停止されました。"
IDS_NFO_ACTIVE_CONN_EXIT "OpenVPN GUIを終了すると、現在接続中の接続が切断されます。\
\n\n終了してもよろしいですか"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "現在接続中ですOpenVPN サービスが実行中です)。\
OpenVPN GUIを終了してもこの接続を継続します。\n\n\
OpenVPN GUIをこのまま終了しますか"

View File

@ -401,6 +401,7 @@ BEGIN
IDS_NFO_SERVICE_STOPPED "OpenVPN Service가 중지 되었습니다."
IDS_NFO_ACTIVE_CONN_EXIT "OpenVPN GUI을 종료하면 현재 연결되어 있는 접속이 중단 됩니다.\
\n\n그래도 종료 하겠습니까?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "현재 접속 중 입니다. (OpenVPN Service가 실행 중 입니다.) \
OpenVPN GUI를 종료 하더라도, 접속은 중단되지 않습니다.\n\n\
OpenVPN GUI를 이대로 종료 하겠습니까?"

View File

@ -404,6 +404,7 @@ Bekijk logbestand (%ls) voor meer informatie."
IDS_NFO_SERVICE_STOPPED "OpenVPN Service gestopt."
IDS_NFO_ACTIVE_CONN_EXIT "Er zijn nog actieve connecties die verbroken zullen worden indien OpenVPN GUI afgesloten wordt.\
\n\nBent u zeker dan u wilt afsluiten?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Er is momenteel een actieve verbinding (OpenVPN services is gestart). \
De verbinding blijft actief ook als OpenVPN GUI afgesloten wordt.\n\n\
OpenVPN GUI afsluiten?"

View File

@ -398,6 +398,7 @@ konfigurasjonsfiler med samme navn, selv om de ligger i ulike kataloger."
IDS_NFO_SERVICE_STARTED "OpenVPN-tjenesten startet."
IDS_NFO_SERVICE_STOPPED "OpenVPN-tjenesten stoppet."
IDS_NFO_ACTIVE_CONN_EXIT "Aktive tilkoblinger vil bli avbrutt om du avslutter OpenVPN GUI.\n\nVil du avslutte?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Du er tilkoblet med OpenVPN (OpenVPN-tjenesten kjører). \
Aktive tilkoblinger vil forbli tilkoblet om du avslutter OpenVPN GUI.\n\n\
Vil du avslutte?"

View File

@ -402,6 +402,7 @@ umieszczone są w innych katalogach."
IDS_NFO_SERVICE_STOPPED "Usługa OpenVPN zatrzymana."
IDS_NFO_ACTIVE_CONN_EXIT "Istnieją aktywne połączenia, które zostaną zakończone jeśli zamkniesz OpenVPN GUI.\
\n\nCzy chcesz kontynuować?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Obecnie jesteś połączony (usługa OpenVPN jest uruchomiona). \
Połączenie zostanie aktywne nawet po zakończeniu programu OpenVPN GUI.\n\n\
Czy chcesz kontynuować i zakończyć OpenVPN GUI?"

View File

@ -402,6 +402,7 @@ Consulte o arquivo de log (%ls) para mais detalhes."
IDS_NFO_SERVICE_STOPPED "Serviço OpenVPN parado."
IDS_NFO_ACTIVE_CONN_EXIT "Ainda existem conexões ativas. Estas conexões serão encerradas se você sair do OpenVPN GUI.\
\n\nVocê tem certeza de que deseja sair?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Você está conectado atualmente (Serviço OpenVPN está rodando). \
Você permanecerá conectado mesmo que feche o OpenVPN GUI.\n\n\
Você deseja continuar e fechar o OpenVPN GUI?"

View File

@ -403,6 +403,7 @@ BEGIN
IDS_NFO_SERVICE_STOPPED "Служба OpenVPN остановлена."
IDS_NFO_ACTIVE_CONN_EXIT "Ещё присутствуют активные соединения, которые будут закрыты, если вы выйдите из OpenVPN GUI.\
\n\nВы уверены, что хотите выйти?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Вы в данный момент подключены (служба OpenVPN запущена). \
Вы останетесь подключенными, даже если вы выйдете из OpenVPN GUI.\n\n\
Вы хотите продолжить и выйти из OpenVPN GUI?"

View File

@ -399,6 +399,7 @@ konfigurations filer med samma namn, även om de ligger i olika kataloger."
IDS_NFO_SERVICE_STARTED "OpenVPN Service startad."
IDS_NFO_SERVICE_STOPPED "OpenVPN Service stoppad."
IDS_NFO_ACTIVE_CONN_EXIT "Du har aktiva uppkopplingar i gång som kommer kopplas ner om du avslutar OpenVPN GUI.\n\nÄr du säker på att du vill avsluta?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Du är uppkopplad med OpenVPN (OpenVPN tjänsten är igång). \
Du kommer att förbli uppkopplad även om du avslutar OpenVPN GUI.\n\n\
Är du säker på att du vill avsluta OpenVPN GUI?"

View File

@ -402,6 +402,7 @@ kayıt edemezsiniz."
IDS_NFO_SERVICE_STOPPED "OpenVPN Service durduruldu."
IDS_NFO_ACTIVE_CONN_EXIT "OpenVPN GUI ' yi kapatırsanız, açık olan bağlantılarınız sonlandırılacaktır.\
\n\nÇıkmak istediğinize emin misiniz?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "Şu an bağlısınız(OpenVPN Servisi çalışıyor). \
OpenVPN GUI yi kapatsanız dahi bağlantı devam edecek.\n\n\
OpenVPN GUI den çıkmak istiyor musunuz?"

View File

@ -402,6 +402,7 @@ BEGIN
IDS_NFO_SERVICE_STOPPED "Служба OpenVPN зупинена."
IDS_NFO_ACTIVE_CONN_EXIT "Ще є активні з'єднання, які будуть зупинені, якщо ви завершите роботу OpenVPN GUI.\
\n\nВи впевнені, що бажаєте завершити?"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "У цей час система підключена (сервіс OpenVPN стартував). \
Ви залишитися підключені, навіть якщо ви завершили роботу OpenVPN GUI.\n\n\
Ви бажаєте залишити активним сервіс та завершити роботу OpenVPN GUI?"

View File

@ -405,6 +405,7 @@ BEGIN
IDS_NFO_SERVICE_STOPPED "已停止 OpenVPN 服务。"
IDS_NFO_ACTIVE_CONN_EXIT "当前还有活动的连接,您若退出 OpenVPN GUI 该连接将被中断。\
\n\n您确定要退出吗"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "您当前已连接OpenVPN 服务正在运行中)。\
退出 OpenVPN GUI 仍将保持连接。\n\n\
您确定要退出吗?"

View File

@ -405,6 +405,7 @@ BEGIN
IDS_NFO_SERVICE_STOPPED "已停止 OpenVPN 服務。"
IDS_NFO_ACTIVE_CONN_EXIT "目前還有進行中的連線,若您結束 OpenVPN GUI 該連線將被中斷。\
\n\n您確定要離開嗎"
IDS_ERR_PARSE_MGMT_OPTION "Could not parse --management option in <%ls%ls>."
IDS_NFO_SERVICE_ACTIVE_EXIT "您目前已連線OpenVPN 服務正在執行中)。\
離開 OpenVPN GUI 仍將保持連線。\n\n\
您確定要離開嗎?"