Commit Graph

88 Commits

Author SHA1 Message Date
Christian Beer 7eb7aeaa6b Client: normalize whitespace in p_model and p_vendor entries
This was already done for Mac but not Linux and Windows. It collapses multiple consecutive blanks into one blank which is then send to the server.
2017-02-13 16:16:52 +01:00
Christian Beer c7949ecf9d Lib: remove duplicate code
strip_quotes() is basically still a copy of strip_whitespace() which additionally removes quotes.
2017-01-06 15:00:35 +01:00
Christian Beer 93cbda67fd Merge branch 'master' into cpu_infos_aarch64
Retained changes from a788dba8.

Conflicts:
	lib/str_util.cpp
2017-01-06 14:56:16 +01:00
David Anderson a788dba8b9 lib: remove duplicate code 2017-01-05 14:01:06 -08:00
David Anderson 6733529d29 Merge branch 'master' into cpu_infos_aarch64 2017-01-05 13:40:50 -08:00
David Anderson 33baa0bca1 client: fix compile errors and warnings 2016-12-22 11:25:44 -08:00
David Anderson 3410015b00 lib: remove safe_copy(); not used, generated compile warnings on Win 2016-12-19 01:14:40 -08:00
Charlie Fenton 9e1b0cf834 lib: Fix compiler warning (using the result of an assignment as a condition without parentheses) 2016-11-30 01:56:24 -08:00
Christian Beer fa6c27805d Merge pull request #1618 from BOINC/validator_enhancement
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.
2016-11-23 13:40:32 +01:00
David Anderson ce94117aff lib: check for fclose() error return in boinc_copy 2016-09-30 01:41:45 -07:00
Christian Beer 01ea1ef8fb Lib: add usefull generic string functions
* 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
2016-09-21 11:35:24 +02:00
Christian Beer 81f813c772 Merge branch 'master' into cpu_infos_aarch64
Pull in updates from master
2016-09-06 08:44:27 +02:00
Christian Beer eef4d45db5 Client: unescape special characters read from /etc/os-release
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.
2016-09-06 08:39:01 +02:00
David Anderson da58a333d2 remove dependence of boinc_api.h on str_replace.h
- move strcpy2() from db_base.h to boinc_db.cpp
- don't include str_replace.h from common_defs.h
- move safe_strcpy from str_replace.h to str_util.h
2016-09-02 21:12:09 -07:00
David Anderson bf71a029a5 lib: fix Win compile warning 2016-08-26 19:23:42 -07:00
Christian Beer ede61a24ea Client: improve Linux OS detection
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.
2016-06-20 08:45:59 +02:00
Rom Walton 16e51ec218 LIB: Cleanup low hanging fruit with regards to cleaning up strcpy and strcat use.
Use safe_strcpy and safe_strcat when dealing with non-pointer data types.
2016-02-15 17:54:13 -05:00
Juha Sointusalo 7ef9440116 lib: add descriptions for new error numbers 2015-11-22 22:22:46 +02:00
Christian Beer 05ad878760 Merge branch 'master' into fix_defects_lib 2015-11-19 19:06:14 +01:00
David Anderson f4c72320a3 file upload handler: improve check for filename validity
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().
2015-11-18 16:08:47 -08:00
Christian Beer 27594f0b2f Lib: introduce new error numbers and add missing descriptions 2015-11-04 17:30:41 +01:00
David Anderson 28e18f6b8d Manager, client: use WxWidgets functions for number formatting
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.
2015-09-22 11:22:07 -07:00
David Anderson fcb359d2ee Manager/client, Win: use LOCALE_USER_DEFAULT instead of NULL in locale call 2015-09-18 11:15:36 -07:00
David Anderson c0e6b3b3d2 client/manager: code shuffle to generalize comma_print() 2015-09-17 13:48:04 -07:00
David Anderson 0cef8050c1 Manager: make localized number formating work on Win 2015-09-16 10:55:57 -07:00
David Anderson 26f92fcaf1 Manager: fix comma-separated display of >32 bit numbers
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.
2015-09-07 01:03:54 -07:00
David Anderson 7f91596fae Manager, client: have comma_print() return a std::string, avoid static buffer problem 2015-08-27 15:05:56 -07:00
David Anderson d10bf89a25 Manager and client: print numbers with thousands separators in various places 2015-08-26 12:50:11 -07:00
David Anderson cf13cb256b lib: add function for formatting numbers w/ digit grouping 2015-08-11 14:18:06 -07:00
David Anderson 7135f46c75 client: if get 417 HTTP status, switch to HTTP 1.0
417 (Expectation Failed) probably means we're talking to a 1.0 proxy
2015-03-05 15:19:41 -08:00
David Anderson db501739a6 client: timestamp all writes to stderr 2014-11-14 13:07:24 -08:00
David Anderson f163dd0ec7 client: send LDAP credentials only over HTTPS 2014-10-28 14:06:49 -07:00
David Anderson 6eabd34068 server: extend script_validator and script_assimilator to pass extra args
You can arrange to pass result IDs, runtime, etc.
to your validation and assimilation scripts.  See
http://boinc.berkeley.edu/trac/wiki/ValidationSimple#Usingscriptinglanguages
http://boinc.berkeley.edu/trac/wiki/AssimilateIntro#Usingscriptinglanguages
2014-10-24 14:22:07 -07:00
David Anderson c897dc8276 db_dump: split host.serialnum into client version/vbox version/coprocs parts 2014-09-11 18:06:05 -07:00
David Anderson d43f78f97a vboxwrapper: compile fix, and error-check kill_program().
Note: utility functions like kill_program() should return
BOINC error codes, not Unix codes
2014-07-29 13:19:07 -07:00
Rom Walton debac23fa3 client: Use pipes to redirect sdtout/stderr output from switcher, report any failures as task_debug output with msg_printf(). 2014-07-27 16:30:02 -04:00
David Anderson 009f884578 GUI RPC: include is_youtube_video flag in notice struct.
This is set if the notice text includes "youtube.com", case-insensitive.
2014-06-10 14:04:40 -07:00
David Anderson 79906a8f1a Client: fix a few compile warnings 2014-05-08 15:38:30 -07:00
David Anderson 6f29a50812 validator: fixes and features
- 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
2014-03-20 12:38:29 -07:00
David Anderson 593181e196 scheduler: if gui_urls.xml or project_files.xml don't end with \n, add one
Otherwise the scheduler reply has two tags on one line,
which messes up old clients that don't use the new XML parse
2014-02-26 16:16:51 -08:00
David Anderson a3b2be239f Compile fixes for C++11, from Rene Ladan 2013-11-05 09:19:27 -08:00
David Anderson 438cd78b13 Remote job submission: add C++ APIs for query_batches() and query_batch()
- Add program (tools/remote_submit_test.cpp) for testing C++ API for remote job submission.
- Rename Condor-specific API to query_batch_set().
2013-10-22 15:27:34 -07:00
David Anderson 84a6f89840 client and API, Unix: code cleanup, no functional change 2013-08-16 12:20:01 -07:00
David Anderson ba6fbc8071 client: if suspend for battery reasons, show parameters in event log
E.g., if suspend because battery temperature,
show current temperature and temperature limit.
Could do this for other things too, e.g. exclusive apps.
2013-07-13 16:31:25 -07:00
David Anderson 9ad9c5ee13 client (Android): show "GUI not active" suspend reason 2013-06-26 16:33:32 -07:00
David Anderson 4fd76ee325 boinccmd: show result states as strings instead of numbers 2013-06-18 11:33:22 -07:00
David Anderson 1446fdddbe client: add <android_debug> log flag; shows battery/wifi RPC info 2013-06-04 11:25:11 -07:00
David Anderson f25cf0836a Include <cmath> instead of <math.h> various places 2013-05-27 16:44:22 -07:00
David Anderson 735e2ef394 - client emulator: show jobs in summary file 2013-05-03 15:08:06 -07:00
David Anderson fb5199e9f6 - client: improve message text for battery conditions 2013-04-10 15:52:00 -07:00