Ticket #8642 (closed defect: fixed)

Opened 6 years ago

Last modified 4 years ago

Bug in WPA key dialog prevents certain passwords from being accepted

Reported by: Eben Owned by: cscott
Priority: high Milestone: 8.2.0 (was Update.2)
Component: sugar Version: not specified
Keywords: 8.2.0:? blocks-:8.2.0 r+ polish:8.2.0 8.2-764:? Cc: mstone, marco, erikos, holt
Action Needed: test in release Verified: no
Deployments affected: Blocked By:


I've been trying to connect to my access point with 763, but when I press enter (or click the OK button) nothing happens. Looking at the logs, I see two strange things. It reports:

(s, 0) = commands.getstatusoutput(command)
if s != 0:
    raise RuntimeError("Error hashing passphrase: %s" % o)

global RuntimeError = undefined
o = ''

So, first of all I have no idea why RuntimeError is undefined. That aside, the real problem is that the passphrase string passed to /usr/bin/wpa_passphrase isn't properly escaped or quoted (my passphrase includes a single quote), which is causing it to crap out and return nothing.

I tried running the script directly with my passphrase properly quoted and/or escaped and it ran fine.

It seems this is easy to fix, but a big win to fix for G1G1.


fix-wpa-passphrase.patch (1.1 kB) - added by cscott 6 years ago.
Patch fixing the problem.

Change History

Changed 6 years ago by cscott

Patch fixing the problem.

Changed 6 years ago by cscott

  • cc mstone added; m_stone removed
  • keywords r? added
  • next_action changed from code to review

The use of commands.getstatusoutput is very sketchy. In the attached patch, I've replaced this with subprocess.Popen, which is the preferred way to invoke other programs these days.

Changed 6 years ago by cscott

(Reviewers: the import should be moved to the top of the file, and I'll do that before I commit if the patch is approved, but I was trying to make this easy for Eben to type in my hand to get his machine on the network.)

Changed 6 years ago by Eben

I just "patched" my machine by hand, and succeeded in connecting to my network without a problem. Thanks for the lightning fast fix, Scott!

Changed 6 years ago by mstone

I would be willing to consider accepting this fix as WPA polish which is certainly important to us pending packaging and acceptance in joyride. It remains to be seen whether we will make any more 8.2.0 builds.

Changed 6 years ago by mstone

  • cc marco, erikos added

Changed 6 years ago by mstone

  • keywords blocks-:8.2.0 polish:8.2.0 added; blocks?:8.2.0 removed

Greg and I believe that this is not a blocker (though internet connectivity is really important to us.)

Changed 6 years ago by holt

  • cc holt added

Changed 6 years ago by marco

  • keywords r+ added; r? removed

Changed 6 years ago by cscott

For fun, try using

'; /bin/rm -rf '~

as your WPA password!

Obligatory xkcd: http://xkcd.com/327/

Changed 6 years ago by cscott

  • next_action changed from review to package

Pushed to sucrose-0.82 and master.

Changed 6 years ago by marco

  • keywords 8.2-764:? added
  • next_action changed from package to test in build

Changed 6 years ago by cscott

  • next_action changed from test in build to approve for release

In joyride-2485 and later. Eben, please retest? Michael, consider for next stable build.

Changed 6 years ago by mstone

  • next_action changed from approve for release to add to release

Changed 6 years ago by cscott

  • next_action changed from add to release to test in release

Packages added to stable repository in commit 59fd5419 for build 764. Please confirm the package versions are correct and test in stable build 764 or later.

Changed 4 years ago by dsd

  • status changed from new to closed
  • resolution set to fixed

Looks like this was correctly fixed for 8.2, and for later releases all this stuff changed anyway.

Note: See TracTickets for help on using tickets.