PSK fails to generate

Bug #264447 reported by uboltun
2
Affects Status Importance Assigned to Milestone
wicd
Fix Released
Medium
Dan O'Reilly

Bug Description

For some reason wicd fails to execute wpa_passphrase. I tried to trace the problem and found that in networking.py the output of wpa_passphrase is blank. I stripped that part of the script that starts with :

 def generate_psk_and_authenticate(self, wiface):
..........................

and put some debug dumps but even when I execute "wpa_passphrase" without any arguments the output is blank. Any other command such as "echo .." produce output. This seems to be specific to this part of the code only, because when I use misc.Run in a separate python script everything works fine. I also tried to use os.popen instead of Popen and get the same result. If you have suggestions, I can try to run some more tests and at this point I am not sure if this is a bug related to wpa_passphrase or wicd.

Revision history for this message
uboltun (ekhaliul-gmail) wrote :

The problem seems to be related to some permission settings. I set the path to a locally built wpa_passphrase in my home directory, and now it works fine. When I do 'ls -l' for both wpa_passphrase the only difference that I see is that the owner and group is "root" in the first case and "username" in the other. Does anyone knows how to fix this ?

Revision history for this message
Dan O'Reilly (oreilldf) wrote :

Very strange. The wpa_passphrase command is executed as root, so it really shouldn't matter that the copy it of wpa_passphrase its running is owned by root. If you chown and chgrp the wpa_passphrase in your home directory to root, does it fail as well?

Revision history for this message
uboltun (ekhaliul-gmail) wrote :

So, I did this simple experiment. When I changed the owner and group to root for the local wpa_passphrase everything works. Then I copied the file to /usr/local/sbin and changed the script so it executes the original 'wpa_passphrase', and I get the error again :
WARNING: PSK generation failed! Falling back to wireless key.

Revision history for this message
Dan O'Reilly (oreilldf) wrote : Re: [Bug 264447] Re: PSK fails to generate

If you replace just the "wpa_passphrase" command with the full path to
either the copy in /usr/local/sbin, or to the original copy (probably
in /usr/bin), what are the results then?

On Sun, Sep 7, 2008 at 2:22 AM, uboltun <email address hidden> wrote:
> So, I did this simple experiment. When I changed the owner and group to root for the local wpa_passphrase everything works. Then I copied the file to /usr/local/sbin and changed the script so it executes the original 'wpa_passphrase', and I get the error again :
> WARNING: PSK generation failed! Falling back to wireless key.
>
> --
> PSK fails to generate
> https://bugs.launchpad.net/bugs/264447
> You received this bug notification because you are a member of Wicd-
> devel, which is the registrant for wicd.
>

Revision history for this message
uboltun (ekhaliul-gmail) wrote :

When I set the full path /usr/local/sbin/wpa_passphrase it work fine. I also tried to investigate if there is another copy of wpa_passphrase somewhere.
When I do
$ sudo slocate -u
$ slocate wpa_passphrase
I am getting only the /use/local/sbin/wpa_passphrase besides some other local copies in my home folder.
I also tried :
$ which wpa_passphrase
/usr/local/sbin/wpa_passphrase

So it seems that the full path works , but when using just the command the output is blank and I get the above warning.

Revision history for this message
uboltun (ekhaliul-gmail) wrote :

The problem seems to originate from the folder /usr/local/sbin. When I move the wpa_passphrase to /usr/bin everything works like it should. I can not understand why there is a difference.

Revision history for this message
Dan O'Reilly (oreilldf) wrote :

I'll have wicd use the full path to wpa_passphrase in future releases.

Changed in wicd:
assignee: nobody → oreilldf
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
uboltun (ekhaliul-gmail) wrote :

Thanks Dan! I wonder if this is specific to the settings on my computer or a general problem for Ubuntu distribution.

Revision history for this message
Dan O'Reilly (oreilldf) wrote :

I don't think its an Ubuntu problem necessarily; I use Ubuntu and
don't have a problem. But the problem also isn't specific to you,
we've seen several other people have this same issue. We just haven't
figured out what the common thread between all of you are. Luckily we
have a workaround now (thanks for your help in finding one btw), so we
don't have to worry about it.

On Thu, Sep 18, 2008 at 1:03 PM, uboltun <email address hidden> wrote:
> Thanks Dan! I wonder if this is specific to the settings on my computer
> or a general problem for Ubuntu distribution.
>
> --
> PSK fails to generate
> https://bugs.launchpad.net/bugs/264447
> You received this bug notification because you are a member of Wicd-
> devel, which is the registrant for wicd.
>

Revision history for this message
Dan O'Reilly (oreilldf) wrote :

I've committed a fix for this to the trunk.

Changed in wicd:
status: In Progress → Fix Committed
Dan O'Reilly (oreilldf)
Changed in wicd:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.