kevva / wifi-password

Get current wifi password
MIT License
617 stars 54 forks source link

No `iwgetid` on Linux #9

Open joepie91 opened 9 years ago

joepie91 commented 9 years ago

The following happens, seems like it's trying to use a tool that's not (always) installed by default:

sven@linux-etoq:~> wifi-password
spawn iwgetid ENOENT

Platform: openSUSE 13.1, x86_64, XFCE

kevva commented 9 years ago

Do you know of any other way in your distro? iwgetid is widely available by default on many distros as far as I know.

joepie91 commented 9 years ago

It actually seems that I do have iwgetid, but...

sven@linux-etoq:~> iwgetid
Absolute path to 'iwgetid' is '/usr/sbin/iwgetid', so running it may require superuser privileges (eg. root).

... so that is probably why. It does seem to run fine without root, though, when explicitly specifying the path.

sven@linux-etoq:~> /usr/sbin/iwgetid
sven@linux-etoq:~>

(there's no WiFi on this particular machine, it returns a valid value on my laptop though, in the same environment)

kevva commented 9 years ago

So, I guess it works then :). Weird that it reports ENOENT though.

joepie91 commented 9 years ago

Well, not quite. It seems to get stuck on it not being in /usr/bin - I'm not really sure how openSUSE handles this all. I still get the same error on my laptop, since it never actually calls /usr/sbin/iwgetid.

joepie91 commented 9 years ago

A possibly related issue; linux-wifi-password uses this code, but:

  1. This does not seem to take into account situations where not NetworkManager is used, but another manager (eg. wicd), and
  2. I'm not sure whether execFile passes through stdin/stdout - most distributions do not have passwordless sudo (I am assuming that you've tested this module primarily on Ubuntu).