The validator handler can now pass unknown arguments to the project specific handler.
Projects that have their own validator need to implement the validate_handler_init() function and handle project specific arguments there. They also need to supply a validate_handler_usage() function that printf()'s a description of the custom options. For examples see sample_substr_validator.cpp or script_validator.cpp
The validator test harness was also adopted to use these new functions.
This brings the implementation of the validator framework on the same level as the assimilator framework where similar changes where made in 0038d27 and dd00440.
* path_to_filename() can be used to extract the filename from a given path (used in validator test framework)
* safe_copy() can be used when a non-const char array is needed and string.c_str() is not sufficient
The information in /etc/os-release is allowed to contain some special shell characters that are escaped so the file can be easily read by shell scripts. We store this information in the database and do our own escaping. The strip_quotes() function now does not remove quotes from the end of the string if they are escaped.
Gathers more information about the Linux OS using lsb_release, /etc/os-release or /etc/redhat-release (in that order) and adds that information to the os_name and os_version fields. This produces information like this:
os_name: Linux CentOS Linux
os_version: 3.10.0-327.18.2.el7.x86_64 (CentOS Linux 7 (Core))
os_name: Linux
os_version: 2.6.32-642.1.1.el6.x86_64 (CentOS release 6.8 (Final))
os_name: Linux Ubuntu
os_version: 3.14.65-68 (Ubuntu 16.04 LTS)
product_name: ODROID-C2
os_name: Linux Debian
os_version: 4.5.0-2-amd64 (Debian GNU/Linux testing (stretch))
This should work on most major distributions and will give a better overview on what Distribution is used by volunteers.
The file upload handler checked for ".." in the filename.
Also check for control chars and for starting with /.
Put this into a separate function, is_valid_filename().
Turns out WxWidgets has functions for localized number formatting.
This was added in 2.9 so we weren't able to use it last time I checked.
Remove our own number-formatting code.
Don't do localized number formatting in client.
VS apparently requires "long long" to get 64 bits.
Also: convert various floats to double in the Manager.
BOINC shouldn't use floats anywhere. Always use doubles.
- add --is_gzip option to sample_bitwise_validator.
If set, all files are treated as gzip archives.
Check their 10-byte header to verify that it's a gzip file,
but ignore it when comparing files.
- validator.cpp: don't error out on unparsed cmdline args,
since we're now using them in sample_bitwise_validator
and sample_substr_validator.
- fix build error on Debian