chmod(): Operation not permitted - which user should be moodledata owner?

Re: chmod(): Operation not permitted - which user should be moodledata owner?

by Mathew Gancarz -
Number of replies: 0
Picture of Core developers

Is it an error or just a warning? Do you have any idea why Moodle needs to change the permissions of files/directories within moodledata/ _after_ they have been created?

It states PHP Warning, and it looks to be in the "deleted_file_cleanup" function. You can see the code here: https://github.com/moodle/moodle/blob/master/lib/filestorage/file_storage.php#L2194

I'm not quite sure why that piece of code changes permissions on file it's deleting, but it's been there since before 2010 and that's as far back as I can go in the Github history. Seems to have been in place for Moodle 2.0, not sure if earlier.