Check if we have root access Hostapd fails without root access. Change-Id: Ib7211685795c3a1d5de64c014a0b28a71f2fe9fa Reviewed-on: https://weave-review.googlesource.com/1430 Reviewed-by: Johan Euphrosine <proppy@google.com>
diff --git a/libweave/examples/provider/wifi_manager.cc b/libweave/examples/provider/wifi_manager.cc index ac1c604..c70aad4 100644 --- a/libweave/examples/provider/wifi_manager.cc +++ b/libweave/examples/provider/wifi_manager.cc
@@ -41,6 +41,8 @@ WifiImpl::WifiImpl(provider::TaskRunner* task_runner, bool force_bootstrapping) : force_bootstrapping_{force_bootstrapping}, task_runner_{task_runner} { + CHECK_EQ(0, getuid()) + << "WiFi manager expects root access to control WiFi capabilities"; StopAccessPoint(); } WifiImpl::~WifiImpl() {