Changeset e7dbac9 in nscp


Ignore:
Timestamp:
09/06/09 22:28:33 (4 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
1fc246c
Parents:
308b6f5
Message:

2009-09-06 MickeM

+ Added new option to [NSCA Agent] string_length=<size> of the NSCA_MAX_PLUGINOUTPUT_LENGTH option on the NSCA server.

  • Readded all the "installer configuration" crap which I accidentaly removed when I fixed the installer... *sigh*
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • AutoBuild.h

    r308b6f5 re7dbac9  
    33// change the FALSE to TRUE for autoincrement of build number 
    44#define INCREMENT_VERSION TRUE 
    5 #define FILEVER        0,3,7,257 
    6 #define PRODUCTVER     0,3,7,257 
    7 #define STRFILEVER     _T("0.3.7.257") 
    8 #define STRPRODUCTVER  _T("0.3.7.257") 
     5#define FILEVER        0,3,7,279 
     6#define PRODUCTVER     0,3,7,279 
     7#define STRFILEVER     _T("0.3.7.279") 
     8#define STRPRODUCTVER  _T("0.3.7.279") 
    99#define STRPRODUCTDATE  _T("2009-09-06") 
    1010#endif // AUTOBUILD_H 
  • changelog

    r358cda1 re7dbac9  
    66 * Fixa dependonservice LanManWorkStation (old win) 
    77 * Fix RtlStringFromGUID problem on NT4 
     8 
     92009-09-06 MickeM 
     10 + Added new option to [NSCA Agent] string_length=<size> of the NSCA_MAX_PLUGINOUTPUT_LENGTH option on the NSCA server. 
     11 * Readded all the "installer configuration" crap which I accidentaly removed when I fixed the installer... *sigh* 
    812 
    9132009-08-30 MickeM 
  • debug-in.bat

    r358cda1 re7dbac9  
    1 dir /O:-D /A:-D /B stage\installer\*x64* > tmp.txt 
     1rem dir /O:-D /A:-D /B stage\installer\*x64* > tmp.txt 
     2echo dir /O:-D /A:-D /B stage\%2installer\*%1*  
     3dir /O:-D /A:-D /B stage\%2installer\*%1* > tmp.txt 
    24Set /P _INST=<tmp.txt 
    35echo Install: %_INST% 
    4 msiexec /l* installer.txt /i stage\installer\%_INST% 
     6msiexec /l* installer.txt /i stage\%2installer\%_INST% 
  • helpers/installer_dll/installer_helper.hpp

    r308b6f5 re7dbac9  
    8484  */ 
    8585  void setupMyProperty(std::wstring key, std::wstring val) { 
     86    logMessage(_T("Setting old values: ") + key + _T("_OLD=") + val); 
     87    setPropertyIfEmpty(key+_T("_OLD"), val); 
    8688    std::wstring oldDef = getPropery(key+_T("_DEFAULT")); 
    8789    if (!oldDef.empty()) 
    8890      val = oldDef; 
    89     else 
    90       setProperty(key+_T("_DEFAULT"), val); 
    91     setPropertyIfEmpty(key+_T("_OLD"), val); 
    9291    if (val == MY_EMPTY) 
    9392      val = _T(""); 
     93    logMessage(_T("Setting old values: ") + key + _T("=") + val); 
    9494    setPropertyIfEmpty(key, val); 
    9595  } 
  • helpers/installer_dll_fw/Jamfile

    r308b6f5 re7dbac9  
    1515  <runtime-link>static 
    1616  <threading>multi 
    17 # <include>"D:/Program/Microsoft Platform SDK for Windows Server 2003 R2/Include" 
    18   <include>"C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Include/Atl" 
     17  <include>"D:/Program/Microsoft Platform SDK for Windows Server 2003 R2/Include" 
     18# <include>"C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Include/Atl" 
    1919 
    2020  : # default build 
  • include/config.h

    r358cda1 re7dbac9  
    190190#define NSCA_READ_TIMEOUT _T("socket_timeout") 
    191191#define NSCA_READ_TIMEOUT_DEFAULT 30 
     192#define NSCA_STRLEN _T("string_length") 
     193#define NSCA_STRLEN_DEFAULT 512 
    192194 
    193195#define C_SYSTEM_SVC_ALL_0 _T("check_all_services[SERVICE_BOOT_START]") 
  • modules/NSCAAgent/NSCAThread.cpp

    r358cda1 re7dbac9  
    8080  nscahost_ = NSCModuleHelper::getSettingsString(NSCA_AGENT_SECTION_TITLE, NSCA_SERVER, NSCA_SERVER_DEFAULT); 
    8181  nscaport_ = NSCModuleHelper::getSettingsInt(NSCA_AGENT_SECTION_TITLE, NSCA_PORT, NSCA_PORT_DEFAULT); 
     82  payload_length_ = NSCModuleHelper::getSettingsInt(NSCA_AGENT_SECTION_TITLE, NSCA_STRLEN, NSCA_STRLEN_DEFAULT); 
    8283  read_timeout_ = NSCModuleHelper::getSettingsInt(NSCA_AGENT_SECTION_TITLE, NSCA_READ_TIMEOUT, NSCA_READ_TIMEOUT_DEFAULT); 
    8384  std::wstring report = NSCModuleHelper::getSettingsString(NSCA_AGENT_SECTION_TITLE, NSCA_REPORT, NSCA_REPORT_DEFAULT); 
     
    303304      for (std::list<Command::Result>::const_iterator cit = results.begin(); cit != results.end(); ++cit) { 
    304305        try { 
    305           socket.send((*cit).getBuffer(crypt_inst, timeDelta_)); 
     306          socket.send((*cit).getBuffer(crypt_inst, timeDelta_, payload_length_)); 
    306307        } catch (NSCAPacket::NSCAException &e) { 
    307308          NSC_LOG_ERROR_STD(_T("Failed to make command: ") + e.getMessage() ); 
  • modules/NSCAAgent/NSCAThread.h

    r358cda1 re7dbac9  
    160160    } 
    161161 
    162     simpleSocket::DataBuffer getBuffer(nsca_encrypt &crypt_inst, __time32_t time_delta) const { 
     162    simpleSocket::DataBuffer getBuffer(nsca_encrypt &crypt_inst, __time32_t time_delta, unsigned int pluginoutput_length) const { 
    163163      std::string s = strEx::wstring_to_string(service); 
    164164      std::string r = strEx::wstring_to_string(result); 
    165165      std::string h = strEx::wstring_to_string(host); 
    166166 
    167       unsigned int buffer_len = sizeof(NSCAPacket::data_packet); 
     167      unsigned int buffer_len = sizeof(NSCAPacket::data_packet)-NSCA_MAX_PLUGINOUTPUT_LENGTH+pluginoutput_length; 
    168168      unsigned char* buffer = crypt_inst.get_rand_buffer(buffer_len); 
    169169      NSCAPacket::data_packet *data = reinterpret_cast<NSCAPacket::data_packet*>(buffer); 
     
    179179        throw NSCAPacket::NSCAException(_T("description to long")); 
    180180      strncpy_s(data->svc_description, NSCA_MAX_DESCRIPTION_LENGTH, s.c_str(), s.length()); 
    181       if (r.length() >= NSCA_MAX_PLUGINOUTPUT_LENGTH) 
     181      if (r.length() >= pluginoutput_length) 
    182182        throw NSCAPacket::NSCAException(_T("result to long")); 
    183       strncpy_s(data->plugin_output, NSCA_MAX_PLUGINOUTPUT_LENGTH, r.c_str(), r.length()); 
     183      strncpy_s(data->plugin_output, pluginoutput_length, r.c_str(), r.length()); 
    184184 
    185185      unsigned int calculated_crc32=calculate_crc32(buffer,buffer_len); 
     
    229229  std::wstring nscahost_; 
    230230  unsigned int nscaport_; 
     231  unsigned int payload_length_; 
    231232  bool cacheNscaHost_; 
    232233  std::wstring nscaaddr_; 
  • release-build.bat

    r308b6f5 re7dbac9  
    1515 
    1616REM build x64 (Amd64, Emt64) binary 
    17 rem SET version=x64 
    18 rem SET cmdline=build.bat runtime-link=static variant=release address-model=64 --library-path="%TARGET_LIB_x64_DIR%" --with-psdk-lib="%PLATTFORM_SDK_LIB_x64%" --with-psdk="%PLATTFORM_SDK_INCLUDE%" --wix="%WIX_PATH%" 
    19 rem call build.bat runtime-link=static variant=release address-model=64 --library-path="%TARGET_LIB_x64_DIR%" --with-psdk-lib="%PLATTFORM_SDK_LIB_x64%" --with-psdk="%PLATTFORM_SDK_INCLUDE%" --wix="%WIX_PATH%" 
    20 rem if %ERRORLEVEL% == -1 goto :error 
     17 SET version=x64 
     18 SET cmdline=build.bat runtime-link=static variant=release address-model=64 --library-path="%TARGET_LIB_x64_DIR%" --with-psdk-lib="%PLATTFORM_SDK_LIB_x64%" --with-psdk="%PLATTFORM_SDK_INCLUDE%" --wix="%WIX_PATH%" 
     19 call build.bat runtime-link=static variant=release address-model=64 --library-path="%TARGET_LIB_x64_DIR%" --with-psdk-lib="%PLATTFORM_SDK_LIB_x64%" --with-psdk="%PLATTFORM_SDK_INCLUDE%" --wix="%WIX_PATH%" 
     20 if %ERRORLEVEL% == -1 goto :error 
    2121 
    2222 
Note: See TracChangeset for help on using the changeset viewer.