This source file includes following definitions.
- CanUserConnectToDevTools
#include "content/public/browser/android/devtools_auth.h"
#include "base/logging.h"
namespace content {
bool CanUserConnectToDevTools(uid_t uid, gid_t gid) {
struct passwd* creds = getpwuid(uid);
if (!creds || !creds->pw_name) {
LOG(WARNING) << "DevTools: can't obtain creds for uid " << uid;
return false;
}
if (gid == uid &&
(strcmp("root", creds->pw_name) == 0 ||
strcmp("shell", creds->pw_name) == 0)) {
return true;
}
LOG(WARNING) << "DevTools: connection attempt from " << creds->pw_name;
return false;
}
}