diff --git a/dcapi/boinc/client.C b/dcapi/boinc/client.C index 96db808391..571c502fa0 100644 --- a/dcapi/boinc/client.C +++ b/dcapi/boinc/client.C @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include @@ -402,14 +402,15 @@ int DC_sendMessage(const char *message) return DC_ERR_NOTIMPL; } - xml = (char *)malloc(6 * strlen(message) + 1); + int buflen = 6 * strlen(message) + 1; + xml = (char *)malloc(buflen); if (!xml) { DC_log(LOG_ERR, "Sending message: Out of memory"); return DC_ERR_INTERNAL; } - xml_escape(message, xml); + xml_escape(message, xml, buflen); len = strlen(xml) + 24; msg = (char *)malloc(len); if (!msg) diff --git a/dcapi/boinc/config.C b/dcapi/boinc/config.C index bddc039953..f9ca59b5b0 100644 --- a/dcapi/boinc/config.C +++ b/dcapi/boinc/config.C @@ -19,15 +19,14 @@ SCHED_CONFIG dc_boinc_config; -int _DC_parseConfigXML(const char *file) +int _DC_parseConfigXML(void) { int ret; - ret = dc_boinc_config.parse_config_file(file); + ret = dc_boinc_config.parse_file(); if (ret) { - DC_log(LOG_ERR, "Failed to parse Boinc project " - "configuration file %s", file); + DC_log(LOG_ERR, "Failed to locate/parse the Boinc project configuration file"); return DC_ERR_CONFIG; } return 0; diff --git a/dcapi/boinc/db.C b/dcapi/boinc/db.C index 6a89f41fcb..4fdd6cadb2 100644 --- a/dcapi/boinc/db.C +++ b/dcapi/boinc/db.C @@ -185,6 +185,7 @@ int DC_sendWUMessage(DC_Workunit *wu, const char *message) { DB_MSG_TO_HOST msg; char *xmlout; + int buflen; msg.clear(); msg.create_time = time(NULL); @@ -192,7 +193,8 @@ int DC_sendWUMessage(DC_Workunit *wu, const char *message) msg.handled = false; /* BOINC tells output buffer should be 6x input size */ - xmlout = g_new(char, 6 * strlen(message) + 1); + buflen = 6 * strlen(message) + 1; + xmlout = g_new(char, buflen); if (!xmlout) { DC_log(LOG_WARNING, "Failed to send message because " @@ -200,7 +202,7 @@ int DC_sendWUMessage(DC_Workunit *wu, const char *message) break; } - xml_escape(message, xmlout); + xml_escape(message, xmlout, buflen); snprintf(msg.xml, sizeof(msg.xml), "%s", xmlout); g_free(xmlout); diff --git a/dcapi/boinc/dc.c b/dcapi/boinc/dc.c index d371b21498..53a19a8a94 100644 --- a/dcapi/boinc/dc.c +++ b/dcapi/boinc/dc.c @@ -110,12 +110,8 @@ int DC_initMaster(const char *config_file) } cfgval = DC_getCfgStr(CFG_PROJECTROOT); - if (!cfgval) - { - DC_log(LOG_ERR, "%s is not specified in the config file", - CFG_PROJECTROOT); - return DC_ERR_CONFIG; - } + if (cfgval) + setenv("BOINC_PROJECT_DIR", cfgval, 1); free(cfgval); /* Check & switch to the working directory */ @@ -166,25 +162,7 @@ int DC_initMaster(const char *config_file) /* Enforce a canonical string representation of the UUID */ uuid_unparse_lower(project_uuid, project_uuid_str); - /* Check the project's configuration */ - cfgval = DC_getCfgStr(CFG_CONFIGXML); - if (!cfgval) - { - DC_log(LOG_ERR, "%s is not set in the config file", - CFG_CONFIGXML); - return DC_ERR_CONFIG; - } - - ret = access(cfgval, R_OK); - if (ret) - { - DC_log(LOG_ERR, "Failed to access the project's configuration " - "at %s: %s", cfgval, strerror(errno)); - free(cfgval); - return DC_ERR_CONFIG; - } - - ret = _DC_parseConfigXML(cfgval); + ret = _DC_parseConfigXML(); free(cfgval); if (ret) return ret; diff --git a/dcapi/boinc/dc_boinc.h b/dcapi/boinc/dc_boinc.h index a3fb150481..cea63de202 100644 --- a/dcapi/boinc/dc_boinc.h +++ b/dcapi/boinc/dc_boinc.h @@ -24,8 +24,6 @@ extern "C" { * Constants */ -/* Location of config.xml */ -#define CFG_CONFIGXML "BoincConfigXML" /* The root direcory of the BOINC project */ #define CFG_PROJECTROOT "ProjectRootDir" /* Level of redundancy (per-client) */ @@ -131,7 +129,7 @@ extern uuid_t project_uuid; */ /* Parses the project's config.xml */ -int _DC_parseConfigXML(const char *file) G_GNUC_INTERNAL; +int _DC_parseConfigXML(void) G_GNUC_INTERNAL; /* Returns the Boinc upload directory */ char *_DC_getUploadDir(void) G_GNUC_INTERNAL; diff --git a/dcapi/cf/boinc.m4 b/dcapi/cf/boinc.m4 index 20cb6b596c..c8260d75db 100644 --- a/dcapi/cf/boinc.m4 +++ b/dcapi/cf/boinc.m4 @@ -19,8 +19,8 @@ AC_DEFUN([SZDG_BOINC_COMMON], [ if test "$no_boinc" != yes; then case "$with_boinc" in yes|auto) - BOINC_INCLUDES="/usr/include/BOINC" - BOINC_CPPFLAGS="-I/usr/include/BOINC" + BOINC_INCLUDES="/usr/include/boinc" + BOINC_CPPFLAGS="-I/usr/include/boinc" BOINC_LDFLAGS= ;; *) @@ -30,7 +30,7 @@ AC_DEFUN([SZDG_BOINC_COMMON], [ BOINC_CPPFLAGS="-I$with_boinc/api -I$with_boinc/lib -I$with_boinc/sched -I$with_boinc/tools -I$with_boinc/db" BOINC_LDFLAGS="-L$with_boinc/api -L$with_boinc/lib -L$with_boinc/sched" else - BOINC_CPPFLAGS="-I$with_boinc/include/BOINC" + BOINC_CPPFLAGS="-I$with_boinc/include/boinc" BOINC_LDFLAGS="-L$with_boinc/lib" fi ;; @@ -66,25 +66,6 @@ AC_DEFUN([SZDG_BOINC_SERVER], [ AC_SUBST([MYSQL_CPPFLAGS]) AC_SUBST([MYSQL_LIBS]) - dnl - dnl Check for BOINC 4.x/5.x - dnl - AC_LANG_PUSH([C++]) - AH_TEMPLATE([BOINC_VERSION], [BOINC major version]) - if test "$no_boinc" != yes; then - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOINC_CPPFLAGS" - AC_CACHE_CHECK([for BOINC version], [boinc_cv_boinc_version], [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], - [SCHED_MSG_LOG::Kind level = SCHED_MSG_LOG::CRITICAL;])], - [boinc_cv_boinc_version=4], - [boinc_cv_boinc_version=5]) - ]) - CPPFLAGS="$save_CPPFLAGS" - AC_DEFINE_UNQUOTED([BOINC_VERSION], [$boinc_cv_boinc_version]) - fi - AC_LANG_POP([C++]) - if test "$no_boinc" != yes; then BOINC_SERVER_CPPFLAGS="$BOINC_CPPFLAGS $MYSQL_CPPFLAGS" BOINC_SERVER_LIBS="-lsched $BOINC_COMMON_LIBS -lstdc++ $MYSQL_LIBS" diff --git a/dcapi/debian/compat b/dcapi/debian/compat new file mode 100644 index 0000000000..7f8f011eb7 --- /dev/null +++ b/dcapi/debian/compat @@ -0,0 +1 @@ +7 diff --git a/dcapi/debian/control b/dcapi/debian/control index 205ae0ccc0..9a85c09cfc 100644 --- a/dcapi/debian/control +++ b/dcapi/debian/control @@ -3,15 +3,13 @@ Section: devel Priority: extra Maintainer: Gábor Gombás Standards-Version: 3.6.2.1 -Build-Depends: boinc-dev (>= 1:5.6.4-1), uuid-dev, libglib2.0-dev, debhelper, automake1.9 | automaken (>= 1.9), autoconf (>= 2.53), libtool, gtk-doc-tools (>= 1.3) +Build-Depends: boinc-dev (>= 1:6.9.0+r18425-1), uuid-dev, libglib2.0-dev, debhelper (>= 7), automake, autoconf (>= 2.53), libtool, gtk-doc-tools (>= 1.3) Package: libdcapi-common-dev Section: libdevel Priority: extra Architecture: all Recommends: libdcapi-boinc-dev | libdcapi-dev -Replaces: libdcapi-dev (<< 0.9-7) -Conflicts: libdcapi-dev (<< 0.9-7) Description: Distributed Computing Platform API - Development files This package contains headers and libraries for building applications using the Distributed Computing Platform. @@ -23,9 +21,7 @@ Section: libdevel Priority: extra Architecture: any Provides: libdcapi-dev -Replaces: libdcapi-dev (<< 0.9-7) -Conflicts: libdcapi-dev (<< 0.9-7) -Depends: libdcapi-common-dev, pkg-config, libglib2.0-dev, boinc-dev (>= 5.6.4-1), uuid-dev +Depends: libdcapi-common-dev (= ${Source-Version}), pkg-config, libglib2.0-dev, boinc-dev (>= 1:6.9.0+r18425-1), uuid-dev Description: Distributed Computing Platform API - Development files This package contains headers and libraries for building applications using the Distributed Computing Platform. diff --git a/dcapi/debian/rules b/dcapi/debian/rules index 83a5621d15..42cfa1593c 100755 --- a/dcapi/debian/rules +++ b/dcapi/debian/rules @@ -5,9 +5,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -# This is the debhelper compatibility version to use. -export DH_COMPAT=4 - DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) @@ -17,7 +14,6 @@ else confflags += --build `echo $(DEB_BUILD_GNU_TYPE) | sed -e 's/i[345]86/i686/'` --host `echo $(DEB_HOST_GNU_TYPE) | sed -e 's/i[345]86/i686/'` endif - ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS = -g CXXFLAGS = -g @@ -38,7 +34,6 @@ config.status: configure # autoreconf ./configure $(confflags) \ --prefix=/usr \ - --disable-maintainer-mode \ --enable-gtk-doc \ --enable-backend-boinc \ --disable-backend-condor \ diff --git a/dcapi/doc/boinc.xml b/dcapi/doc/boinc.xml index 6f73be56f9..10570195af 100644 --- a/dcapi/doc/boinc.xml +++ b/dcapi/doc/boinc.xml @@ -70,23 +70,13 @@ - - BoincConfigXML - - - REQUIRED. The location of the BOINC config.xml - configuration file. - - - ProjectRootDir - REQUIRED. The location of the project's root directory. This - directory. This is the directory that contains the - templates, upload, - download and other BOINC-related + OPTIONAL. The location of the project's root directory. + This is the directory that contains + config.xml and other BOINC-related subdirectories. diff --git a/dcapi/examples/message-example/dc-api.conf b/dcapi/examples/message-example/dc-api.conf index 855bc8c637..d362732c23 100644 --- a/dcapi/examples/message-example/dc-api.conf +++ b/dcapi/examples/message-example/dc-api.conf @@ -25,12 +25,6 @@ LogLevel = Debug # Configuration for BOINC DC-API implementation #-------------------------------------------------------- -# -# boinc config xml file. boinc_appmgr will set it automatically -# - -BoincConfigXML = *Must be specified* - # # BOINC project root directory. boinc_appmgr will set it automatically # diff --git a/dcapi/examples/serialize-example/dc-api.conf b/dcapi/examples/serialize-example/dc-api.conf index fc7b1b26af..f8fd939d54 100644 --- a/dcapi/examples/serialize-example/dc-api.conf +++ b/dcapi/examples/serialize-example/dc-api.conf @@ -25,12 +25,6 @@ LogLevel = Debug # Configuration for BOINC DC-API implementation #-------------------------------------------------------- -# -# boinc config xml file. boinc_appmgr will set it automatically -# - -BoincConfigXML = *Must be specified* - # # BOINC project root directory. boinc_appmgr will set it automatically # diff --git a/dcapi/examples/uppercase-with-callback/dc-api.conf b/dcapi/examples/uppercase-with-callback/dc-api.conf index 1d38cefd51..77b31b6c0f 100644 --- a/dcapi/examples/uppercase-with-callback/dc-api.conf +++ b/dcapi/examples/uppercase-with-callback/dc-api.conf @@ -25,12 +25,6 @@ LogLevel = Debug # Configuration for BOINC DC-API implementation #-------------------------------------------------------- -# -# boinc config xml file. boinc_appmgr will set it automatically -# - -BoincConfigXML = *Must be specified* - # # BOINC project root directory. boinc_appmgr will set it automatically #