Patch: running external commands from wpa_supplicant

Jouni Malinen jkmaline at
Sat Feb 12 22:11:47 EST 2005

On Wed, Feb 02, 2005 at 10:54:32AM +0100, Henrik Brix Andersen wrote:

> The main purpose of my patch is to allow using wpa_supplicant as a
> complete replacement for waproamd - allowing wpa_supplicant to control
> the distribution specific networking scripts when associating to a new
> network.

OK. Though, I'm still not very happy about executing external programs
for two reasons: blocking wpa_supplicant and potential security problems
when running something else with root privileges. Blocking can be
resolved by forking a child process to run the commands (on OSes that
support this). This can also be used to close all file descriptors to
prevent external commands from having access to them.

I'm hoping to be able to drop root privileges from most of the
wpa_supplicant operation. If I understood correctly, you would like to
be able to run external commands that are likely to require root
privileges, which is against the goal of getting wpa_supplicant to not
need root privileges for most of the code..

Please also note that the current development version has a new
function, wpa_supplicant_set_state(), which has knowledge of when then
connection is truly completed, i.e., when data packets can be sent, and
even when this happened after a roam to a new AP. Currently, external
programs can get an event through the wpa_supplicant control interface
when connection has been established. This should take care of the cases
where there is another daemon processing network events.

If you believe that it would be better to to get calls to external
programs, one option would be to write a minimal daemon that opens a
connection to wpa_supplicant control interface and takes care of calling
these external programs. This should eliminate both of my objections
about blocking wpa_supplicant and extra requirement for root privileges.

Jouni Malinen                                            PGP id EFC895FA

More information about the HostAP mailing list