Commit Graph

37 Commits (32f2c807ee1a2c73c4129763a3bdf61c83a8b8f3)

Author SHA1 Message Date
Frank Lichtenheld 2cb3c6e417 Reformat source code with uncrustify
Closes: #445

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-07-14 11:12:16 +02:00
Selva Nair 7cc3ccda84 End open dialogs on state change
Modal dialogs opened within the connection thread may
hang around if the connection restarts. Intercept the state
change message and call EndDialog when that happens.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-26 19:59:38 -08:00
Selva Nair 141a687ddd Set status window as the owner of modal dialogs in same thread
For all dialogs in a thread, set its status window in the same
thread as the owner.

Also set the owner of message boxes appropriately instead of
using NULL. This has the side effect of some of the modal message
popups blocking access to the status Window until dismissed.

Next:
Replace Sleep by a wait that pumps messages.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-02-26 19:59:38 -08:00
Selva Nair 152130e003
Check return value of SetProp() (#591)
* Check return value of SetProp

- If SetProp() is unsuccessful, we'll crash later when GetProp()
  returns null. Add a check, log the error and close the dialog.
  
  We could abort here, but closing the current dialog and possibly the
  corresponding connection, provides a chance for the user to fix the OOM
  condition which is the most likely cause of SetProp() failure.

- In pkcs11.c if SetProp() fails just do not use bold font for
  header instead of leaking the font resource.
  Also correct a bad fixup in commit 80697ecae6: hfontProp was not set!

  Github: Fixes OpenVPN/openvpn-gui#577
  
  Signed-off-by: Selva Nair <selva.nair@gmail.com>
2023-01-24 11:40:26 -05:00
Lev Stipakov cd4748fb25 wcstok: use security-enhanced version
Replace old wcstok signature with security-enhanced
version, which stores position information between calls in
"context" parameter instead of internal per-thread context.

This allows to get rid of _CRT_NON_CONFORMING_WCSTOK
define in CMakeLists.txt

Reported-by: Kai Schtrom

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-02-02 19:44:00 +01:00
Selva Nair 56ee704501 Use C standrad compliant printf specifications
%S --> %hs in wide format strings, %ls otherwise
%s --> %ls in wide format strings, unchanged otherwise
%c --> %lc in wide format strings

Resource files together have about 970 lines affected and
were edited by looping through all with
sed -i 's/%S/%hs/g' $file
sed -i 's/%s/%ls/g' $file
All other files were manually changed (about 85 lines).

Recent versions of mingw-w64 implicitly turns on __USE_MINGW_ANSI_STDIO
if _GNU_SOURCE, _XOPEN_SOURCE etc are defined (which we do usei).

This breaks non-standard spec such as %S. Anyway, we have been
gradually getting rid of those.

MSVC builds should not be affected.

v2: multiple occurrences in same line was missed in v1 (/g missing in
sed expression). Fixed.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2021-11-03 16:20:17 -04:00
Ilya Shipitsin da6ed23618 change "%S" to "%ls" to silence mingw warning:
proxy.c:602:32: warning: ISO C does not support the ‘%S’ ms_printf format [-Wformat=]
2017-03-25 13:42:27 +05:00
Selva Nair 5a47986ccb Make options saved in registry editable by user
Option ediitng dialogs are in two tabs: General and Advanced.
Proxy related options are left in the proxy tab. Options
config_dir, config_ext, log_dir, script timeouts and
service-only flag are in the Advanced tab. All other more commonly
used flags and options are in the General tab.

- As options are editable, save values in registry only when they differ
  from the default values. This leaves the registry clean and makes changing
  options and their defaults during updates easier.

- Entries for config_dir and log_dir must be absolute paths.
  Environemental variables such as %PROFILEDIR% may be used
  to construct these.

- Empty config_dir, config_ext and log_dir entries are silently
  ignored (i.e., the current values are left unchanged).

- Store all numeric and boolean parameters in registry as DWORD instead of
  strings.

- On startup, the default parameters are loaded, then the registry is read
  and finally command-line parameters parsedi.

- Out of range script timeout values in registry truncated with a
  warning instead of fatal error. This allows the user to access the
  settings dialog and make corrections.

- Save proxy and language settings under the same
  HKCU\Software\OpenVPN-GUI key as other options instead of under Nilings.

- Save the current version of the GUI in regsitry so that updates
  can be detected and any needed registry cleanup done.

- If no version info is present in the registry any values in OpenVPN-GUI
  key in HKCU are deleted for a clean start as this is the first version
  to save registry values in HKCU. Language and proxy data if present
  under Nilings is migrated.

Note: new controls in the General tab and newly added Advanced tab dialog
are copied to all language files from the English version. These need to
be translated.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2016-08-06 11:46:15 -04:00
Heiko Hund c338ca0761 don't define callback functions as static 2014-04-08 20:06:37 +02:00
Heiko Hund 47cff87477 make auth popups show when returning from suspend 2013-04-25 17:53:16 +02:00
Heiko Hund c54a444931 fix NULL pointer dereference, closes issue #28 2013-04-10 18:50:09 +02:00
Heiko Hund beead0e1a4 enforce entry of a username when querying auth 2012-07-20 12:53:14 +02:00
Heiko Hund 3c81b7a4f2 support SOCKS 5 proxy auth notifications from mgmt 2012-07-20 11:55:10 +02:00
Heiko Hund e84834a08a supply system proxy settings to management itf
Proxy settings are fetched from the users Internet Options
for the active connection. If WPAD or a PAC script is configured
they are preferred and used for automatic proxy detection.
Proxy bypass configuration is completely ignored.
2012-07-19 16:03:50 +02:00
Heiko Hund d8737bfba2 remove limit for user/pass length, closes #3498438
Generation of the "username" and "password" management commands now
happens centrally in the helper function ManagementCommandFromInput()
in misc.c
2012-03-30 18:20:09 +02:00
Heiko Hund f420d7dcbb use CRT's _countof instead of proprietary _tsizeof 2012-03-29 17:40:34 +02:00
Alon Bar-Lev c9eb68c77f use automake in build
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>

Edited to not use libtool and implicit automake rule to build resource object
2012-03-28 10:59:44 +00:00
Alon Bar-Lev 93118db5e8 cleanup: add missing stdlib.h
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2012-03-28 10:44:54 +00:00
Heiko Hund c697eed849 fix proxy command line if config is used 2011-11-09 16:02:10 +01:00
Heiko Hund 651238c1ef use SetWindowLongPtr() for x64 compatibility 2011-07-26 09:13:07 +02:00
Heiko Hund 697ffc57f9 fix prototype of dlgproc functions 2011-07-26 09:05:16 +02:00
Heiko Hund 147d63d812 make cross compilation on linux work 2011-07-26 09:01:55 +02:00
Heiko Hund 3653d41931 fix write out of array bounds 2011-07-21 17:59:08 +02:00
Heiko Hund 42b3ead5f0 fix symbol clash 2011-07-21 09:01:04 +02:00
Heiko Hund 8249067076 let openvpn determine the Windows proxy settings 2011-07-20 17:28:08 +02:00
Heiko Hund 6934dfa783 fix loading of the proxy source from registry 2011-03-24 18:36:20 +01:00
Heiko Hund 9d918954d5 ask for HTTP proxy credentials on demand
* use "auto" parameter for --http-proxy option
 * pass proxy credentialsls via management interface
 * also closes #3223163
2011-03-24 17:54:53 +01:00
Heiko Hund a6e6d88115 refactor option handling code 2010-04-09 06:18:58 +02:00
Heiko Hund 61cb987f4d make it work when compiled as unicode 2010-03-21 10:07:14 +01:00
Heiko Hund 6939cb8792 replace GUI_* with PACKAGE_* macros 2010-03-11 22:58:45 +01:00
Heiko Hund 8eef1d5347 moved and redid MSIE proxy stuff into proxy.h
using TCHARs in preparation for unicode support
2009-02-06 15:57:56 +00:00
Heiko Hund 5783d7da94 cleaned up resource IDs 2009-02-04 15:54:37 +00:00
Heiko Hund e8dcb2f3ab moved proxy settings into a general settings dialog tab 2009-01-26 21:07:04 +00:00
Heiko Hund 3060d8f736 changes for new proxy settings dialog 2009-01-20 22:16:22 +00:00
Heiko Hund d646c7fc8c fixed compiler warnings 2009-01-19 12:28:26 +00:00
Heiko Hund 3d4aaeb5a4 switched to use of localization functions 2009-01-18 20:59:52 +00:00
Heiko Hund fd9e4ae6db import of openvpn-gui-1.0.3.zip
git-svn-id: https://openvpn-gui.svn.sourceforge.net/svnroot/openvpn-gui/trunk@2 43a1345a-9c20-4331-951f-9845fc178312
2008-12-18 11:08:35 +00:00