commit | d57fa628e5a19fa6b6811bef34fd9dbc88aebed5 | [log] [tgz] |
---|---|---|
author | Vitaly Buka <vitalybuka@google.com> | Wed Oct 28 11:28:02 2015 -0700 |
committer | Vitaly Buka <vitalybuka@google.com> | Wed Oct 28 20:15:56 2015 +0000 |
tree | c0f6d1da97f0e8016cdc463fcdd488bc015df514 | |
parent | c18c7cfe350a5e671deaf1c2eaa30868e6ceb67f [diff] |
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() {