{"action":"created","issue":{"url":"https://api.github.com/repos/nextcloud/server/issues/8405","repository_url":"https://api.github.com/repos/nextcloud/server","labels_url":"https://api.github.com/repos/nextcloud/server/issues/8405/labels{/name}","comments_url":"https://api.github.com/repos/nextcloud/server/issues/8405/comments","events_url":"https://api.github.com/repos/nextcloud/server/issues/8405/events","html_url":"https://github.com/nextcloud/server/issues/8405","id":297941956,"number":8405,"title":"`stat` is being launched for every file that is scanned.","user":{"login":"StyXman","id":167327,"avatar_url":"https://avatars0.githubusercontent.com/u/167327?v=4","gravatar_id":"","url":"https://api.github.com/users/StyXman","html_url":"https://github.com/StyXman","followers_url":"https://api.github.com/users/StyXman/followers","following_url":"https://api.github.com/users/StyXman/following{/other_user}","gists_url":"https://api.github.com/users/StyXman/gists{/gist_id}","starred_url":"https://api.github.com/users/StyXman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StyXman/subscriptions","organizations_url":"https://api.github.com/users/StyXman/orgs","repos_url":"https://api.github.com/users/StyXman/repos","events_url":"https://api.github.com/users/StyXman/events{/privacy}","received_events_url":"https://api.github.com/users/StyXman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-16T22:38:41Z","updated_at":"2018-02-18T13:05:32Z","closed_at":null,"author_association":"NONE","body":"I just installed NC 13.0.0 and I noticed that it was taking a lot to scan my photos. I attached an `strace` the the scanner and I found out that's it calling `stat` for each file! I'm not talking about the C or PHP function, I'm talking about `coreutils`' `/usr/bin/stat`!\r\n\r\nThis has a huge performance impact in my server, and looking at the code, I can't figure out why this is tried before using the PHP function `filesize()`. And why it isn't even using `[stat](https://secure.php.net/manual/en/function.stat.php)`? Not to mention that is not calling `escapeshellarg()` either."},"comment":{"url":"https://api.github.com/repos/nextcloud/server/issues/comments/366514799","html_url":"https://github.com/nextcloud/server/issues/8405#issuecomment-366514799","issue_url":"https://api.github.com/repos/nextcloud/server/issues/8405","id":366514799,"user":{"login":"juliushaertl","id":3404133,"avatar_url":"https://avatars0.githubusercontent.com/u/3404133?v=4","gravatar_id":"","url":"https://api.github.com/users/juliushaertl","html_url":"https://github.com/juliushaertl","followers_url":"https://api.github.com/users/juliushaertl/followers","following_url":"https://api.github.com/users/juliushaertl/following{/other_user}","gists_url":"https://api.github.com/users/juliushaertl/gists{/gist_id}","starred_url":"https://api.github.com/users/juliushaertl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliushaertl/subscriptions","organizations_url":"https://api.github.com/users/juliushaertl/orgs","repos_url":"https://api.github.com/users/juliushaertl/repos","events_url":"https://api.github.com/users/juliushaertl/events{/privacy}","received_events_url":"https://api.github.com/users/juliushaertl/received_events","type":"User","site_admin":false},"created_at":"2018-02-18T13:05:32Z","updated_at":"2018-02-18T13:05:32Z","author_association":"MEMBER","body":"@StyXman Are you running NC on a 32-bit system? It seems that the exec is used there to workaround integer size issues. Anyway the arguments are properly escaped there using escapeshellarg https://github.com/nextcloud/server/blob/c1e4f9f30563d5eda1718d716d631d6092cd4e28/lib/private/LargeFileHelper.php#L148"}}
{"actor":{"display_login":"juliushaertl"}}