`nmcli connection up` overwrites VPN configuration file
When using nmcli connection up
for an Open VPN connection, the connection file is overwritten.
Steps to reproduce:
- As user
foo-lambda-random-joe
, install an Open VPN connection file - Modify the user name in the .vpn file to match your actual name, i.e. add
username=realvpnuser
entry in[vpn]
section - Carefully avoid typing
nmcli connection reload
because you are clueless - In some other terminal, type
while grep username /etc/NetworkManager/system-connections/AMS2.ovpn; do echo -n $(date):\ ; done
- Do
nmcli c up <VPN name>
- The password prompt pops up. Notice that at that point, the
grep
loop no longer sees theusername
entry - The password is rejected, but since you are clueless and did not actually run the
grep
loop in real life, you wonder why
From these observations, it seems that
-
nmcli c up
overwrites the VPN file (confirmed from date stamps) for no obvious reason (to the casual user) - This overwrite does not bother checking if the file was updated since last loaded.
Would be very difficult to notice that the VPN configuration file has been modified (presumably by some user) and to automatically trigger a reload?