-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arbitrary setting of file mode on owncloud.log #32221
Comments
Since rotating just calls Maybe only perform the chmod on the creation of the log file, rather than every write? Something like this might work (it's untested as I was just sketching out the idea): |
Feel free to submit this as pull request. Im Happy to review this. THX |
@DeepDiver1975 done. |
…32222) * Set permissions on log file creation instead of every write. * Code style fix and removed unnecessary else condition
…32222) * Set permissions on log file creation instead of every write. * Code style fix and removed unnecessary else condition
…32222) * Set permissions on log file creation instead of every write. * Code style fix and removed unnecessary else condition
Steps to reproduce
Expected behaviour
It isn't ownCloud's job, when logrotation is disabled, to manage the file permissions. I am managing it via logrotate and other methods, as we use filebeats to take the json log and feed it into elasticsearch. I'm not keen to add filebeat to the php user group, as that would mean I'm expanding the footprint of possible users that can write to data in certain scenarios.
I would suggest that the chmod only be performed upon file rotation when managed by ownCloud itself.
Actual behaviour
ownCloud keeps reverting the log file permissions to 0640, as per https://github.com/owncloud/core/blob/master/lib/private/Log/Owncloud.php#L132
Not to mention the ownCloud instance is performing needless busy work on every log event.
Server configuration
Operating system: RHEL 7.5
Web server: Apache 2.4.6
Database: MariaDB 10.0 w/Galera
PHP version: 7.0 from the Remi repo
ownCloud version: 10.0.9
Updated from an older ownCloud or fresh install: Not relevant
Where did you install ownCloud from: Git
The text was updated successfully, but these errors were encountered: