Quarantine API failure
Quarantine API failure
- Subject: Quarantine API failure
- From: Wim Lewis <email@hidden>
- Date: Mon, 5 Nov 2007 16:51:25 -0800
For some reason I can't set quarantine info on a file from within my
application. I can write a minimal command-line tool to do it,
setting the same quarantine info dictionary on the same file, and it
works. But calling
LSSetItemAttribute(&carbonRef, kLSRolesAll,
kLSItemQuarantineProperties, quarantineProperties)
from within my app returns -1427 (errFSAttributeNotFound).
This is odd because I'm trying to *set* it, so it shouldn't matter if
it's not found. Stepping through the LaunchServices code in the
debugger shows that the underlying error code from syscall is ENOATTR.
A 10-line command-line tool works as documented; LSSetItemAttribute()
returns noErr, and xattr indicates that the com.apple.quarantine
attribute has been set. This is on the same file and with the same
properties dictionary as the one that fails in the Cocoa app. I've
also tried explicitly setting the kLSQuarantineAgentNameKey and
kLSQuarantineAgentBundleIdentifierKey keys, since those would be
different between the app and the tool, but this does not change the
behavior. The two properties I'm setting are kLSQuarantineDataURLKey
and kLSQuarantineTypeKey (to kLSQuarantineTypeOtherDownload).
For extra strangeness, if I stop the app in the debugger when it's
about to call LSSetItemAttribute(), and then run the command-line
tool, the tool succeeds (setting the attribute), and then the app
"succeeds" --- it returns noErr --- but it *removes* the quarantine
info from the file (according to xattr).
Any clues? Has anyone else used the quarantine API yet (successfully,
that is)?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden