Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: components/devtools_remote_frontend/devtools_auth_android.cc

Issue 17389005: [Android] Abandon bundling DevTools frontends for mobile apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/browser/android/devtools_auth.h" 5 #include "components/devtools_remote_frontend/devtools_auth_android.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace content { 9 namespace devtools_remote_frontend {
10 10
11 bool CanUserConnectToDevTools(uid_t uid, gid_t gid) { 11 bool CanUserConnectToDevTools(uid_t uid, gid_t gid) {
12 struct passwd* creds = getpwuid(uid); 12 struct passwd* creds = getpwuid(uid);
13 if (!creds || !creds->pw_name) { 13 if (!creds || !creds->pw_name) {
14 LOG(WARNING) << "DevTools: can't obtain creds for uid " << uid; 14 LOG(WARNING) << "DevTools: can't obtain creds for uid " << uid;
15 return false; 15 return false;
16 } 16 }
17 if (gid == uid && 17 if (gid == uid &&
18 (strcmp("root", creds->pw_name) == 0 || // For rooted devices 18 (strcmp("root", creds->pw_name) == 0 || // For rooted devices
19 strcmp("shell", creds->pw_name) == 0)) { // For non-rooted devices 19 strcmp("shell", creds->pw_name) == 0)) { // For non-rooted devices
20 return true; 20 return true;
21 } 21 }
22 LOG(WARNING) << "DevTools: connection attempt from " << creds->pw_name; 22 LOG(WARNING) << "DevTools: connection attempt from " << creds->pw_name;
23 return false; 23 return false;
24 } 24 }
25 25
26 } // namespace content 26 } // namespace devtools_remote_frontend
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698