Chromium Code Reviews| Index: chromeos/dbus/fake_auth_policy_client.cc |
| diff --git a/chromeos/dbus/fake_auth_policy_client.cc b/chromeos/dbus/fake_auth_policy_client.cc |
| index f37f1ea53bc88d6aa576485db9d67fb310e6978b..78f3edcf4cef525e55ee06aa34be27f2e3c1f8b0 100644 |
| --- a/chromeos/dbus/fake_auth_policy_client.cc |
| +++ b/chromeos/dbus/fake_auth_policy_client.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/location.h" |
| #include "base/md5.h" |
| #include "base/path_service.h" |
| +#include "base/strings/string_split.h" |
| #include "base/task_scheduler/post_task.h" |
| #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
| #include "chromeos/chromeos_paths.h" |
| @@ -65,6 +66,13 @@ void FakeAuthPolicyClient::JoinAdDomain(const std::string& machine_name, |
| const std::string& user_principal_name, |
| int password_fd, |
| const JoinCallback& callback) { |
| + std::vector<std::string> parts = base::SplitString( |
| + user_principal_name, "@", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| + if (parts.size() != 2U) { |
|
Thiemo Nagel
2017/01/24 14:17:36
It seems that you'll have to check the sizes of th
achuithb
2017/01/24 19:42:11
Sounds like we need a unit test
Roman Sorokin (ftl)
2017/01/25 11:50:18
Done.
Roman Sorokin (ftl)
2017/01/25 11:50:18
Done.
|
| + callback.Run(authpolicy::ERROR_PARSE_UPN_FAILED); |
| + return; |
| + } |
| + |
| callback.Run(authpolicy::ERROR_NONE); |
| } |