Skip to content

Account for missing NSFileProtectionKey file attribute key. #235

Closed
wants to merge 5 commits into from

4 participants

@DuneParkSoftware

Ok, after doing a bit of testing, it appears that the NSFileProtectedKey is not included in the file attributes dictionary while running on the iOS simulator. It does get returned on a device, however. I tested on iOS 7.0.6.

When the key is missing, it forces a new log file to always be created, due to the test if (! [key isEqualToString:NSFileProtectionCompleteUntilFirstUserAuthentication]) { near line ~946.

Therefore, this patch will assume that we can reuse the existing log file if the NSFileProtectedKey is missing. If you're not comfortable with this, we could add checks for #if TARGET_IPHONE_SIMULATOR to fine-tune this condition.

Thanks!

@bpoplauschi
CocoaLumberjack member

@dvor can you please take a look at this?

@dvor
CocoaLumberjack member
dvor commented Mar 11, 2014

I'm not sure if this is right fix. The problem is that on iOS simulator all attributes are reset on every launch. That's why we need .archived extension for simulator only.

I'll take a look at this problem as soon as I'll have some free time.

@bpoplauschi
CocoaLumberjack member

Thanks mate.

@rivera-ernesto
CocoaLumberjack member

Because of #238 this pull request will need a small update (details).

@dvor dvor was assigned by rivera-ernesto Apr 4, 2014
@rivera-ernesto
CocoaLumberjack member

@DuneParkSoftware Could you update this pull request?

@DuneParkSoftware

Thanks everyone!

@rivera-ernesto
CocoaLumberjack member

I think you can just reopen this and append a commit to fix the merge conflict.

@bpoplauschi bpoplauschi added this to the 1.9.0 milestone May 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.