Discrepancy between documentation and the actual behavior

I think there's a slight discrepancy between what is being communicated in EndpointSecurity docs, and what is really happening.

For example, consider the description of this event:

https://developer.apple.com/documentation/endpointsecurity/es_event_type_t/es_event_type_notify_truncate?language=objc

"ES_EVENT_TYPE_NOTIFY_TRUNCATE: An identifier for a process that notifies endpoint security that it is truncating a file."

But, it seems that this event is fired up only when truncate(2) is called, not when process truncates a file (which can be done in lots of different ways). But the documentation doesn't even mention that it's only about the truncate(2) call, it's impossible to know.

Another example:

https://developer.apple.com/documentation/endpointsecurity/es_event_type_t/es_event_type_notify_copyfile?language=objc

"ES_EVENT_TYPE_NOTIFY_COPYFILE: An identifier for a process that notifies endpoint security that it is copying a file."

It seems that this event is only called when copyfile(3) syscall is called. But the docs doesn't mention that syscall at all. The wording suggests that the event should be emitted on every file copy operation, which is probably impossible to detect.

I mean, I get that you'd like the docs to be "easy to digest", but I think that such working confuses people. They expect one thing, then they get confusing behavior from ES, because it doesn't match their expectations, and after reaching out to Apple they get concise and clear answer -- but it would be easier for everyone (including Apple devs) when this answer would be included directly in the official docs for the framework.

Answered by DTS Engineer in 810937022

The best way to get this feedback to the folks responsible for the documentation is to file a bug against the docs. Please post your bug number, just for the record.

Regarding your second point, you seem to be mixing up the copyfile library routine with the (not public) copyfile system call. The former is in section 3 of the man pages and the latter, if it were public, would be in section 2.

I explain the history behind that in this post.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

The best way to get this feedback to the folks responsible for the documentation is to file a bug against the docs. Please post your bug number, just for the record.

Regarding your second point, you seem to be mixing up the copyfile library routine with the (not public) copyfile system call. The former is in section 3 of the man pages and the latter, if it were public, would be in section 2.

I explain the history behind that in this post.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Created FB15589338.

True, I should call copyfile(3) a function, not a syscall. But still the point of my post holds for this case -- Apple has previously replied to us that the _COPYFILE event is emitted when the copyfile(3) is called. Not (2).

Discrepancy between documentation and the actual behavior
 
 
Q