| Index: chrome/browser/process_singleton_posix_unittest.cc
|
| diff --git a/chrome/browser/process_singleton_posix_unittest.cc b/chrome/browser/process_singleton_posix_unittest.cc
|
| index 56808a833e96345890a94d6c55a3716636122915..7c511739bb4f0a484f5d210fc943b8ac2b966532 100644
|
| --- a/chrome/browser/process_singleton_posix_unittest.cc
|
| +++ b/chrome/browser/process_singleton_posix_unittest.cc
|
| @@ -408,6 +408,24 @@ TEST_F(ProcessSingletonPosixTest, NotifyOtherProcessOrCreate_BadCookie) {
|
| EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE, NotifyOtherProcessOrCreate(url));
|
| }
|
|
|
| +TEST_F(ProcessSingletonPosixTest, IgnoreSocketSymlinkWithTooLongTarget) {
|
| + CreateProcessSingletonOnThread();
|
| + // Change the symlink to one with a too-long target.
|
| + char buf[PATH_MAX];
|
| + ssize_t len = readlink(socket_path_.value().c_str(), buf, PATH_MAX);
|
| + ASSERT_GT(len, 0);
|
| + base::FilePath socket_target_path = base::FilePath(std::string(buf, len));
|
| + base::FilePath long_socket_target_path = socket_target_path.DirName().Append(
|
| + std::string(sizeof(sockaddr_un::sun_path), 'b'));
|
| + ASSERT_EQ(0, unlink(socket_path_.value().c_str()));
|
| + ASSERT_EQ(0, symlink(long_socket_target_path.value().c_str(),
|
| + socket_path_.value().c_str()));
|
| +
|
| + // A new ProcessSingleton should ignore the invalid socket path target.
|
| + std::string url("about:blank");
|
| + EXPECT_EQ(ProcessSingleton::PROCESS_NONE, NotifyOtherProcessOrCreate(url));
|
| +}
|
| +
|
| #if defined(OS_MACOSX)
|
| // Test that if there is an existing lock file, and we could not flock()
|
| // it, then exit.
|
|
|