1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/public/browser/android/devtools_auth.h"
7 #include "base/logging.h"
11 bool CanUserConnectToDevTools(uid_t uid, gid_t gid) {
12 struct passwd* creds = getpwuid(uid);
13 if (!creds || !creds->pw_name) {
14 LOG(WARNING) << "DevTools: can't obtain creds for uid " << uid;
18 (strcmp("root", creds->pw_name) == 0 || // For rooted devices
19 strcmp("shell", creds->pw_name) == 0)) { // For non-rooted devices
22 LOG(WARNING) << "DevTools: connection attempt from " << creds->pw_name;
26 } // namespace content