CFPreferencesSynchronize() Returns True Even on Failure

Originator:justatheory
Number:rdar://21572933 Date Originated:2015-06-26
Status:Open Resolved:
Product:OS X Product Version:10.10.4
Classification: Reproducible:Always
 
Summary:
CFPreferencesSynchronize() seems to always return true. If the file it would write is a directory rather than a file, it can't be written to, of course. But CFPreferencesSynchronize() will still return true.

The attached sample iOS app demonstrates the issue. It creates a directory where the preferences file is expected to be written, then call CFPreferencesSynchronize(), which of course can't overwrite the directory with a file, but still returns true.

Steps to Reproduce:
1. Create a directory in the path that CFPreferencesSynchronize() should try to write to as a file.
2. Call CFPreferencesSynchronize()

Expected Results:
CFPreferencesSynchronize() should return false

Actual Results:
CFPreferencesSynchronize() returns true

Version:
10.10.4 (14E36b)

Notes:


Configuration:
Occurs on OS X and iOS.

Attachments:
'UserPrefsSyncTester.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!