You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DDFileLogger causes application to crash under following conditions:
Application is running in background
Device is passcode protected
Device has been locked for at least 10 seconds (data protection keys are purged from memory after 10 seconds)
com.apple.developer.default-data-protection entitlement is set to NSFileProtectionComplete (which is default for me -- I haven't specified this value explicitly)
Crash log will show exception being raised in [DDFileLogger logMessage:] as a result of [NSConcreteFileHandle writeData:]. The reason is DDFileLogger tries to write to a file that is encrypted by Data Protection and is not accessible because device is locked.
This has security implications. If application is not supposed to be relaunched by iOS while device is locked (majority of apps are of this kind, I suppose) then NSFileProtectionCompleteUnlessOpen or NSFileProtectionCompleteUntilFirstUserAuthentication should be used instead of NSFileProtectionNone.
The text was updated successfully, but these errors were encountered:
That commit resolves the problem, yes, but it is more of a workaround than a proper fix. Setting log protection class to NSFileProtectionNone has security implications and thus I am not sure that commit should be merged.
…ow we are setting appropriate NSFileProtectionKey
(NSFileProtectionCompleteUntilFirstUserAuthentication if app is able launch from background and NSFileProtectionCompleteUnlessOpen in other cases).
…ow we are setting appropriate NSFileProtectionKey
(NSFileProtectionCompleteUntilFirstUserAuthentication if app is able launch from background and NSFileProtectionCompleteUnlessOpen in other cases).
DDFileLogger causes application to crash under following conditions:
NSFileProtectionComplete
(which is default for me -- I haven't specified this value explicitly)Crash log will show exception being raised in
[DDFileLogger logMessage:]
as a result of[NSConcreteFileHandle writeData:]
. The reason isDDFileLogger
tries to write to a file that is encrypted by Data Protection and is not accessible because device is locked.Workaround is to override default attributes when creating log file, i.e. set
attributes
to@{NSFileProtectionKey : NSFileProtectionNone}
when calling[NSFileManager createFileAtPath:contents:attributes:]
in[DDLogFileManagerDefault createNewLogFile]
.This has security implications. If application is not supposed to be relaunched by iOS while device is locked (majority of apps are of this kind, I suppose) then
NSFileProtectionCompleteUnlessOpen
orNSFileProtectionCompleteUntilFirstUserAuthentication
should be used instead ofNSFileProtectionNone
.The text was updated successfully, but these errors were encountered: