Commit Graph

120 Commits

Author SHA1 Message Date
David Anderson 846b8c7757 all components: change strcpy() to strlcpy() when possible.
This commit should cover the client and manager code.
2013-06-03 20:24:48 -07:00
David Anderson 8009a8cecb Condor interface: various fixes, mostly from Jaime Frey
- XML parser: for parse_string(), malloc the 256KB buffer instead of
    allocating it on the stack; the latter crashes threads with 32KB stacks.
    However, do the malloc() only if we've actually seen the start tag
    (this required a bit of code shuffle).
- BOINC GAHP: escape spaces in error msgs
2013-05-27 11:45:10 -07:00
David Anderson 93b8289b60 - XML parser: return error if string exceeds buffer size.
- client: when parsing MD5, use 64 instead of 33 char buffer.
    When the XML parser reads a string,
    it enforces the buffer size limit BEFORE it strips whitespace.
    So if a project put whitespaces before or after the MD5,
    it would fail to parse.
2013-03-29 22:36:53 -07:00
David Anderson 00d9a22779 - Manager (and possibly other components): XML parsing fix 2013-03-07 11:31:38 +01:00
David Anderson 69b0748ada Client/manager: isspace() throws an exception on Win for non-ASCII chars.
Check isascii() first.
2013-03-07 11:28:43 +01:00
David Anderson 2fea038249 - Scheduler: fix security vulnerabilities 2013-03-07 11:28:42 +01:00
David Anderson 35608c434b - fix Android compile warnings
- intermediate checkin for Condor stuff
2013-03-05 13:33:27 +01:00
David Anderson 6391a8c401 - remote job submission: show 20 batches, with link to show all
- XML parser: make low-level functions inline, in an attempt
    (unsuccessful, as far as I can tell) to boost performance
2013-03-01 16:26:08 +01:00
Charlie Fenton fb27092cc7 Remove include of boinc_cl.h from parse.h; it is no longer needed
svn path=/trunk/boinc/; revision=24617
2011-11-17 12:19:24 +00:00
David Anderson 6e1414a07f - scheduler: increase buffer for global prefs from 8K to 64K
- lay the groundwork for changing it to std::string


svn path=/trunk/boinc/; revision=24595
2011-11-15 00:11:12 +00:00
David Anderson 77e3c4d06c - API: compile fixes for MinGW. From Oliver Bock.
svn path=/trunk/boinc/; revision=24474
2011-10-24 23:38:19 +00:00
David Anderson 57fc54ae53 - lib: move XML parse test program to its own file.
Note: XML_PARSER::parse_str() doesn't currently work right
    for something like <foo><a>xx</a></foo>.
    It should return "<a>xx</a>".
    TODO.


svn path=/trunk/boinc/; revision=24325
2011-10-03 21:43:34 +00:00
David Anderson 32583581ac - manager: fix build break on Linux
Undoes part of yesterday's checkin.
- more changes from #ifdef HAVE_X to #if HAVE_X


svn path=/trunk/boinc/; revision=24307
2011-09-28 17:33:26 +00:00
David Anderson c61103ac26 - client: make the attributes of GUI RPCs (network, authentication)
explicit rather than determined by position in a list.
- client: add a new "read-only" attribute for GUI RPCs.
    This is in preparation for handling GUI RPCs in separate threads.
- client: remove code to support pre-V6 graphics.


svn path=/trunk/boinc/; revision=24232
2011-09-18 21:06:49 +00:00
David Anderson a2f6b62d97 - lib: parse <available_ram> in coproc XML
- lib: do coproc XML parsing using new XML parser


svn path=/trunk/boinc/; revision=24215
2011-09-15 04:24:40 +00:00
David Anderson 9dddcdb10c - XML parsing: do XML unescaping in place rather than allocating
a buffer on the stack.
    Fixes a Manager crash on the Mac,
    where the default thread stack size seems to be 512KB.


svn path=/trunk/boinc/; revision=24206
2011-09-14 17:58:53 +00:00
David Anderson abdb603bc4 - job creation: handling of extra XML in input templates didn't work.
- job creation: fix stripping of <output_template> tags
- client: fix off-by-1 error in buffer overflow logic for scanning keys.


svn path=/trunk/boinc/; revision=24057
2011-08-27 16:52:04 +00:00
Charlie Fenton 2246e81d0c lib: use standard implementation of strtoull when available
svn path=/trunk/boinc/; revision=24049
2011-08-26 09:44:50 +00:00
Charlie Fenton 545a4ed0ec client: fix Linux compile errors
svn path=/trunk/boinc/; revision=24044
2011-08-25 08:21:32 +00:00
Charlie Fenton 1ab3080e8f client: fix Linux compile erros
svn path=/trunk/boinc/; revision=24042
2011-08-25 08:18:12 +00:00
Charlie Fenton ad3fb32f17 lib: On Windows, call _strtoui64() instead of strtoull
svn path=/trunk/boinc/; revision=24038
2011-08-24 23:25:36 +00:00
Charlie Fenton 2f881f920d lib: try to fix Linux build errors
svn path=/trunk/boinc/; revision=24037
2011-08-24 22:22:07 +00:00
Charlie Fenton 4e8c11aad9 lib: try to fix Linux build errors
svn path=/trunk/boinc/; revision=24036
2011-08-24 22:16:19 +00:00
Charlie Fenton 0e7909c97b lib, client: revert recent changes to restore unsigned long long so we can determine cause of Linux build errors
svn path=/trunk/boinc/; revision=24035
2011-08-24 21:41:02 +00:00
Charlie Fenton 65ec7878b4 lib: fix compile error on Mac, Ubuntu and Windows
svn path=/trunk/boinc/; revision=24033
2011-08-24 08:12:45 +00:00
David Anderson aff8c96f99 - fix linux build errors in coproc stuff.
I don't think unsigned long long is relevant here.


svn path=/trunk/boinc/; revision=24031
2011-08-24 00:51:20 +00:00
Charlie Fenton 05ddd16f5e client: write / parse OpenCL info in COPROC XML data
svn path=/trunk/boinc/; revision=24028
2011-08-23 12:56:19 +00:00
Charlie Fenton 0c39d8e9d9 client: write / parse OpenCL info in COPROC XML data
svn path=/trunk/boinc/; revision=24027
2011-08-23 12:45:07 +00:00
Charlie Fenton 2d23571541 client: write / parse OpenCL info in COPROC XML data
svn path=/trunk/boinc/; revision=24026
2011-08-23 12:10:38 +00:00
Charlie Fenton 9256e9f4fd client: write / parse OpenCL info in COPROC XML data
svn path=/trunk/boinc/; revision=24025
2011-08-23 11:29:11 +00:00
David Anderson 1383142b03 - client: use new XML parser pretty much everywhere
svn path=/trunk/boinc/; revision=23984
2011-08-11 06:17:33 +00:00
David Anderson c5c5975b44 - Improve interface of XML_PARSER.
Add parsed_tag and is_tag to the class,
    so that parsing functions don't need to declare them
    and pass them around.
