Bug 241798 - nm-openvpn-service does not prompt for password and segfaults
Summary: nm-openvpn-service does not prompt for password and segfaults
Status: RESOLVED DUPLICATE of bug 262555
Alias: None
Product: Network Management
Classification: Miscellaneous
Component: knetworkmanager (show other bugs)
Version: 0.9
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Will Stephenson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-15 08:28 UTC by Toshio Kuratomi
Modified: 2011-03-15 17:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toshio Kuratomi 2010-06-15 08:28:29 UTC
Version:           0.9 (using Devel) 
OS:                Linux

I'm using knetworkmanager with an openvpn network.  My vpn connection takes a username and password with a one-time-password component (a time based key from RSA).  For this reason, I set a username but not a password in the configuration dialog for the vpn connection.  (Same happens if I don't set either a username or password).

With this configuration, I click on the menu entry to turn on the vpn.  The menu may flicker or close or stay open without a visible change.  Looking in /var/log/messages I find a message like this::

Jun 14 23:16:00 unaka kernel: nm-openvpn-serv[30818]: segfault at 0 ip 00000035746800d2 sp 00007fff49192de8 error 4 in libc-2.12.so[3574600000+175000]

After instrumenting nm-openvpn-server, I find that this section of code is where the crash is coming from::
etworkManager-openvpn-0.8.0.997/src/nm-openvpn-service.c: handle_management_socket
>--->--->--->---qpass = ovpn_quote_string (io_data->password);
>--->--->--->---buf = g_strdup_printf ("username \"%s\" \"%s\"\n"
>--->--->--->---                       "password \"%s\" \"%s\"\n",
>--->--->--->---                       auth, quser,
>--->--->--->---                       auth, qpass);
>--->--->--->---memset (qpass, 0, strlen (qpass));

At the point of the memset, qpass == "\0".

Although this code should probably return an error rather than crashing, the issue for me is that KNetworkManager is not giving me a prompt to enter my password.  If it did that, I'd be able to enter my password and we wouldn't hit this other bug.  Since it does not, even if this bug were to be fixed, I still wouldn't have the opportunity to enter my One-time-password.

Reproducible: Always

Steps to Reproduce:
In knetworkmanager manage connections, click on the vpn tab.  Click on the "Add" button; OpenVPN.  Set the vpn connection up to work.  Then go back and in the OpenVPN tab set connection type to password.  Enter a valid CA File.  Type in a username.  Blank the password field.  Clik Ok.  Then Apply.  Then try to connect to the vpn by clicking on the new configuration on the knetworkmanager context menu.

Actual Results:  
This will silently fail and not display a password dialog.  Viewing /var/log/messages will show you that nm-openvpn-service experienced a segfault.



Expected Results:  
Prompt for the password and then connect to the vpn.
Comment 1 Dominik Pospisil 2010-07-23 11:02:40 UTC
I am experiencing the same problem with vpnc network.
Comment 2 Lamarque V. Souza 2011-03-15 17:04:55 UTC

*** This bug has been marked as a duplicate of bug 262555 ***
Comment 3 Lamarque V. Souza 2011-03-15 17:11:34 UTC
Git commit 9e167b9f62b5df97a8cda333fbc6418772a5088c by Lamarque V. Souza.
Committed on 15/03/2011 at 16:51.
Pushed by lvsouza into branch 'master'.

Applying vpnc: fix storing/loading of secrets type
Thanks Andrey Borzenkov for this patch.

REVIEW: 100857
CCBUG: 241798

M  +3    -3    vpnplugins/vpnc/vpncauth.cpp     
M  +5    -5    vpnplugins/vpnc/vpncwidget.cpp     

http://commits.kde.org/networkmanagement/9e167b9f62b5df97a8cda333fbc6418772a5088c