From: Kern Sibbald Date: Mon, 25 Jul 2005 10:12:43 +0000 (+0000) Subject: - Turn off old service helper code in Win32. X-Git-Tag: Release-1.38.0~253 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=236657b14d26e3ed64e3874af63783109f08cb23;p=bacula%2Fbacula - Turn off old service helper code in Win32. - Correct Messages bug found by Phil in stored. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2251 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/filed/filed_conf.c b/bacula/src/filed/filed_conf.c index bb14299558..cc4a3d4c76 100644 --- a/bacula/src/filed/filed_conf.c +++ b/bacula/src/filed/filed_conf.c @@ -22,26 +22,20 @@ * Version $Id$ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ - #include "bacula.h" #include "filed.h" diff --git a/bacula/src/filed/win32/winservice.cpp b/bacula/src/filed/win32/winservice.cpp index 31e77a5da5..54b8ac56a1 100755 --- a/bacula/src/filed/win32/winservice.cpp +++ b/bacula/src/filed/win32/winservice.cpp @@ -148,38 +148,6 @@ bacService::ShowStatus() return TRUE; } -#ifdef xxx_needed -// Static routine to show the Events dialog for a currently-running -// copy of Bacula, (usually a servicified version.) - -BOOL -bacService::ShowEvents() -{ - // Post to the Bacula menu window - if (!PostToBacula(MENU_EVENTS_SHOW, 0, 0)) { - MessageBox(NULL, "No existing instance of Bacula could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK); - return FALSE; - } - return TRUE; -} - - -// Static routine to tell a locally-running instance of the server -// to connect out to a new client - -BOOL -bacService::PostAddNewClient(unsigned long ipaddress) -{ - // Post to the Bacula menu window - if (!PostToBacula(MENU_ADD_CLIENT_MSG, 0, ipaddress)) { - MessageBox(NULL, "No existing instance of Bacula could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK); - return FALSE; - } - - return TRUE; -} -#endif - // SERVICE-MODE ROUTINES // Service-mode defines: @@ -231,39 +199,6 @@ bacService::KillRunningCopy() return TRUE; } -#ifdef xxx_needed - -// ROUTINE TO POST THE HANDLE OF THE CURRENT USER TO THE RUNNING Bacula, IN ORDER -// THAT IT CAN LOAD THE APPROPRIATE SETTINGS. THIS IS USED ONLY BY THE SVCHELPER -// OPTION, WHEN RUNNING UNDER NT -BOOL -bacService::PostUserHelperMessage() -{ - // - Check the platform type - if (!IsWinNT()) { - return TRUE; - } - - // - Get the current process ID - DWORD processId = GetCurrentProcessId(); - - // - Post it to the existing Bacula - if (!PostToBacula(MENU_SERVICEHELPER_MSG, 0, (LPARAM)processId)) { - return FALSE; - } - - // - Wait until it's been used - return TRUE; -} - -// ROUTINE TO PROCESS AN INCOMING INSTANCE OF THE ABOVE MESSAGE -BOOL -bacService::ProcessUserHelperMessage(WPARAM wParam, LPARAM lParam) { - return TRUE; -} - -#endif - // SERVICE MAIN ROUTINE int bacService::BaculaServiceMain() @@ -522,6 +457,7 @@ bacService::InstallService() CloseServiceHandle(hsrvmanager); CloseServiceHandle(hservice); +#ifdef xxx_needed // Now install the servicehelper registry setting... // Locate the RunService registry entry HKEY runapps; @@ -545,6 +481,7 @@ bacService::InstallService() RegCloseKey(runapps); } } +#endif // Everything went fine MessageBox(NULL, @@ -611,6 +548,7 @@ bacService::RemoveService() SC_HANDLE hservice; SC_HANDLE hsrvmanager; +#ifdef xxx_needed // Attempt to remove the service-helper hook HKEY runapps; if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", @@ -621,6 +559,7 @@ bacService::RemoveService() } RegCloseKey(runapps); } +#endif // Open the SCM hsrvmanager = OpenSCManager( @@ -845,13 +784,11 @@ void set_service_description(SC_HANDLE hSCManager, SC_HANDLE hService, sdBuf.lpDescription = lpDesc; - if(!ChangeServiceDescription( + if (!ChangeServiceDescription( hService, // handle to service SERVICE_CONFIG_DESCRIPTION, // change: description &sdBuf) ) { // value: new description log_error_message("ChangeServiceConfig2"); - } else { - printf("ChangeServiceConfig2 SUCCESS\n"); } // Release the database lock. diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c index 66df30163c..5ea530146f 100644 --- a/bacula/src/stored/stored_conf.c +++ b/bacula/src/stored/stored_conf.c @@ -51,7 +51,7 @@ static RES_ITEM store_items[] = { {"description", store_str, ITEM(res_dir.hdr.desc), 0, 0, 0}, {"sdaddress", store_addresses_address, ITEM(res_store.sdaddrs), 0, ITEM_DEFAULT, 9103}, {"sdaddresses", store_addresses, ITEM(res_store.sdaddrs), 0, ITEM_DEFAULT, 9103}, - {"messages", store_res, ITEM(res_store.messages), 0, R_MSGS, 0}, + {"messages", store_res, ITEM(res_store.messages), R_MSGS, 0, 0}, {"sdport", store_addresses_port, ITEM(res_store.sdaddrs), 0, ITEM_DEFAULT, 9103}, {"workingdirectory", store_dir, ITEM(res_store.working_directory), 0, ITEM_REQUIRED, 0}, {"piddirectory", store_dir, ITEM(res_store.pid_directory), 0, ITEM_REQUIRED, 0}, diff --git a/bacula/src/stored/stored_conf.h b/bacula/src/stored/stored_conf.h index caaf77d05b..c025dbbff1 100644 --- a/bacula/src/stored/stored_conf.h +++ b/bacula/src/stored/stored_conf.h @@ -7,19 +7,14 @@ Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ diff --git a/bacula/src/version.h b/bacula/src/version.h index cc7c654a44..607cf92d66 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #undef VERSION #define VERSION "1.37.32" -#define BDATE "22 July 2005" -#define LSMDATE "22Jul05" +#define BDATE "24 July 2005" +#define LSMDATE "24Jul05" /* Debug flags */ #undef DEBUG diff --git a/bacula/src/win32/winbacula.nsi.in b/bacula/src/win32/winbacula.nsi.in index 46417071f3..75a3063fb5 100755 --- a/bacula/src/win32/winbacula.nsi.in +++ b/bacula/src/win32/winbacula.nsi.in @@ -80,7 +80,7 @@ Section "Bacula File Service" SecService StrCmp $6 0 NoCygwin StrCpy $INSTDIR "c:\cygwin\bacula" NoCygwin: -; IfFileExists "c:\cygwin" Cygwin ReallyNoCygwin +; IfFileExists "c:\cygwin\bin\cygwin1.dll" Cygwin ReallyNoCygwin ;Cygwin: ; StrCpy $INSTDIR "c:\cygwin\bacula" ;ReallyNoCygwin: @@ -90,7 +90,7 @@ Section "Bacula File Service" SecService IfFileExists "$INSTDIR\bin\bacula-fd.conf" Upgrade NoUpgrade Upgrade: StrCpy $7 1 - ; Shutdown any baculas that could be running + ; Shutdown any bacula that could be running ExecWait '"$INSTDIR\bin\bacula-fd.exe" /kill' ; give it some time to shutdown Sleep 1000