This is a bug, of course, because node access query filters should be applied by node module.
The check in node_access_view_all_nodes() is not respected by $query->executeFirstPass(), which always performs the node access JOIN, which means you can no longer disable node access on search queries (which is a feature I've been using since Drupal 5).
For proof, run an access-limited search. Then watch the query passed in to node_query_node_access_alter, which will already be JOINed to {node_access}.
This may be due to the fact that search.extender.inc is doing something odd, but I haven't figured that part out yet.
Comments
Comment #1
dave reidI don't see where executeFirstPass() involves node access. Only thing I can see is that the query is cloned to run the first pass, and has the node access tag from node_search_execute().
Comment #2
agentrickardThat's what happens. The clone doesn't prevent the execute() from altering the base query object.
Here's a patch that sidesteps the issue, but is probably Doing It Wrong.
Comment #3
agentrickardThis may be entirely self-inflicted. Testing.
Comment #4
agentrickardIgnore me. I did something stupid in my module.