Open Vulpine05 opened 2 years ago
@davidpanderson, looks like a valid ticket and it would be nice to have it in the next release. Are you ok to wait for it implementation after #4871 is merged?
Not really needed. No one AFAIK manually edits global_prefs.xml; it's not documented except for an ancient trac page.
Some projects customize / modify the standard web code. Coding errors could inadvertently allow users to set illegal values in their computer preferences when editing them on the project web site. Coding errors could also inadvertently cause bad values to be sent in the _schedreply message to the client even if the underlying values were OK. So it would be good to perform sanity checks on the computing prefs values in the _schedreply message as well as when parsing the _globalprefs.xml and _global_prefsoverride.xml files. I believe the same validation code in the client could be used for all 3.
Describe the problem Preferences can be modified in three ways:
When changing preferences via the project website or the Manager, those values are validated to be in the correct range. However, when BOINC is started, it will read the global_prefs_override file (if it exists), and store those values. Some of those preferences are currently validated, but not all. The example below shows the percentage of CPUs being changed to a range between 0 and 100: https://github.com/BOINC/boinc/blob/3fc6c024711175413eb9e57c53fad1a78267274e/lib/prefs.cpp#L509-L513
However, if suspend_cpu_usage were accidentally edited as a negative number, that negative number would be stored, and BOINC would never crunch any tasks.
Describe the solution you'd like I feel this can be resolved with two steps:
Additional context I have started to work on this solution, but with #4871 being in development, I stopped so I didn't have to redo large sections of code. I would be happy to continue developing it after that PR is merged. In the meantime, I'm looking for any feedback.