Changeset 65a2940 in nscp


Ignore:
Timestamp:
08/14/11 16:44:02 (22 months ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
2c95d22
Parents:
39c73cd
Message:

2011-08-14 MickeM

  • NRPEClient now works on linux
  • Added "portable" settings map file to installer (so it will work with old installed versions)
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • changelog

    r39c73cd r65a2940  
    66 * Fixa dependonservice LanManWorkStation (old win) 
    77 * Fix RtlStringFromGUID problem on NT4 
     8 
     92011-08-14 MickeM 
     10 * NRPEClient now works on linux 
     11 * Added "portable" settings map file to installer (so it will work with old installed versions) 
    812 
    9132011-08-13 MickeM 
  • helpers/installer-dlls/main_dll/installer_helper.hpp

    r3bdaf18 r65a2940  
    3535      throw installer_exception(_T("Failed to get size for target path '") + path + _T("': ") + error::lookup::last_error()); 
    3636    len++; 
    37     char_buffer buffer(len); 
     37    tchar_buffer buffer(len); 
    3838    if (MsiGetTargetPath(hInstall_ ,path.c_str(), buffer, &len) != ERROR_SUCCESS) { 
    3939      throw installer_exception(_T("Failed to get target path '") + path + _T("': ") + error::lookup::last_error()); 
     
    6262      throw installer_exception(_T("Failed to get size for property '") + path + _T("': ") + error::lookup::last_error()); 
    6363    len++; 
    64     char_buffer buffer(len); 
     64    tchar_buffer buffer(len); 
    6565    if (MsiGetProperty(hInstall_ ,path.c_str(), buffer, &len) != ERROR_SUCCESS) { 
    6666      throw installer_exception(_T("Failed to get property '") + path + _T("': ") + error::lookup::last_error()); 
     
    6969    return value; 
    7070  } 
    71   char_buffer getProperyRAW(std::wstring path) { 
     71  tchar_buffer getProperyRAW(std::wstring path) { 
    7272    wchar_t emptyString[MAX_PATH]; 
    7373    DWORD len = 0; 
     
    7676      throw installer_exception(_T("Failed to get size for property '") + path + _T("': ") + error::format::from_system(er)); 
    7777    len+=2; 
    78     char_buffer buffer(len); 
     78    tchar_buffer buffer(len); 
    7979    if ((er = MsiGetProperty(hInstall_ ,path.c_str(), buffer, &len)) != ERROR_SUCCESS) { 
    8080      throw installer_exception(_T("Failed to get property '") + path + _T("': ") + error::format::from_system(er)); 
     
    8989  } 
    9090  void setPropertyAndOld(std::wstring key, std::wstring value) { 
     91    logMessage(_T("Reading old value for ") + key + _T("=") + value); 
    9192    MsiSetProperty(hInstall_, key.c_str(), value.c_str()); 
    9293    MsiSetProperty(hInstall_, (key+_T("_OLD")).c_str(), value.c_str()); 
     
    247248    if (!hRec) 
    248249      throw installer_exception(_T("Invalid arguments!")); 
    249     char_buffer buffer; 
     250    tchar_buffer buffer; 
    250251 
    251252    HRESULT hr = S_OK; 
     
    269270  } 
    270271 
     272    /******************************************************************** 
     273  WcaGetRecordString() - gets a string field out of a record 
     274  ********************************************************************/ 
     275  std::wstring get_record_blob(__in MSIHANDLE hRec, __in UINT uiField) 
     276  { 
     277    if (!hRec) 
     278      throw installer_exception(_T("Invalid arguments!")); 
     279    char_buffer buffer; 
     280 
     281    HRESULT hr = S_OK; 
     282    UINT er; 
     283 
     284    unsigned int size = MsiRecordDataSize(hRec, uiField); 
     285    buffer.realloc(size+5); 
     286 
     287    er = ::MsiRecordReadStream(hRec, uiField, buffer, (DWORD*)&size); 
     288    if (er != ERROR_SUCCESS) 
     289    if (ERROR_MORE_DATA == er){ 
     290      throw installer_exception(_T("get_record_string:: Failed to get length of string: ") + error::format::from_system(er)); 
     291    } 
     292    std::string string = buffer; 
     293    return utf8::cvt<std::wstring>(string); 
     294  } 
     295 
    271296  /******************************************************************** 
    272297  HideNulls() - internal helper function to escape [~] in formatted strings 
    273298  ********************************************************************/ 
    274   void _hide_nulls(char_buffer wzData) { 
     299  void _hide_nulls(tchar_buffer wzData) { 
    275300    LPWSTR pwz = wzData; 
    276301    while(*pwz) { 
     
    289314  RevealNulls() - internal helper function to unescape !$! in formatted strings 
    290315  ********************************************************************/ 
    291   void _reveal_nulls(char_buffer wzData) { 
     316  void _reveal_nulls(tchar_buffer wzData) { 
    292317    LPWSTR pwz = wzData; 
    293318    while(*pwz) { 
     
    340365 
    341366    // get the format string 
    342     char_buffer tmp = get_record_string(hRec, uiField); 
     367    tchar_buffer tmp = get_record_string(hRec, uiField); 
    343368    std::wstring t = tmp; 
    344369    if (t.length() == 0) 
     
    360385      throw installer_exception(_T("get_record_formatted_string:: Failed to get length of string: ") + error::format::from_system(er)); 
    361386    } 
    362     char_buffer buffer(++cch); 
     387    tchar_buffer buffer(++cch); 
    363388 
    364389    er = ::MsiFormatRecordW(hInstall_, hRecFormat, buffer, (DWORD*)&cch); 
  • helpers/installer-dlls/main_dll/main_dll.cpp

    re11d494 r65a2940  
    1616bool uninstall(msi_helper &h, std::wstring service_name); 
    1717 
    18 UINT SchedServiceMgmt(__in MSIHANDLE hInstall, msi_helper::WCA_TODO todoSched) 
    19 { 
    20 //  msi_helper h(hInstall, _T("SchedServiceInstall")); 
    21 //  try { 
    22 //    int cFirewallExceptions = 0; 
    23 //    h.logMessage(_T("SchedServiceInstall: ") + strEx::itos(todoSched)); 
    24 //    // anything to do? 
    25 //    if (!h.table_exists(L"Services")) { 
    26 //      h.logMessage(_T("Services table doesn't exist, so there are no services to configure.")); 
    27 //      return ERROR_SUCCESS; 
    28 //    } 
    29 //  
    30 //    // query and loop through all the firewall exceptions 
    31 //    PMSIHANDLE hView = h.open_execute_view(vcsServiceQuery); 
    32 //    if (h.isNull(hView)) { 
    33 //      h.logMessage(_T("Failed to query service view!")); 
    34 //      return ERROR_INSTALL_FAILURE; 
    35 //    } 
    36 //  
    37 //    msi_helper::custom_action_data_w custom_data; 
    38 //    PMSIHANDLE hRec = h.fetch_record(hView); 
    39 //    while (hRec != NULL) 
    40 //    { 
    41 //      std::wstring shortname = h.get_record_formatted_string(hRec, feqShortName); 
    42 //      std::wstring longname = h.get_record_formatted_string(hRec, feqLongName); 
    43 //      std::wstring desc = h.get_record_formatted_string(hRec, feqDesc); 
    44 //      std::wstring deps = h.get_record_formatted_string(hRec, feqDeps); 
    45 //      std::wstring program = h.get_record_formatted_string(hRec, feqProgram); 
    46 //      int attributes = h.get_record_integer(hRec, feqAttributes); 
    47 //      std::wstring component = h.get_record_string(hRec, feqComponent); 
    48 //  
    49 //      // figure out what we're doing for this exception, treating reinstall the same as install 
    50 //      msi_helper::WCA_TODO todoComponent = h.get_component_todo(component); 
    51 //      if ((msi_helper::WCA_TODO_REINSTALL == todoComponent ? msi_helper::WCA_TODO_INSTALL : todoComponent) != todoSched) { 
    52 //        h.logMessage(_T("Component '") + component + _T("' action state (") + strEx::itos(todoComponent) + _T(") doesn't match request (") + strEx::itos(todoSched) + _T(")")); 
    53 //        hRec = h.fetch_record(hView); 
    54 //        continue; 
    55 //      } 
    56 //      h.logMessage(_T("Adding data to CA chunk... ")); 
    57 //      // action :: name :: remoteaddresses :: attributes :: target :: {port::protocol | path} 
    58 //      ++cFirewallExceptions; 
    59 //      custom_data.write_int(todoComponent); 
    60 //      custom_data.write_string(shortname); 
    61 //      custom_data.write_string(longname); 
    62 //      custom_data.write_string(desc); 
    63 //      custom_data.write_string(deps); 
    64 //      custom_data.write_int(attributes); 
    65 //      //custom_data.write_int(fetApplication); 
    66 //      custom_data.write_string(program); 
    67 //      h.logMessage(_T("Adding data to CA chunk... DONE")); 
    68 //      h.logMessage(_T("CA chunk: ") + custom_data.to_string()); 
    69 //      hRec = h.fetch_record(hView); 
    70 //    } 
    71 //    // schedule ExecFirewallExceptions if there's anything to do 
    72 //    if (custom_data.has_data()) { 
    73 //      h.logMessage(_T("Scheduling (WixExecServiceInstall) firewall exception: ") + custom_data.to_string()); 
    74 //      if (msi_helper::WCA_TODO_INSTALL == todoSched) { 
    75 //        HRESULT hr = h.do_deferred_action(L"WixRollbackServiceInstall", custom_data, cFirewallExceptions * COST_SERVICE_INSTALL); 
    76 //        if (FAILED(hr)) { 
    77 //          h.errorMessage(_T("failed to schedule service install exceptions rollback")); 
    78 //          return hr; 
    79 //        } 
    80 //        hr = h.do_deferred_action(L"WixExecServiceInstall", custom_data, cFirewallExceptions * COST_SERVICE_INSTALL); 
    81 //        if (FAILED(hr)) { 
    82 //          h.errorMessage(_T("failed to schedule service install exceptions execution")); 
    83 //          return hr; 
    84 //        } 
    85 //      } 
    86 //      else 
    87 //      { 
    88 //        h.logMessage(_T("Scheduling (WixExecServiceUninstall) firewall exception: ") + custom_data.to_string()); 
    89 //        HRESULT hr = h.do_deferred_action(L"WixRollbackServiceUninstall", custom_data, cFirewallExceptions * COST_SERVICE_INSTALL); 
    90 //        if (FAILED(hr)) { 
    91 //          h.errorMessage(_T("failed to schedule service install exceptions rollback")); 
    92 //          return hr; 
    93 //        } 
    94 //        hr = h.do_deferred_action(L"WixExecServiceUninstall", custom_data, cFirewallExceptions * COST_SERVICE_INSTALL); 
    95 //        if (FAILED(hr)) { 
    96 //          h.errorMessage(_T("failed to schedule service install exceptions execution")); 
    97 //          return hr; 
    98 //        } 
    99 //      } 
    100 //    } else 
    101 //      h.logMessage(_T("No services scheduled")); 
    102 //  } catch (installer_exception e) { 
    103 //    h.errorMessage(_T("Failed to install service: ") + e.what()); 
    104 //    return ERROR_INSTALL_FAILURE; 
    105 //  } catch (...) { 
    106 //    h.errorMessage(_T("Failed to install service: <UNKNOWN EXCEPTION>")); 
    107 //    return ERROR_INSTALL_FAILURE; 
    108 //  } 
    109   return ERROR_SUCCESS; 
    110  
    111 } 
    112  
     18 
     19void copy_file(msi_helper &h, std::wstring source, std::wstring target) { 
     20  if (file_helpers::checks::exists(source)) { 
     21    h.logMessage(_T("Copying: ") + source + _T(" to ") + target); 
     22    if (!CopyFile(source.c_str(), target.c_str(), FALSE)) { 
     23      h.errorMessage(_T("Failed to copy file: ") + error::lookup::last_error()); 
     24    } 
     25  } else { 
     26    h.logMessage(_T("Copying failed: ") + source + _T(" to ") + target + _T(" source was not found.")); 
     27  } 
     28 
     29} 
    11330 
    11431class installer_logger : public settings::logger_interface { 
     
    14663  std::wstring basepath; 
    14764  installer_logger logger; 
    148  
    149   installer_settings_provider(msi_helper *h, std::wstring basepath) : h(h), logger(h), basepath(basepath) {} 
     65  std::wstring old_settings_map; 
     66 
     67  installer_settings_provider(msi_helper *h, std::wstring basepath, std::wstring old_settings_map) : h(h), logger(h), basepath(basepath), old_settings_map(old_settings_map) {} 
    15068 
    15169  virtual std::wstring expand_path(std::wstring file) { 
     
    16987  std::list<std::wstring> get_debug() { 
    17088    return logger.get_debug(); 
     89  } 
     90  std::wstring get_data(std::wstring key) { 
     91    if (key == _T("old_settings_map_data")) { 
     92      return old_settings_map; 
     93    } 
     94    return _T(""); 
    17195  } 
    17296}; 
     
    188112// CONF_OLD_FOUND=0   => Allow setting boot.ini 
    189113 
     114 
     115std::wstring read_map_data(msi_helper &h) { 
     116  std::wstring ret; 
     117  PMSIHANDLE hView = h.open_execute_view(_T("SELECT Data FROM Binary WHERE Name='OldSettingsMap'")); 
     118  if (h.isNull(hView)) { 
     119    h.logMessage(_T("Failed to query service view!")); 
     120    return _T(""); 
     121  } 
     122 
     123  PMSIHANDLE hRec = h.fetch_record(hView); 
     124  if (hRec != NULL) { 
     125    ret = h.get_record_blob(hRec, 1); 
     126    ::MsiCloseHandle(hRec); 
     127  } 
     128  ::MsiCloseHandle(hView); 
     129  return ret; 
     130} 
     131 
    190132extern "C" UINT __stdcall ImportConfig(MSIHANDLE hInstall) { 
    191133  msi_helper h(hInstall, _T("ImportConfig")); 
     
    195137    std::wstring custom = h.getPropery(_T("CUSTOM_CONFIGURATION_FILE")); 
    196138    std::wstring allow = h.getPropery(_T("ALLOW_CONFIGURATION")); 
     139 
     140    std::wstring tmpPath = h.getTempPath(); 
     141 
     142    std::wstring map_data = read_map_data(h); 
     143 
    197144    if (allow == _T("0")) { 
    198145      h.logMessage(_T("Configuration not allowed: ") + allow); 
     
    211158    } 
    212159 
    213     installer_settings_provider provider(&h, target); 
     160    installer_settings_provider provider(&h, target, map_data); 
    214161    if (!settings_manager::init_settings(&provider, _T(""))) { 
    215162      h.logMessage(_T("Settings context had fatal errors")); 
     
    251198    } 
    252199 
    253  
    254200    h.setProperty(_T("CONFIGURATION_TYPE"), settings_manager::get_settings()->get_context()); 
     201    h.logMessage(_T("CONFIGURATION_TYPE=") + settings_manager::get_settings()->get_context()); 
     202    h.logMessage(_T("CONFIGURATION_TYPE=") + settings_manager::get_settings()->get_info()); 
    255203    h.setProperty(_T("CONF_CAN_CHANGE"), _T("1")); 
    256204    h.setProperty(_T("CONF_HAS_ERRORS"), _T("0")); 
    257205 
    258     h.setPropertyAndOld(_T("ALLOWED_HOSTS"), settings_manager::get_settings()->get_string(_T("/settings/default/"), _T("allowed hosts"), _T(""))); 
    259     h.setPropertyAndOld(_T("NSCLIENT_PWD"), settings_manager::get_settings()->get_string(_T("/settings/default/"), _T("password"), _T(""))); 
     206    h.setPropertyAndOld(_T("ALLOWED_HOSTS"), settings_manager::get_settings()->get_string(_T("/settings/default"), _T("allowed hosts"), _T(""))); 
     207    h.setPropertyAndOld(_T("NSCLIENT_PWD"), settings_manager::get_settings()->get_string(_T("/settings/default"), _T("password"), _T(""))); 
    260208 
    261209    std::wstring modpath = _T("/modules"); 
     
    378326    int add_defaults = data.get_next_int(); 
    379327 
    380     installer_settings_provider provider(&h, target); 
     328    std::wstring map_data = read_map_data(h); 
     329 
     330    installer_settings_provider provider(&h, target, map_data); 
    381331    if (!settings_manager::init_settings(&provider, context)) { 
    382332      h.errorMessage(_T("Failed to boot settings: ") + provider.get_error()); 
  • helpers/installers/installer/Product.wxs

    r39c73cd r65a2940  
    253253    <Icon Id="nscp.exe" SourceFile="$(var.Source)/nscp.exe" /> 
    254254    <Icon Id="doc.ico" SourceFile="../../../resources/help.ico"/> 
     255    <Binary Id="OldSettingsMap" SourceFile="$(var.Source)/old-settings.map" /> 
    255256  </Product> 
    256257</Wix> 
  • helpers/settings_manager/settings_manager_impl.h

    re11d494 r65a2940  
    1111    virtual void log_fatal_error(std::wstring error) = 0; 
    1212    virtual settings::logger_interface* create_logger() = 0; 
     13    virtual std::wstring get_data(std::wstring key) = 0; 
    1314  }; 
    1415 
     
    3536      std::wstring ret = buffer; 
    3637      delete [] buffer; 
     38      if (ret == def) { 
     39        std::wstring tmp = provider_->get_data(key); 
     40        if (!tmp.empty()) 
     41          return tmp; 
     42        return def; 
     43      } 
    3744      return ret; 
    3845#else 
  • include/char_buffer.hpp

    rd66ccee r65a2940  
    66//typedef buffer<TCHAR> char_buffer; 
    77 
    8 class char_buffer : public buffer<TCHAR> { 
     8class tchar_buffer : public buffer<TCHAR> { 
    99public: 
    10   char_buffer(std::wstring str) : buffer<TCHAR>(str.length()+2) { 
     10  tchar_buffer(std::wstring str) : buffer<TCHAR>(str.length()+2) { 
    1111    wcsncpy(unsafe_get_buffer(), str.c_str(), str.length()); 
    1212  } 
    13   char_buffer(unsigned int len) : buffer<TCHAR>(len) {} 
    14   char_buffer() : buffer<TCHAR>() {} 
     13  tchar_buffer(unsigned int len) : buffer<TCHAR>(len) {} 
     14  tchar_buffer() : buffer<TCHAR>() {} 
    1515  void zero() { 
    1616    if (length() > 1) 
     
    1818  } 
    1919}; 
     20 
     21class char_buffer : public buffer<char> { 
     22public: 
     23  char_buffer(std::string str) : buffer<char>(str.length()+2) { 
     24    strncpy(unsafe_get_buffer(), str.c_str(), str.length()); 
     25  } 
     26  char_buffer(unsigned int len) : buffer<char>(len) {} 
     27  char_buffer() : buffer<char>() {} 
     28  void zero() { 
     29    if (length() > 1) 
     30      ZeroMemory(unsafe_get_buffer(), length()); 
     31  } 
     32}; 
     33 
  • include/nrpe/client/socket.hpp

    r39c73cd r65a2940  
    6060      std::vector<char> buf = packet.get_buffer(); 
    6161      write_with_timeout(buf, timeout); 
    62       get_socket().shutdown(boost::asio::ip::tcp::socket::shutdown_send); 
    6362    } 
    6463    virtual nrpe::packet recv(const nrpe::packet &packet, boost::posix_time::seconds timeout) { 
     
    8079 
    8180#ifdef USE_SSL 
    82   class ssl_socket : public socket, public boost::noncopyable { 
     81  class ssl_socket : public socket { 
    8382  private: 
    8483    boost::shared_ptr<boost::asio::ssl::stream<tcp::socket> > ssl_socket_; 
  • include/nscapi/macros.hpp

    r39c73cd r65a2940  
    2020 
    2121#define NSC_WRAPPERS_CLI() \ 
    22   extern "C" int NSCommandLineExec(const unsigned int,wchar_t**); 
     22  extern "C" int NSCommandLineExec(wchar_t *command, char *request_buffer, unsigned int request_len, char **response_buffer, unsigned int *response_len); 
    2323 
    2424#define NSC_WRAPPERS_CHANNELS() \ 
     
    210210 
    211211#define NSC_WRAPPERS_CLI_DEF(toObject) \ 
    212   extern int NSCommandLineExec(const wchar_t* command,const char* request_buffer,const unsigned int request_len,char** response_buffer,unsigned int* response_len) { \ 
     212  extern int NSCommandLineExec(wchar_t *command, char *request_buffer, unsigned int request_len, char **response_buffer, unsigned int *response_len) { \ 
    213213    try { \ 
    214214    std::string request = std::string(request_buffer, request_len); \ 
  • include/settings/settings_old.hpp

    re11d494 r65a2940  
    6161        } 
    6262      } 
     63      void read_map_data(std::wstring data) { 
     64        strEx::splitList list = strEx::splitEx(data, _T("\n")); 
     65        BOOST_FOREACH(std::wstring l, list) { 
     66          parse_line(l); 
     67        } 
     68      } 
    6369      void parse_line(std::wstring line) { 
     70        strEx::replace(line, _T("\n"), _T("")); 
     71        strEx::replace(line, _T("\r"), _T("")); 
    6472        int pos = line.find('#'); 
    6573        if (pos != -1) 
    6674          line = line.substr(0, pos); 
    67         pos = line.find_first_not_of(_T(" \t")); 
     75        pos = line.find_first_not_of(_T(" \t\n\r")); 
    6876        if (pos == -1) 
    6977          return; 
     
    108116        key_map::iterator it1 = keys_.find(new_key); 
    109117        if (it1 != keys_.end()) { 
    110           get_logger()->quick_debug(new_key.first + _T(".") + new_key.second + _T(" not found in alias list")); 
     118          get_logger()->quick_debug(new_key.first + _T(".") + new_key.second + _T(" found in alias list")); 
    111119          return (*it1).second; 
    112120        } 
    113121        path_map::iterator it2 = sections_.find(new_key.first); 
    114         if (it2 != sections_.end()) 
     122        if (it2 != sections_.end()) { 
    115123          return settings_core::key_path_type((*it2).second, new_key.second); 
     124        } 
    116125        return new_key; 
     126      } 
     127      std::wstring status() { 
     128        return _T("Sections: ") + strEx::itos(sections_.size()) + _T(", ") 
     129          + _T("Keys: ") + strEx::itos(keys_.size()) 
     130          ; 
    117131      } 
    118132 
     
    155169    OLDSettings(settings::settings_core *core, std::wstring context) : settings::SettingsInterfaceImpl(core, context), map(core->get_logger()) { 
    156170      get_logger()->debug(__FILE__, __LINE__, _T("Loading OLD: ") + context + _T(" for ") + context); 
    157       map.read_map_file(core->find_file(_T("${exe-path}/old-settings.map"), _T("old-settings.map"))); 
     171      std::wstring mapfile = core->get_boot_string(_T("settings"), _T("old_settings_map_file"), _T("old-settings.map")); 
     172      std::wstring file = core->find_file(_T("${exe-path}/") + mapfile, mapfile); 
     173      bool readmap = false; 
     174      if (file_helpers::checks::exists(file)) { 
     175        readmap = true; 
     176        map.read_map_file(file); 
     177      } 
     178      std::wstring mapdata = core->get_boot_string(_T("settings"), _T("old_settings_map_data"), _T("")); 
     179      if (!mapdata.empty()) { 
     180        readmap = true; 
     181        map.read_map_data(mapdata); 
     182      } 
     183      if (!readmap) { 
     184        core->get_logger()->err(__FILE__, __LINE__,_T("Failed to read map file: ") + mapfile); 
     185      } 
    158186 
    159187      string_list list = get_keys(_T("/includes")); 
  • modules/CheckDisk/CheckDisk.cpp

    re11d494 r65a2940  
    131131    if (ptrFindFirstVolumeW == NULL) 
    132132      return INVALID_HANDLE_VALUE; 
    133     char_buffer  buffer(1024); 
     133    tchar_buffer  buffer(1024); 
    134134    HANDLE h = ptrFindFirstVolumeW(buffer.unsafe_get_buffer(), buffer.length()); 
    135135    if (h != INVALID_HANDLE_VALUE) 
     
    140140    if (ptrFindFirstVolumeW == NULL || hVolume == INVALID_HANDLE_VALUE) 
    141141      return FALSE; 
    142     char_buffer  buffer(1024); 
     142    tchar_buffer  buffer(1024); 
    143143    BOOL r = ptrFindNextVolumeW(hVolume, buffer.unsafe_get_buffer(), buffer.length()); 
    144144    if (r) 
     
    148148 
    149149  void getVolumeInformation(std::wstring volume, std::wstring &name) { 
    150     char_buffer volumeName(1024); 
    151     char_buffer fileSysName(1024); 
     150    tchar_buffer volumeName(1024); 
     151    tchar_buffer fileSysName(1024); 
    152152    DWORD maximumComponentLength, fileSystemFlags; 
    153153 
     
    162162 
    163163  bool GetVolumeNameForVolumeMountPoint(std::wstring volumeMountPoint, std::wstring &volumeName) { 
    164     char_buffer buffer(1024); 
     164    tchar_buffer buffer(1024); 
    165165    if (ptrGetVolumeNameForVolumeMountPointW(volumeMountPoint.c_str(), buffer.unsafe_get_buffer(), buffer.length())) { 
    166166      volumeName = buffer; 
  • modules/NRPEClient/NRPEClient.cpp

    r39c73cd r65a2940  
    239239 
    240240int NRPEClient::commandLineExec(const std::wstring &command, std::vector<std::wstring> &arguments, std::wstring &result) { 
     241  NSC_DEBUG_MSG_STD(_T("===> ") + command); 
    241242  if (command != _T("query") && command != _T("help")) 
    242243    return NSCAPI::returnUNKNOWN; 
  • modules/NRPEClient/NRPEClient.h

    r39c73cd r65a2940  
    2121 
    2222NSC_WRAPPERS_MAIN(); 
     23NSC_WRAPPERS_CLI(); 
     24 
     25 
    2326#include <map> 
    2427#include <nrpe/packet.hpp> 
  • modules/PythonScript/PythonScript.h

    r39c73cd r65a2940  
    2020***************************************************************************/ 
    2121NSC_WRAPPERS_MAIN(); 
     22NSC_WRAPPERS_CLI(); 
     23 
    2224#include <config.h> 
    2325#include <strEx.h> 
  • service/NSClient++.cpp

    r39c73cd r65a2940  
    516516    return new settings_logger(); 
    517517  } 
     518  std::wstring get_data(std::wstring key) { 
     519    // TODO 
     520    return _T(""); 
     521  } 
    518522}; 
    519523 
     
    865869  if (!found && !module.empty()) { 
    866870    try { 
    867       //boost::filesystem::wpath root = ; 
    868871      boost::filesystem::wpath file = NSCPlugin::get_filename(getBasePath() / boost::filesystem::wpath(_T("modules")), module); 
    869872      if (boost::filesystem::is_regular(file)) { 
     
    13591362} 
    13601363 
    1361  
    13621364std::wstring NSClientT::expand_path(std::wstring file) { 
    13631365  strEx::replace(file, _T("${certificate-path}"), _T("${shared-path}/security")); 
  • version.hpp

    r04ef932 r65a2940  
    11#ifndef VERSION_HPP 
    22#define VERSION_HPP 
    3 #define PRODUCTVER     0,4,0,83 
    4 #define STRPRODUCTVER  "0,4,0,83" 
    5 #define STRPRODUCTDATE "2011-08-07" 
     3#define PRODUCTVER     0,4,0,84 
     4#define STRPRODUCTVER  "0,4,0,84" 
     5#define STRPRODUCTDATE "2011-08-14" 
    66#endif // VERSION_HPP 
  • version.txt

    r04ef932 r65a2940  
    11version=0.4.0 
    2 build=83 
    3 date=2011-08-07 
     2build=84 
     3date=2011-08-14 
Note: See TracChangeset for help on using the changeset viewer.