Security-scoped bookmark and screensaver
site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=uni-bremen.de; s=2019; t=1704284438; i=@uni-bremen.de; bh=ULjxo6KaxSO6PrkfJg5NqqrxFF/oJ1aTNgXfcCPK2qk=; h=From:Date:To; b=CuqU1R6z0sa8Gcun6N86Fdf7xlaqEB0D34WlGcLjR1Vm9XweoI3nt549bFr7yLlN2 n8a/+7CT1apHwVxPPe43c1pUHW5srHINeKpL7i8SiIQcMu//fGVqI9qSMpsrIThk2O WDttsOJqEC6kXDzgnaGP5FBEZyZ0E6ibTbx0k8c0Y48FV+lq0GA2RQ8XT8yc5IbNrU j0PhhjMr+DDEf9SljvLAww68HmNd68zVRHwy08vWZF5h7V0zovpaESEXORDIIM6Oh5 oOS84/CxXH3SyV/Ns32beUYaDI0pHTodT4nq2EVxbARHHsQZ11pB5nvvtt76kcsfLe OjPn+fbu/Pa8A==
From one of the users of my screensaver, I get the issue report that resolving the SSB does not work. He is running macOS 10.14.6 on a Mac Mini. I have compiled my screensaver using the current version of Xcode, under macOS 14, but for the target macOS 10.13.
When my screensaver tries to resolve the bookmark, I get the infamous Code%9 "The File couldn't be opened because it isn't in the correct format." This happens, when my screensaver is launched by the ScreenSaverEngine. When my screensaver is running in System Preferences, in the thumbnail window, everything is fine, and resolving the bookmark works, of course. Also, there are other users of my screensaver (including me), where it runs just fine. For that user, the directory for which my screensaver creates the bookmark is on an external HD. Below is the source code showing how I create/resolve bookmarks. Any ideas what I could try (or the user) will be highly appreciated. Best regards, Gabriel Create bookmark: NSData * dir_bookmark = [dir bookmarkDataWithOptions: NSURLBookmarkCreationWithSecurityScope includingResourceValuesForKeys: nil relativeToURL: nil error: &systemError]; [no problems occur here] Resolve bookmark: NSURL * dir_location = [NSURL URLByResolvingBookmarkData: bookmark options: NSURLBookmarkResolutionWithSecurityScope relativeToURL: nil bookmarkDataIsStale: & isStale error: & error]; [at this point, dir_location == nil, and I get the error code 259. I can still extract the path using this code: NSDictionary * dict = [NSURL resourceValuesForKeys: [NSArray arrayWithObjects: NSURLPathKey, nil] fromBookmarkData: bookmark ]; .. = [NSString stringWithFormat: @"Orig path: %@", [dict objectForKey: NSURLPathKey]; _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com smime.p7s
participants (1)
-
Gabriel Zachmann via Cocoa-dev