You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it is completely sufficient to have an error when changing the configuration fails. I don't know if a proper handling in this case already exists.
Having php files non-writable is a sane security decision for me. However, if writable config files are recommended, this information would fit into the "Admin" –> "Security & setup warnings" section.
Having php files non-writable is a sane security decision for me. However, if writable config files are recommended, this information would fit into the "Admin" –> "Security & setup warnings" section.
I would prefer this option as well. Tell user to either set the option "read-only" in the config file or make it writable. Most people are quite responsive to messages in Security & setup warnings. A 500 status code error will trigger many users to end up with a broken setup and they will complain that the update procedure broke their system.
A first check is done in lib/base.php with function checkConfig(), this one is handle completely.
A second one in lib/private/legacy/util.php with function checkServer. This one only check the folder. Thus, it can throw an error if config folder is not writable but config file is writable. Moreover, the http status returned was already 503.
Questions:
Should I change the http status returned with the second check to 500 ?
Should we open a new issue to correct the behavior of the second check to focus on the file instead of the folder ?
Activity
Morikko commentedon Oct 27, 2017
I can take this issue.
Morikko commentedon Oct 27, 2017
The function OC_Util::checkServer that arrives after checkConfig also tracks if config is writable.
Is it necessary to have those two checks ?
Should I do a unit test for checking the header status ? If yes, in which test file should I add it ?
sophie-h commentedon Oct 31, 2017
I think it is completely sufficient to have an error when changing the configuration fails. I don't know if a proper handling in this case already exists.
Having php files non-writable is a sane security decision for me. However, if writable config files are recommended, this information would fit into the "Admin" –> "Security & setup warnings" section.
tflidd commentedon Nov 5, 2017
There is even an option for the config file in case the config file is read only:
https://github.com/nextcloud/server/blob/master/config/config.sample.php#L648-L658
I would prefer this option as well. Tell user to either set the option "read-only" in the config file or make it writable. Most people are quite responsive to messages in
Security & setup warnings. A 500 status code error will trigger many users to end up with a broken setup and they will complain that the update procedure broke their system.Morikko commentedon Nov 17, 2017
Notes:
Questions:
Change status code when config is write protected
Change status code when config is write protected
MorrisJobke commentedon Jun 26, 2018
This one is fixed in #9995 - inspired by @Morikko
And @Morikko's PR was in #7205 - rebased as #9996