<?php
$target='/tmp/cdx-store-security-audit-20261010';
if(__DIR__!==$target||!is_dir($target)||is_link($target))exit(78);
$files=new RecursiveIteratorIterator(new RecursiveDirectoryIterator($target,FilesystemIterator::SKIP_DOTS),RecursiveIteratorIterator::CHILD_FIRST);
$count=0;foreach($files as $file){$path=$file->getPathname();if(strpos($path,$target.'/')!==0)exit(79);if($file->isDir()&&!$file->isLink())rmdir($path);else{unlink($path);$count++;}}rmdir($target);echo json_encode(['owned_runtime_removed'=>!file_exists($target),'files_removed'=>$count]),"\n";
