commit openwsman for openSUSE:Factory
Hello community, here is the log from the commit of package openwsman for openSUSE:Factory checked in at 2014-02-28 07:24:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openwsman (Old) and /work/SRC/openSUSE:Factory/.openwsman.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "openwsman" Changes: -------- --- /work/SRC/openSUSE:Factory/openwsman/openwsman.changes 2014-01-30 11:36:50.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.openwsman.new/openwsman.changes 2014-02-28 07:24:43.000000000 +0100 @@ -1,0 +2,21 @@ +Thu Feb 27 14:22:58 UTC 2014 - kkaempf@suse.com + +- Update to 2.4.4 + - Security update + - ws_xml_make_default_prefix() can overflow buf parameter via sprintf() + - ws_xml_make_default_prefix() can overflow buf parameter via sprintf() + - wsmc_create_request() potential buf[20] overflow via WSMAN_ACTION_RENEW + - LocalSubscriptionOpUpdate() unchecked fopen() + - Incorrect order of sanity guards in wsman_get_fault_status_from_doc() + - Unchecked memory allocation in wsman_init_plugins(), p->ifc + - Unchecked memory allocation in mem_double(), newptr + - Unchecked memory allocation in dictionary_new(), d, d->val, d->key, d->hash + - Unchecked memory allocation in u_error_new(), *error + - sighup_handler() in wsmand.c uses unsafe functions in a signal handler + - Features + - add rcopenwsman command to systemd environments + - Bindings + - support rdoc 2.1 in Ruby bindings + - cmake: use PYTHON_INCLUDE_DIRS + +------------------------------------------------------------------- Old: ---- openwsman-2.4.3.tar.bz2 New: ---- openwsman-2.4.4.tar.bz2 openwsman_2.4.3-0ubuntu5~precise2~ppa1.debian.tar.gz openwsman_2.4.3-0ubuntu5~precise2~ppa1.dsc openwsman_2.4.3.orig.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openwsman.spec ++++++ --- /var/tmp/diff_new_pack.A7rmkn/_old 2014-02-28 07:24:44.000000000 +0100 +++ /var/tmp/diff_new_pack.A7rmkn/_new 2014-02-28 07:24:44.000000000 +0100 @@ -114,7 +114,7 @@ %endif Requires(pre): sed coreutils grep /bin/hostname -Version: 2.4.3 +Version: 2.4.4 Release: 0 # Mandriva: # Release %mkrel 1 @@ -345,7 +345,8 @@ ln -sf %{_sysconfdir}/init.d/openwsmand $RPM_BUILD_ROOT%{_sbindir}/rcopenwsmand %else # rcopenwsmand for systemd -ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcopenwsmand +ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcopenwsman +ln -sf %{_sbindir}/rcopenwsman $RPM_BUILD_ROOT%{_sbindir}/rcopenwsmand %endif install -m 644 etc/openwsman.conf $RPM_BUILD_ROOT%{_sysconfdir}/openwsman install -m 644 etc/openwsman_client.conf $RPM_BUILD_ROOT%{_sysconfdir}/openwsman @@ -477,7 +478,10 @@ %endif %if 0%{?suse_version} <= 1210 %attr(0755,root,root) %{_sysconfdir}/init.d/openwsmand +%else +%{_sbindir}/rcopenwsman %endif +# backwards compatibility %{_sbindir}/rcopenwsmand %dir %{_libdir}/openwsman %dir %{_libdir}/openwsman/authenticators ++++++ openwsman-2.4.3.tar.bz2 -> openwsman-2.4.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/CMakeLists.txt new/openwsman-2.4.4/CMakeLists.txt --- old/openwsman-2.4.3/CMakeLists.txt 2013-09-10 16:06:17.000000000 +0200 +++ new/openwsman-2.4.4/CMakeLists.txt 2014-02-13 12:15:37.000000000 +0100 @@ -258,6 +258,12 @@ MESSAGE( FATAL_ERROR " curl not found" ) ELSE ( NOT CURL_FOUND) INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) + IF(CURL_VERSION_STRING) + STRING(COMPARE LESS ${CURL_VERSION_STRING} "7.12.0" result) + IF(result LESS 0) + MESSAGE( FATAL_ERROR " curl version ${CURL_VERSION_STRING} is too low, need 7.12.0 or greater" ) + ENDIF(result LESS 0) + ENDIF(CURL_VERSION_STRING) ENDIF( NOT CURL_FOUND) # xml2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/ChangeLog new/openwsman-2.4.4/ChangeLog --- old/openwsman-2.4.3/ChangeLog 2013-12-10 10:25:49.000000000 +0100 +++ new/openwsman-2.4.4/ChangeLog 2014-02-27 14:18:18.000000000 +0100 @@ -1,3 +1,18 @@ +2.4.4 +- Security update + - ws_xml_make_default_prefix() can overflow buf parameter via sprintf() + - ws_xml_make_default_prefix() can overflow buf parameter via sprintf() + - wsmc_create_request() potential buf[20] overflow via WSMAN_ACTION_RENEW + - LocalSubscriptionOpUpdate() unchecked fopen() + - Incorrect order of sanity guards in wsman_get_fault_status_from_doc() + - Unchecked memory allocation in wsman_init_plugins(), p->ifc + - Unchecked memory allocation in mem_double(), newptr + - Unchecked memory allocation in dictionary_new(), d, d->val, d->key, d->hash + - Unchecked memory allocation in u_error_new(), *error + - sighup_handler() in wsmand.c uses unsafe functions in a signal handler +- Bindings + - support rdoc 2.1 in Ruby bindings + 2.4.3 - Bugfixes - Fix bindings for Java 1.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/VERSION.cmake new/openwsman-2.4.4/VERSION.cmake --- old/openwsman-2.4.3/VERSION.cmake 2013-12-10 10:21:44.000000000 +0100 +++ new/openwsman-2.4.4/VERSION.cmake 2014-02-27 09:07:50.000000000 +0100 @@ -44,10 +44,10 @@ # set COMPATMINOR to MINOR. (binary incompatible change) # -# Package version 2.4.3 +# Package version 2.4.4 SET(OPENWSMAN_MAJOR "2") SET(OPENWSMAN_MINOR "4") -SET(OPENWSMAN_PATCH "3") +SET(OPENWSMAN_PATCH "4") # Plugin API 2.2 SET(OPENWSMAN_PLUGIN_API_MAJOR "2") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/bindings/ruby/CMakeLists.txt new/openwsman-2.4.4/bindings/ruby/CMakeLists.txt --- old/openwsman-2.4.3/bindings/ruby/CMakeLists.txt 2013-09-11 14:53:53.000000000 +0200 +++ new/openwsman-2.4.4/bindings/ruby/CMakeLists.txt 2013-12-23 11:46:03.000000000 +0100 @@ -6,11 +6,14 @@ add_subdirectory(tests) +EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['ruby_version']" OUTPUT_VARIABLE RUBY_VERSION) + # prefer vendor dirs SET(RUBY_WSMAN_LIB_DIR ${RUBY_VENDORLIB_DIR}) SET(RUBY_WSMAN_ARCH_DIR ${RUBY_VENDORARCH_DIR}) MESSAGE(STATUS "Ruby executable: ${RUBY_EXECUTABLE}") +MESSAGE(STATUS "Ruby version: ${RUBY_VERSION}") MESSAGE(STATUS "Ruby dir: ${RUBY_WSMAN_LIB_DIR}") MESSAGE(STATUS "Ruby arch dir: ${RUBY_WSMAN_ARCH_DIR}") MESSAGE(STATUS "Ruby include path: ${RUBY_INCLUDE_PATH}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/bindings/ruby/README.rdoc new/openwsman-2.4.4/bindings/ruby/README.rdoc --- old/openwsman-2.4.3/bindings/ruby/README.rdoc 2013-09-05 15:52:19.000000000 +0200 +++ new/openwsman-2.4.4/bindings/ruby/README.rdoc 2014-02-27 08:35:55.000000000 +0100 @@ -2,9 +2,9 @@ home :: http://openwsman.github.io wiki :: https://github.com/Openwsman/openwsman/wiki -mailing list :: openwsman-devel@lists.sourceforge.net +mailing list :: mailto:openwsman-devel@lists.sourceforge.net source :: https://github.com/Openwsman/openwsman -rdoc :: http://www.suse.de/~kkaempf/openwsman +rdoc :: http://openwsman.github.io/rdoc bugs :: https://github.com/Openwsman/openwsman/issues code climate :: {<img src="https://codeclimate.com/github/Openwsman/openwsman.png">}[https://codeclimate.com/github/Openwsman/openwsman] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/bindings/ruby/rdoc2.1 new/openwsman-2.4.4/bindings/ruby/rdoc2.1 --- old/openwsman-2.4.3/bindings/ruby/rdoc2.1 1970-01-01 01:00:00.000000000 +0100 +++ new/openwsman-2.4.4/bindings/ruby/rdoc2.1 2014-02-27 08:32:19.000000000 +0100 @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby +require 'rdoc' + +require 'rdoc/encoding' +require 'rdoc/parser' + +# Simple must come first +require 'rdoc/parser/simple' +require File.join(File.dirname(__FILE__),'rdoc_parser_swig') +require File.join(File.dirname(__FILE__),'rdoc2_1') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/bindings/ruby/rdoc2_1.rb new/openwsman-2.4.4/bindings/ruby/rdoc2_1.rb --- old/openwsman-2.4.3/bindings/ruby/rdoc2_1.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/openwsman-2.4.4/bindings/ruby/rdoc2_1.rb 2014-02-28 07:24:44.000000000 +0100 @@ -0,0 +1 @@ +symbolic link to /usr/bin/rdoc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/configure.in new/openwsman-2.4.4/configure.in --- old/openwsman-2.4.3/configure.in 2013-08-05 11:47:23.000000000 +0200 +++ new/openwsman-2.4.4/configure.in 2014-02-27 09:08:00.000000000 +0100 @@ -3,7 +3,7 @@ dnl ******************************************* AC_PREREQ(2.53) -AC_INIT(openwsman, 2.3.7) +AC_INIT(openwsman, 2.4.4) AC_CONFIG_SRCDIR(src/server/wsmand.c) AC_CANONICAL_HOST AC_CONFIG_MACRO_DIR([m4]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/examples/serialize.c new/openwsman-2.4.4/examples/serialize.c --- old/openwsman-2.4.3/examples/serialize.c 2012-01-03 08:54:48.000000000 +0100 +++ new/openwsman-2.4.4/examples/serialize.c 2013-12-23 11:46:03.000000000 +0100 @@ -184,7 +184,7 @@ } - retval = memcmp(cs, &servie, sizeof(&servie)); + retval = memcmp(cs, &servie, sizeof(servie)); if (retval) { printf("Not compared (%d) - FAILED\n", retval); printf("%d : %d\n", servie.AcceptPause, cs->AcceptPause); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/package/openwsman.spec.in new/openwsman-2.4.4/package/openwsman.spec.in --- old/openwsman-2.4.3/package/openwsman.spec.in 2013-12-10 10:20:54.000000000 +0100 +++ new/openwsman-2.4.4/package/openwsman.spec.in 2013-12-11 16:25:15.000000000 +0100 @@ -54,13 +54,10 @@ BuildRequires: pkgconfig BuildRequires: ruby -# RHEL6 is missing ruby-devel in OBS -%if 0%{?rhel_version} != 600 BuildRequires: ruby-devel %if 0%{?fedora} == 0 BuildRequires: ruby-rdoc %endif -%endif %if 0%{?fedora} == 19 BuildRequires: rubypick @@ -431,9 +428,6 @@ %{python_sitearch}/*.so %{python_sitearch}/*.py* -# RHEL6 is missing ruby-devel in OBS -%if 0%{?rhel_version} != 600 - %files ruby %defattr(-,root,root) %if 0%{?mandriva_version} @@ -448,8 +442,6 @@ %{ruby_sitelib}/openwsman/*.rb %endif -%endif - %files ruby-docs %defattr(-,root,root) %dir %{_docdir}/openwsman-ruby-docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/lib/u/iniparser.c new/openwsman-2.4.4/src/lib/u/iniparser.c --- old/openwsman-2.4.3/src/lib/u/iniparser.c 2010-09-29 15:17:53.000000000 +0200 +++ new/openwsman-2.4.4/src/lib/u/iniparser.c 2014-02-27 11:11:46.000000000 +0100 @@ -152,6 +152,10 @@ void *newptr; newptr = calloc(2*size, 1); + if (newptr == NULL) { + fprintf(stderr, "mem_double: allocation failed\n"); + return NULL; + } memcpy(newptr, ptr, size); free(ptr); return newptr ; @@ -214,11 +218,16 @@ if (size<DICTMINSZ) size=DICTMINSZ ; d = (dictionary *)calloc(1, sizeof(dictionary)); - d->size = size ; - d->val = (char **)calloc(size, sizeof(char*)); - d->key = (char **)calloc(size, sizeof(char*)); - d->hash = (unsigned int *)calloc(size, sizeof(unsigned)); - + if (d != NULL) { + d->size = size ; + d->val = (char **)calloc(size, sizeof(char*)); + d->key = (char **)calloc(size, sizeof(char*)); + d->hash = (unsigned int *)calloc(size, sizeof(unsigned)); + } + if ((d == NULL) || (d->val == NULL) || (d->key == NULL) || (d->hash == NULL)) { + fprintf(stderr, "dictionary_new: memory allocation failure\n"); + d = NULL; + } return d; } @@ -346,8 +355,14 @@ /* Reached maximum size: reallocate blackboard */ d->val = (char **)mem_double(d->val, d->size * sizeof(char*)) ; + if (d->val == NULL) + exit(1); d->key = (char **)mem_double(d->key, d->size * sizeof(char*)) ; + if (d->key == NULL) + exit(1); d->hash = (unsigned int *)mem_double(d->hash, d->size * sizeof(unsigned)) ; + if (d->hash == NULL) + exit(1); /* Double size */ d->size *= 2 ; @@ -874,6 +889,8 @@ * Initialize a new dictionary entry */ d = dictionary_new(0); + if (d == NULL) + return d; lineno = 0 ; while (fgets(lin, ASCIILINESZ, ini)!=NULL) { lineno++ ; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/lib/u/uerr.c new/openwsman-2.4.4/src/lib/u/uerr.c --- old/openwsman-2.4.3/src/lib/u/uerr.c 2010-09-29 15:17:53.000000000 +0200 +++ new/openwsman-2.4.4/src/lib/u/uerr.c 2014-02-27 11:16:28.000000000 +0100 @@ -44,6 +44,10 @@ return; *error = u_malloc(sizeof(u_error_t)); + if (*error == NULL) { + fprintf(stderr, "u_error_new: memory allocation failure\n"); + return; + } (*error)->code = code; va_start(args, format); (*error)->message = u_strdup_vprintf(format, args); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/lib/wsman-client.c new/openwsman-2.4.4/src/lib/wsman-client.c --- old/openwsman-2.4.3/src/lib/wsman-client.c 2013-08-05 11:47:23.000000000 +0200 +++ new/openwsman-2.4.4/src/lib/wsman-client.c 2014-02-27 09:21:06.000000000 +0100 @@ -855,7 +855,6 @@ WsXmlNodeH header; WsXmlNodeH node; char *_action = NULL; - char buf[20]; if (action == WSMAN_ACTION_IDENTIFY) { request = ws_xml_create_envelope(); } else { @@ -964,14 +963,18 @@ } break; case WSMAN_ACTION_RENEW: + { + char buf[20]; node = ws_xml_add_child(body, XML_NS_EVENTING, WSEVENT_RENEW, NULL); - sprintf(buf, "PT%fS", options->expires); + /* %f default precision is 6 -> [-]ddd.ddd */ + snprintf(buf, 20, "PT%fS", options->expires); ws_xml_add_child(node, XML_NS_EVENTING, WSEVENT_EXPIRES, buf); if(data) { if(((char *)data)[0] != 0) add_subscription_context(ws_xml_get_soap_header(request), (char *)data); } + } break; case WSMAN_ACTION_NONE: case WSMAN_ACTION_TRANSFER_CREATE: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/lib/wsman-dispatcher.c new/openwsman-2.4.4/src/lib/wsman-dispatcher.c --- old/openwsman-2.4.3/src/lib/wsman-dispatcher.c 2013-08-05 11:47:23.000000000 +0200 +++ new/openwsman-2.4.4/src/lib/wsman-dispatcher.c 2014-01-02 10:27:41.000000000 +0100 @@ -312,6 +312,7 @@ n = ws_xml_get_child(header, 0, XML_NS_ADDRESSING, WSA_FAULT_TO); if (n != NULL) { + debug("wsa:FaultTo is not supported"); retVal = 1; generate_op_fault(op, WSMAN_UNSUPPORTED_FEATURE, WSMAN_DETAIL_ADDRESSING_MODE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/lib/wsman-faults.c new/openwsman-2.4.4/src/lib/wsman-faults.c --- old/openwsman-2.4.3/src/lib/wsman-faults.c 2013-08-05 11:47:23.000000000 +0200 +++ new/openwsman-2.4.4/src/lib/wsman-faults.c 2014-02-27 10:56:59.000000000 +0100 @@ -607,22 +607,37 @@ wsman_get_fault_status_from_doc (WsXmlDocH doc, WsmanStatus *status) { int i; - char *subcode_value=ws_xml_get_xpath_value(doc, FAULT_SUBCODE_VALUE_XPATH); - char *subcode_value_msg =calloc(1,strlen(subcode_value)); - char *start_pos = strchr(subcode_value,':'); - strcpy(subcode_value_msg, start_pos+1); - if (strlen(subcode_value)== 0 ) return ; + char *subcode_value = ws_xml_get_xpath_value(doc, FAULT_SUBCODE_VALUE_XPATH); + char *subcode_value_msg; + char *start_pos; + + if (strlen(subcode_value) == 0) + return; + + subcode_value_msg = calloc(1, strlen(subcode_value)); + if (subcode_value_msg == NULL) { + error("Out of memory"); + status->fault_code = WSMAN_INTERNAL_ERROR; + /* some default values */ + status->fault_detail_code = OWSMAN_SYSTEM_ERROR; + status->fault_msg = NULL; + return; + } + + start_pos = strchr(subcode_value, ':'); + if (start_pos != NULL) { + strcpy(subcode_value_msg, start_pos+1); - int nfaults = sizeof (fault_code_table) / sizeof (fault_code_table[0]); - for (i = 0; i < nfaults; i++) { - if (strcmp (subcode_value_msg , fault_code_table[i].subCode) == 0) { - status->fault_code = fault_code_table[i].fault_code; - //some default values - status->fault_detail_code = 0; - status->fault_msg='\0'; - return; + int nfaults = sizeof (fault_code_table) / sizeof (fault_code_table[0]); + for (i = 0; i < nfaults; i++) { + if (strcmp (subcode_value_msg , fault_code_table[i].subCode) == 0) { + status->fault_code = fault_code_table[i].fault_code; + /* some default values */ + status->fault_detail_code = 0; + status->fault_msg = NULL; + return; + } } - } return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/lib/wsman-server.c new/openwsman-2.4.4/src/lib/wsman-server.c --- old/openwsman-2.4.3/src/lib/wsman-server.c 2012-02-06 12:36:44.000000000 +0100 +++ new/openwsman-2.4.4/src/lib/wsman-server.c 2014-02-27 10:56:33.000000000 +0100 @@ -102,6 +102,10 @@ p->ifc = (WsDispatchInterfaceInfo *) malloc(sizeof(WsDispatchInterfaceInfo)); + if (p->ifc == NULL) { + error("Memory allocation error while loading plugin"); + return NULL; + } ifcinfo = p->ifc; ifcinfo->extraData = p->data; p->set_config = dlsym(p->p_handle, "set_config"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/lib/wsman-subscription-repository.c new/openwsman-2.4.4/src/lib/wsman-subscription-repository.c --- old/openwsman-2.4.3/src/lib/wsman-subscription-repository.c 2011-09-08 13:01:15.000000000 +0200 +++ new/openwsman-2.4.4/src/lib/wsman-subscription-repository.c 2014-02-27 10:58:58.000000000 +0100 @@ -49,16 +49,25 @@ #include "wsman-xml-binding.h" int LocalSubscriptionOpInit (char * uri_repository, void *opaqueData); -int LocalSubscriptionOpFinalize(char * uri_repository, void *opaqueData); -int LocalSubscriptionOpGet(char * uri_repository, char * uuid, unsigned char **subscriptionDoc, int *len); -int LocalSubscriptionOpSearch(char * uri_repository, char * uuid); +int LocalSubscriptionOpFinalize (char * uri_repository, void *opaqueData); +int LocalSubscriptionOpGet (char * uri_repository, char * uuid, unsigned char **subscriptionDoc, int *len); +int LocalSubscriptionOpSearch (char * uri_repository, char * uuid); int LocalSubscriptionOpLoad (char * uri_repository, list_t * subscription_list); int LocalSubscriptionOpSave (char * uri_repository, char * uuid, unsigned char *subscriptionDoc); -int LocalSubscriptionOpUpdate(char * uri_repository, char * uuid, char *expire); +int LocalSubscriptionOpUpdate (char * uri_repository, char * uuid, char *expire); int LocalSubscriptionOpDelete (char * uri_repository, char * uuid); -struct __SubsRepositoryOpSet subscription_repository_op_set = {LocalSubscriptionOpInit, LocalSubscriptionOpFinalize, LocalSubscriptionOpLoad, LocalSubscriptionOpGet, LocalSubscriptionOpSearch, LocalSubscriptionOpSave, LocalSubscriptionOpUpdate, LocalSubscriptionOpDelete}; +struct __SubsRepositoryOpSet subscription_repository_op_set = { + LocalSubscriptionOpInit, + LocalSubscriptionOpFinalize, + LocalSubscriptionOpLoad, + LocalSubscriptionOpGet, + LocalSubscriptionOpSearch, + LocalSubscriptionOpSave, + LocalSubscriptionOpUpdate, + LocalSubscriptionOpDelete +}; static int LocalSubscriptionInitFlag = 0; @@ -76,8 +85,7 @@ int LocalSubscriptionOpFinalize(char * uri_repository, void *opaqueData) { - if(LocalSubscriptionInitFlag == 0) return -1; - return 0; + return (LocalSubscriptionInitFlag == 0) ? -1 : 0; } int LocalSubscriptionOpGet(char * uri_repository, char * uuid, unsigned char **subscriptionDoc, int *len) @@ -86,24 +94,32 @@ unsigned char *buf = NULL; int count,m; int pre_count; + char *subs_path; + FILE *fp; + count = m = 0; *subscriptionDoc = NULL; - if(LocalSubscriptionInitFlag == 0) return -1; - char *subs_path = u_strdup_printf ("%s/uuid:%s", uri_repository, uuid); - FILE *fp = fopen(subs_path, "r"); + if (LocalSubscriptionInitFlag == 0) + return -1; + subs_path = u_strdup_printf ("%s/uuid:%s", uri_repository, uuid); + fp = fopen(subs_path, "r"); + if (fp == NULL) { + error("Can't open %s: %s", subs_path, strerror(errno)); + u_free(subs_path); + return -1; + } u_free(subs_path); - if(fp == NULL) return -1; - while(!feof(fp)) { - memset(block, 0, 512); - m = fread(block, 1, 511, fp); - if(m > 0) { - debug("read [%s] from file, len = %d",block, m); - pre_count = count; - count += m; - debug("buf = %0x, count = %d", buf, count); - buf = u_realloc(buf, count); - memcpy(buf+pre_count, block, m); - } + while (!feof(fp)) { + memset(block, 0, 512); + m = fread(block, 1, 511, fp); + if (m > 0) { + debug("read [%s] from file, len = %d",block, m); + pre_count = count; + count += m; + debug("buf = %0x, count = %d", buf, count); + buf = u_realloc(buf, count); + memcpy(buf+pre_count, block, m); + } } fclose(fp); *subscriptionDoc = buf; @@ -113,11 +129,18 @@ int LocalSubscriptionOpSearch(char * uri_repository, char * uuid) { - if(LocalSubscriptionInitFlag == 0) return -1; - char *subs_path = u_strdup_printf ("%s/uuid:%s", uri_repository, uuid); - FILE *fp = fopen(subs_path, "r"); + char *subs_path; + FILE *fp; + if (LocalSubscriptionInitFlag == 0) + return -1; + subs_path = u_strdup_printf ("%s/uuid:%s", uri_repository, uuid); + fp = fopen(subs_path, "r"); + if (fp == NULL) { + error("Can't open %s: %s", subs_path, strerror(errno)); + u_free(subs_path); + return -1; + } u_free(subs_path); - if(fp == NULL) return -1; fclose(fp); return 0; } @@ -129,29 +152,38 @@ int pre_count; char block[512]; unsigned char *buf = NULL; - if(LocalSubscriptionInitFlag == 0) return -1; - if(subscription_list == NULL) - return -1; - if (0 > (n = scandir (uri_repository, &namelist, 0, alphasort))) - { - return -1; - } else { - while (n--) - { + + if (LocalSubscriptionInitFlag == 0) + return -1; + if (subscription_list == NULL) + return -1; + if (0 > (n = scandir (uri_repository, &namelist, 0, alphasort))) { + return -1; + } + else { + while (n--) { + char *subs_path; + FILE *subs; lnode_t *node; - if(strstr(namelist[n]->d_name,"uuid") == NULL || strlen(namelist[n]->d_name) < 41) { + + if (strstr(namelist[n]->d_name,"uuid") == NULL || strlen(namelist[n]->d_name) < 41) { u_free(namelist[n]); continue; } - char *subs_path = u_strdup_printf ("%s/%s", uri_repository, namelist[n]->d_name); - FILE *subs = fopen(subs_path, "r"); + subs_path = u_strdup_printf ("%s/%s", uri_repository, namelist[n]->d_name); + subs = fopen(subs_path, "r"); + if (subs == NULL) { + error("Can't open %s: %s", subs_path, strerror(errno)); + u_free(subs_path); + return -1; + } u_free(subs_path); count = 0; buf = NULL; - while(!feof(subs)) { + while (!feof(subs)) { memset(block, 0, 512); m = fread(block, 1, 511, subs); - if(m > 0) { + if (m > 0) { pre_count = count; count += m; buf = u_realloc(buf, count); @@ -160,7 +192,7 @@ } fclose(subs); SubsRepositoryEntryH entry = u_malloc(sizeof(*entry)); - if(entry) { + if (entry) { entry->strdoc = buf; entry->len = count; entry->uuid = u_strdup(namelist[n]->d_name); @@ -170,37 +202,52 @@ } u_free(namelist[n]); } - u_free(namelist); + u_free(namelist); } return 0; } + int LocalSubscriptionOpSave (char * uri_repository, char * uuid, unsigned char *subscriptionDoc) { char buf[U_NAME_MAX]; - if(LocalSubscriptionInitFlag == 0) return -1; + FILE *subsfile; + + if (LocalSubscriptionInitFlag == 0) + return -1; snprintf(buf, U_NAME_MAX, "%s/uuid:%s", uri_repository, uuid); - FILE *subsfile = fopen(buf, "w"); - if(subsfile == NULL) return -1; + subsfile = fopen(buf, "w"); + if (subsfile == NULL) { + error("Can't open %s: %s", buf, strerror(errno)); + return -1; + } fprintf(subsfile, "%s", subscriptionDoc); fclose(subsfile); return 0; } + int LocalSubscriptionOpUpdate(char * uri_repository, char * uuid, char *expire) { char buf[U_NAME_MAX]; - if(LocalSubscriptionInitFlag == 0) return -1; - snprintf(buf, U_NAME_MAX, "%s/uuid:%s", uri_repository, uuid); WsXmlDocH doc= NULL; char *temp; int len = 0; + + if (LocalSubscriptionInitFlag == 0) + return -1; + snprintf(buf, U_NAME_MAX, "%s/uuid:%s", uri_repository, uuid); doc = xml_parser_file_to_doc( buf, "UTF-8", 0); - if(doc) { + if (doc) { + FILE *subsfile; WsXmlNodeH node = ws_xml_get_child(ws_xml_get_soap_body(doc), 0, XML_NS_EVENTING, WSEVENT_SUBSCRIBE); node = ws_xml_get_child(node, 0, XML_NS_EVENTING, WSEVENT_EXPIRES); ws_xml_set_node_text(node, expire); ws_xml_dump_memory_enc(doc, &temp, &len, "UTF-8"); - FILE *subsfile = fopen(buf, "w"); + subsfile = fopen(buf, "w"); + if (subsfile == NULL) { + error("Can't open %s: %s", buf, strerror(errno)); + return -1; + } fprintf(subsfile, "%s", temp); fclose(subsfile); ws_xml_free_memory(temp); @@ -208,13 +255,15 @@ } return 0; } + int LocalSubscriptionOpDelete (char * uri_repository, char * uuid) { char buf[U_NAME_MAX]; - if(LocalSubscriptionInitFlag == 0) return -1; + + if (LocalSubscriptionInitFlag == 0) + return -1; snprintf(buf, U_NAME_MAX, "%s/uuid:%s", uri_repository, uuid); - int r = unlink(buf); - if(r) { + if (unlink(buf)) { debug("unlink %s failed! %s", buf, strerror(errno)); } return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/lib/wsman-xml.c new/openwsman-2.4.4/src/lib/wsman-xml.c --- old/openwsman-2.4.3/src/lib/wsman-xml.c 2013-08-05 11:47:23.000000000 +0200 +++ new/openwsman-2.4.4/src/lib/wsman-xml.c 2014-02-27 09:21:35.000000000 +0100 @@ -94,13 +94,13 @@ for (i = 0; g_wsNsData[i].uri != NULL; i++) { WsXmlNsData *nsd = &g_wsNsData[i]; if (strcmp(uri, nsd->uri) == 0 && nsd->prefix) { - sprintf(buf, "%s", nsd->prefix ); + snprintf(buf, bufsize, "%s", nsd->prefix ); return; } } } if(g_wsNsData[i].uri == NULL && bufsize >= 12) - sprintf(buf, "n%lu", ++doc->prefixIndex); + snprintf(buf, bufsize, "n%lu", ++doc->prefixIndex); else buf[0] = 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/plugins/redirect/redirect.c new/openwsman-2.4.4/src/plugins/redirect/redirect.c --- old/openwsman-2.4.3/src/plugins/redirect/redirect.c 2013-09-23 11:29:49.000000000 +0200 +++ new/openwsman-2.4.4/src/plugins/redirect/redirect.c 2014-02-27 11:12:55.000000000 +0100 @@ -99,7 +99,10 @@ dictionary *ini, *inc_ini; filename = (char *) wsmand_options_get_config_file(); ini = iniparser_new(filename); - + if (ini == NULL) { + error("redirect: iniparser_new failed"); + return 0; + } redirect_data = malloc (sizeof(struct __Redirect_Data)); if (redirect_data == NULL){ error("Failed while allocating memory for redirect_data"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/server/wsmand-listener.c new/openwsman-2.4.4/src/server/wsmand-listener.c --- old/openwsman-2.4.3/src/server/wsmand-listener.c 2013-08-08 14:29:16.000000000 +0200 +++ new/openwsman-2.4.4/src/server/wsmand-listener.c 2014-02-27 11:02:19.000000000 +0100 @@ -674,21 +674,21 @@ WsManListenerH *listener = wsman_dispatch_list_new(); listener->config = ini; WsContextH cntx = wsman_init_plugins(listener); - int num_threads=0; - int max_threads=wsmand_options_get_max_threads(); + int num_threads = 0; + int max_threads = wsmand_options_get_max_threads(); int max_connections_per_thread = wsmand_options_get_max_connections_per_thread(); - if(max_threads && !max_connections_per_thread){ + if (max_threads && !max_connections_per_thread) { error("max_threads: %d and max_connections_per_thread : %d", max_threads, max_connections_per_thread); return listener; } + if (cntx == NULL) { + return listener; + } #ifdef ENABLE_EVENTING_SUPPORT wsman_event_init(cntx->soap); #endif - if (cntx == NULL) { - return listener; - } #ifndef HAVE_SSL if (use_ssl) { error("Server configured without SSL support"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openwsman-2.4.3/src/server/wsmand.c new/openwsman-2.4.4/src/server/wsmand.c --- old/openwsman-2.4.3/src/server/wsmand.c 2010-09-29 15:17:53.000000000 +0200 +++ new/openwsman-2.4.4/src/server/wsmand.c 2014-02-27 11:23:26.000000000 +0100 @@ -141,8 +141,6 @@ static void sighup_handler(int sig_num) { - debug("SIGHUP received; reloading data"); - if (wsmand_options_get_debug_level() == 0) { int fd; ++++++ openwsman_2.4.3-0ubuntu5~precise2~ppa1.dsc ++++++ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Format: 3.0 (quilt) Source: openwsman Binary: openwsman, libwsman-server1, libopenwsman1, libwsman1, libwsman-client2, libwsman-curl-client-transport1, libopenwsman-dev, libwsman-clientpp1, libwsman-clientpp-dev, python-openwsman Architecture: any all Version: 2.4.3-0ubuntu5~precise2~ppa1 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Homepage: http://sourceforge.net/projects/openwsman/ Standards-Version: 3.9.5 Build-Depends: debhelper (>= 9.0.0), cmake (>= 2.8.5), libssl-dev, libpam0g-dev, libxml2-dev, libcurl4-openssl-dev, libcimcclient0-dev, swig, python-dev Package-List: libopenwsman-dev deb libdevel extra libopenwsman1 deb oldlibs extra libwsman-client2 deb admin extra libwsman-clientpp-dev deb libdevel extra libwsman-clientpp1 deb admin extra libwsman-curl-client-transport1 deb admin extra libwsman-server1 deb admin extra libwsman1 deb admin extra openwsman deb admin extra python-openwsman deb python extra Checksums-Sha1: a7c4cf67d825215d3f2881b50ce03e5468b7da78 550352 openwsman_2.4.3.orig.tar.gz 10cde49a19ed85096fa605f726f04e58f293ae2e 5022 openwsman_2.4.3-0ubuntu5~precise2~ppa1.debian.tar.gz Checksums-Sha256: 9fbffb65d1c52e1c1acec3cd8039f7fd53c7623820a1036cb7fc5aea5debde7f 550352 openwsman_2.4.3.orig.tar.gz b5c706ce3e4d06a1fde38a108cf201915074425ed5077cfc185422a0cf18e0a6 5022 openwsman_2.4.3-0ubuntu5~precise2~ppa1.debian.tar.gz Files: 8aa43d2c34612e72078d3d4143d213f5 550352 openwsman_2.4.3.orig.tar.gz 8d24cf86229376c16ce04ec257dd1a5c 5022 openwsman_2.4.3-0ubuntu5~precise2~ppa1.debian.tar.gz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJTB469AAoJEB+62MwwnAYS8zIH/jZykwTjQFlTo4M6PWw7taBG YF2AaE+iZYQ9IxE2s4pe6faJAboCdvuhcKEy0SQ3iRhxnS/ZkGG4ocCtUW+fGARS zWHIzQf3O+KAjhQlj1TTkbodrwQ9duR+v7AxOsjOI+o/cYyTfFoSt/nBJfA0eCwr O1a6HjXwjvJIUqJQk16zLGliNtnXLODFh7j57JrbuKE9QJsIixYA1lZUUV8u5nX+ AyUxpr+lT0ZTecxaXvMPPEwyBchHmCHLPk2gNobiu6mz/9Vltqdy66+i1FUbVf1y kBB2hdMr4JGa0rhWlBCDAstw3XaX/N1IO9pBBdi0ULw8lYWkWJ1ybQiNmDrIy58= =6dgB -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de