Opened 4 years ago

Closed 3 years ago

#1359 closed Bug / Defect (fixed)

There already exists a config file named xxxx.ovpn.

Reported by: gemini Owned by:
Priority: major Milestone: release 2.5.1
Component: Generic / unclassified Version:
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords:
Cc: tct

Description

Hello,
everytime I start OpenVPN GUI I get error "There already exists a config file named xxxx.ovpn. You cannot have multiple config files with the..."
This error shows up repeatedly for each config file, so I must click OK 6 times to start program.
My config files are in config folder in location where OpenVPN is installed (not in user profile). There are no files with the same name in other sub-directories.
The only .ovpn files on my computer

Change History (8)

comment:1 Changed 4 years ago by Selva Nair

Looks like you might have edited the config directory location in the GUI settings to point to the global config directory. That will cause duplicate warnings. If so, change it back to its default %USERPROFILE%\OpenVPN\config even if you are not keeping any configs in there.

The GUI looks for configs in two locations
(i) global config directory which is set by the registry value config_dir in HKLM\Software\OpenVPN -- it is C:\Program Files\OpenVPN\config by default

(ii) User's config directory as in the GUI's settings menu -> advanced tab.

Both of these locations and their subdirectories are scanned independently.

comment:2 Changed 4 years ago by tct

Cc: tct added

comment:3 Changed 4 years ago by Gert Döring

Can we teach the GUI to either print a warning if both paths are equal, and then ignore the user path then?

(Well, of course we can, just trying to lure Selva into looking :-) )

comment:4 Changed 4 years ago by Selva Nair

Actually we do have a test for the identity of the two config locations but I didn't want users to rely on that as (i) our test is not perfect (fails easily--see below) (ii) there is no reason for users to change the user-specific config location to point to the system-wide one.

The test checks for exact identity of the names of config_dir and global_config_dir and does not take into account the character case, presence/absence of a trailing backslash, UNC vs legacy paths, embedded "\..\" etc. We could improve it, but not a priority imo.

comment:5 Changed 4 years ago by Gert Döring

Does windows have some sort of "unique file identifier" (at least on NTFS), like a file system + inode number on a unix file system? If yes, we might use that to suppress the "duplicate file name" warning if it turns out that it's the same file after all.

comment:6 Changed 4 years ago by Selva Nair

Yes, we can use GetFileInformationByHandle?() and compare volume number and file index in the returned info struct for the two directories. As per MSDN:

"You can compare the VolumeSerialNumber? and FileIndex? members returned in the
BY_HANDLE_FILE_INFORMATION structure to determine if two paths map to the same target; for example, you can compare two file paths and determine if they map to the same directory."

I think ReFS would require some more work as it uses 128 bit FileIndex? while this returns only 64 bits of it.

comment:7 Changed 3 years ago by Gert Döring

This has been merged into the GUI via the github PR

https://github.com/OpenVPN/openvpn-gui/pull/405

and is part of the OpenVPN 2.5.1 release. Thanks, Selva.

So, I think this trac ticket can now be closed (as well as #1376)

comment:8 Changed 3 years ago by Gert Döring

Milestone: release 2.6release 2.5.1
Resolution: fixed
Status: newclosed

This has been fixed. Linking to #1376 and #1415 as well (DUPs)

Note: See TracTickets for help on using tickets.