This function is called when running ‘bl’ and ‘test_network’, so previously we would end up with ‘bl.plist’ and ‘test_network.plist’ in ~/Library/Preferences.
A problem has been reported where tar will freeze while extracting the default bundles archive to a networked Application Support folder.
From the bug report (Michael Kuron):
File servers tested: SMB on OS X 10.9.3, AFP on OS X 10.9.3, AFP on OS X 10.6.8, SMB on Windows 2008 R2.
Multiple machines tested.
Using ‘gnutar’ from MacPorts does not show the problem.
Setting ‘COPYFILE_DISABLE=1’ before running tar does not show the problem (the workaround used in this commit).
The standard doesn’t care which side the keyword is placed on, but placing it on the right makes it easier to read types.
E.g. reading “int const* const” from right to left we get “const pointer to const integer”.
If libcurl is built with the default DNS resolver then it will handle a timeout by using SIGALRM, though since we are using threads, and signals are not compatible with threads, this may have led to a crash in Curl_resolv_timeout (for users where a DNS lookup could take longer than the timeout, presumably 300 seconds).
The reachability API does a DNS lookup on the literal string and prior to this commit, could stall for as long as it takes to lookup a non-existing host name via DNS.
We now use CFNetworkCopyProxiesForURL() to get the list of potential proxies, hopefully this will perform the proper “proxy auto discovery” (issue #973) though we still need to handle PAC ourself.
Presently we only use the first proxy found, ideally we would try them all (but this will require some API changes).
This belongs in main(), where it is already being set.
It might however be necessary to set it when running tests, although none of the tests seems to fail w/o this.
We need this in a few places and while calling Gestalt() isn’t that much code, that function is deprecated in 10.8 and the alternative is a lot more code, so we don’t want to repeat that once we update the code.
Instead of passing the file descriptor to the child, and have the child close it, we set FD_CLOEXEC on the file descriptor in the parent process.
While it limits the window in which another thread can fork() and cause the file descriptor to be “leaked”, it doesn’t eliminate the problem.
This should hopefully solve the issue with the (on some systems) fairly aggressive temp cleaner.
Also remove the archive incase the user cancels the update, now that we are extracting it to a less temporary location.
This used to contain an UUID used for identifying the client in network requests, but for majority of users, this is unset, so now we create our own UUID for the user agent string used when polling for software updates.
Since the PAC URL is user supplied it’s unknown what state it actually is in, so we try to create a CFURL object from the raw string and if that fails, we URL-escape it (though not escaping slashes and colons).
Should fix issue #228.