- Complete the task of using XML_PARSER as the argument
    to all parsing functions.
    (Internally, many of these functions still use the old XML parser;
    that's the next step.)


svn path=/trunk/boinc/; revision=23978
2011-08-10 17:11:08 +00:00
David Anderson bfc04f03eb - back end: fix bugs in [23648] which caused create_work
to mess up input templates containing
    <copy_file/> or other attribute tags.
    XML_PARSER now contains a member element() for when
    you want to copy an element without knowing its structure.


svn path=/trunk/boinc/; revision=23790
2011-07-04 23:51:00 +00:00
David Anderson 1afde126cb - client: escape only non-ASCII chars in stderr out, not control chars
svn path=/trunk/boinc/; revision=23601
2011-05-25 16:40:19 +00:00
David Anderson 0c948a656a - client: init gstate.now early so that initial msgs have timestamps
- lib: fix the above

svn path=/trunk/boinc/; revision=22012
2010-07-20 04:19:22 +00:00
David Anderson 564cd7cece - Notices: put message bodies inside CDATA
- XML_PARSER: handle CDATA

svn path=/trunk/boinc/; revision=20146
2010-01-13 05:32:11 +00:00
David Anderson 563a55f37e - client/libs/samples: remove "#define read _read" etc. from boinc_win.h
These cause problems when "read" is a member name, etc.
		Do these #defines, conditioned on _MSC_VER,
		in the files that actually need them.
	- don't include boinc_win.h from parse.h.
		principle of minimal inclusion

svn path=/trunk/boinc/; revision=18902
2009-08-22 17:00:19 +00:00
Rom Walton 16156838c5 - client: Second pass through the automatic proxy detection code.
During the first pass we learned that the whole process of
        proxy detection on Win XP machines could take a few seconds
        even with no proxies to be detected, now the proxy detection
        code is executed in the same thread that is monitoring for
        power change events.
        
    client/
        cs_cmdline.cpp
        http_curl.cpp
        http_curl.h
        http_curl_win.h
        net_stats.cpp
        sysmon_win.cpp, .h
    lib/
        parse.cpp, .h
        proxy_info.cpp, .h

svn path=/trunk/boinc/; revision=18819
2009-08-07 18:16:21 +00:00
David Anderson 0939ec0d3a - don't include config.h from parse.h
- manager: compile fix


svn path=/trunk/boinc/; revision=18429
2009-06-16 19:22:11 +00:00
Eric J. Korpela 8f3abcc835 - Added checks for net/*.h, arpa/*.h, netinet/*.h and code to figure out
which of those files to include
    - Modified MAC address check to work on some non-Linux unixes.
      (mac_address.cpp)
    - Added suggested change to "already attached to project" checking.
      (ProjectInfoPage.cpp)
    - changed includes of standard c header files to their c++ equivalents
      (i.e. replaced <stdio.h> with <cstdio>) for namespace protection.
    - replaced "using namespace std;" with more explicit "using std::function" in
      several files.
    - Fixed bug in checking whether the os is OS/2 and added conditional OS_OS2
      to the build environment. (boinc_platform.m4,configure.ac)
    - Changed build environment to not use -nostandardlibs unless we are using
      G++ and static linkage is specified. (configure.ac)
    - Added makefiles and package building files for solaris CSW package manager.
    - Fixed bug with attempting to find login name using logname. (configure.ac)
    - Added ifdef HAVE_* protection around some include files commonly found in
      sys.
    - Added support for unified binary for x86_64/i686-pc-solaris.
      (cs_platforms.cpp)
    - generate_host_cpid() now uses MAC address on non-linux unix.
      (hostinfo_network.cpp)
    - Macro BOINC_SET_COMPILE_FLAGS now doesn't check gcc only flags on non-gcc
      compilers. (boinc_set_compile_flags.m4)
    - Library compiles no longer depend upon the library extension or require
      the library to be prefixed with lib.
    - More fixes for fcgi builds.
    - Added declaration of "struct ether_addr" and ether_ntoa().  Have not yet
      implemented ether_ntoa() for machines that don't have it, or where it is
      buggy.  (unix_util.h)
    - Added FCGI::perror() which calls FCGI_perror(). (boinc_fcgi.{h,cpp})
    - Fixed library Makefiles so that all required headers get installed.


svn path=/trunk/boinc/; revision=17388
2009-02-26 00:23:23 +00:00
David Anderson de2bacab35 - boinccmd: fix bug in --set_proxy_settings command
(it wasn't setting the "use_XXX" flags).  Fixes #776
- client: you can now include a <proxy_info> element
    in your cc_config.xml options.

TODO: the whole proxy info thing needs an overhaul:
- no separate "use_XXX" flags;
    non-empty http_server_name implies using HTTP proxy, etc.
- merge PROXY_INFO and GR_PROXY_INFO classes
- use XML_PARSER for parsing
- no PROXY_INFO element in HTTP_OP; just use gstate.proxy_info

svn path=/trunk/boinc/; revision=17379
2009-02-25 19:18:41 +00:00
David Anderson 823df337a4 - add an interface for parsing XML attributes
svn path=/trunk/boinc/; revision=16096
2008-09-30 16:57:07 +00:00
David Anderson cc7d507789 - DB interface: in update(), check that 1 row was updated
- API: in APP_INIT_DATA, enclose project preferences in tags
    so that it's legal XML
- scheduler: add <multiple_clients_per_host> option.
    Use this if your project runs on Condor or grids
    and (to use multicore machines) you're running
    multiple clients per host.
    This will skip the host lookup based on IP address.


svn path=/trunk/boinc/; revision=15954
2008-09-04 08:33:21 +00:00
David Anderson 104655a358 - client and server: add "len" arg to xml_escape() and xml_unescape()
(prevent buffer overrun).
    Also remove 1024 char limit for team description in db_dump.

svn path=/trunk/boinc/; revision=15820
2008-08-13 17:27:13 +00:00
David Anderson 4f66bb4c95 - added copyright and license info to .C, .cpp, .h files
- scheduler: fix bug in adaptive replication:
    if send an unreplicated job to untrusted host,
    set both wu.target_nresults and wu.min_quorum to app.target_nresults.

svn path=/trunk/boinc/; revision=15762
2008-08-06 18:36:30 +00:00
David Anderson dd538cc62a - XML parsing: when parsing ints, check for errno == ERANGE.
This means the int was too big.
    Ignore it - the XML was corrupted.
    This should fix a problem reported by Kevin where the
    mod_time in a user's global prefs was 100 years in the future,
    causing those prefs to irrevocably propagate.

svn path=/trunk/boinc/; revision=15754
2008-08-05 15:20:02 +00:00
Eric J. Korpela 0124e04750 Fixes ticket #537. Forces use of small files in zlib.h and when /proc
filesystem is used on solaris.

svn path=/trunk/boinc/; revision=15530
2008-07-01 21:27:25 +00:00
David Anderson d439244f3f - fixes for gcc 4.3
svn path=/trunk/boinc/; revision=15020
2008-04-06 03:15:36 +00:00
Eric J. Korpela 51e24737bd - Build fixes for non-Win32, non-Linux, non-MacOS systems.
- configure script:
        - Added checks for functions strdup(), strdupa(),
            daemon(), stat64(), strcasestr()
        - Fixed problems with kc_mysql.m4 and wxWidgets.m4 returning
            invalid CFLAGS and LIBS flags.
        - Fixed incorrect order of pthread flag checking on solaris.
    - New files: lib/unix_util.[Ch].  Currently contains implementation of
        daemon() for systems that lack it.
    - Access to binary files in /proc was failing on some systems when compiled
        with 64 bit file access.  Rearranged headers and defines to force 32bit
        file access in hostinfo_unix.C
    - all_tty_idle() didn't work as advertised on any system as far as I can
        tell.  I rewrote it to check ttys that are not named /dev/tty[1-9].
        The old implementation was modifying a statically allocated read-only
        string, (and crashing on some systems) anyway.
    - added implementation of non-standard function strcasestr() to str_util.C
    - added #define of MAP_FILE to shmem.C, because it is missing from most
        unix systems, (and is unnecessary on linux anyway).
    - other minor bug fixes.


svn path=/trunk/boinc/; revision=14996
2008-04-01 21:44:12 +00:00
David Anderson 1069770a7f - compile fixes for gcc 4.3 (from Frank Thomas)
Fixes #514

svn path=/trunk/boinc/; revision=14436
2007-12-21 21:09:40 +00:00