diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-11 05:32:31 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-11 05:32:31 +0000 |
commit | 0d6335f3611fab45342c3257e1460a361dd12a30 (patch) | |
tree | d677285510dd79d68bc34c379141c7815b10e0e7 /chrome/browser/process_singleton_linux.cc | |
parent | 8b048323819876b75e3875cd1de5ef01f1f54375 (diff) | |
download | chromium_src-0d6335f3611fab45342c3257e1460a361dd12a30.zip chromium_src-0d6335f3611fab45342c3257e1460a361dd12a30.tar.gz chromium_src-0d6335f3611fab45342c3257e1460a361dd12a30.tar.bz2 |
Put test_user_data in a temp directory instead of using base::DIR_EXE. (try 2)
base::DIR_EXE could be a very long path, which causes socket creation to fail because socket paths have a limited length. Let's use a temp directory instead. We should also clean up the temp dir when we're done. Also abort if the socket path is too long.
Reviewed in issue 115107
Review URL: http://codereview.chromium.org/113193
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton_linux.cc')
-rw-r--r-- | chrome/browser/process_singleton_linux.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chrome/browser/process_singleton_linux.cc b/chrome/browser/process_singleton_linux.cc index fcd64259..57a6531 100644 --- a/chrome/browser/process_singleton_linux.cc +++ b/chrome/browser/process_singleton_linux.cc @@ -64,6 +64,8 @@ void ProcessSingleton::SetupSocket(int* sock, struct sockaddr_un* addr) { LOG(FATAL) << "socket() failed: " << strerror(errno); addr->sun_family = AF_UNIX; + if (socket_path_.value().length() > sizeof(addr->sun_path) - 1) + LOG(FATAL) << "Socket path too long: " << socket_path_.value(); base::strlcpy(addr->sun_path, socket_path_.value().c_str(), sizeof(addr->sun_path)); } |