From dfc2cdb4b66a7895e8255dc91929b35d4bfb6fa4 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 1 Aug 2006 16:09:41 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=10805 --- checkin_notes | 12 ++++++++++++ client/file_names.C | 8 ++++++++ client/main.C | 6 ------ clientgui/BOINCGUIApp.cpp | 9 ++------- lib/boinc_cmd.C | 4 ++-- lib/util.C | 8 ++++++++ 6 files changed, 32 insertions(+), 15 deletions(-) diff --git a/checkin_notes b/checkin_notes index 0bebc871d8..f7e5e71181 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8240,3 +8240,15 @@ Charlie 1 Aug 2006 Mac_SA_Secure.sh mac_installer/ PostInstall.cpp + +Rom 1 Aug 2006 + - Fix build breaks on Windows + + client/ + file_names.C + main.C + clientgui/ + BOINCGUIApp.C + lib/ + boinc_cmd.C + util.C diff --git a/client/file_names.C b/client/file_names.C index 1110315026..b95c2b1299 100644 --- a/client/file_names.C +++ b/client/file_names.C @@ -95,6 +95,7 @@ int make_project_dir(PROJECT& p) { int retval; boinc_mkdir(PROJECTS_DIR); +#ifndef _WIN32 if (g_use_sandbox) { chmod(PROJECTS_DIR, S_IRUSR|S_IWUSR|S_IXUSR @@ -102,8 +103,10 @@ int make_project_dir(PROJECT& p) { |S_IROTH|S_IXOTH ); } +#endif get_project_dir(&p, buf); retval = boinc_mkdir(buf); +#ifndef _WIN32 if (g_use_sandbox) { chmod(buf, S_IRUSR|S_IWUSR|S_IXUSR @@ -112,6 +115,7 @@ int make_project_dir(PROJECT& p) { ); set_to_project_group(buf); } +#endif return retval; } @@ -137,6 +141,7 @@ int make_slot_dir(int slot) { return ERR_NEG; } boinc_mkdir(SLOTS_DIR); +#ifndef _WIN32 if (g_use_sandbox) { chmod(SLOTS_DIR, S_IRUSR|S_IWUSR|S_IXUSR @@ -144,8 +149,10 @@ int make_slot_dir(int slot) { |S_IROTH|S_IXOTH ); } +#endif get_slot_dir(slot, buf); int retval = boinc_mkdir(buf); +#ifndef _WIN32 if (g_use_sandbox) { chmod(buf, S_IRUSR|S_IWUSR|S_IXUSR @@ -154,6 +161,7 @@ int make_slot_dir(int slot) { ); set_to_project_group(buf); } +#endif return retval; } diff --git a/client/main.C b/client/main.C index a6c22a5f9c..24ac1b8b0c 100644 --- a/client/main.C +++ b/client/main.C @@ -78,12 +78,6 @@ typedef void (CALLBACK* ClientLibraryShutdown)(); int finalize(); -// Ideally, we would access this using wxGetApp().m_use_sandbox in the Manager -// and gstate.m_use_sandbox in the Client, but it is used by some source files -// (filesys.C, check_security.C) that are linked with both Manager and Client -// so the most practical solution is to use a global. -int g_use_sandbox; - static bool boinc_cleanup_completed = false; // Used on Windows 95/98/ME to determine when it is safe to leave // the WM_ENDSESSION message handler and allow Windows to finish diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 59849d5b6d..faed75c31d 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -36,6 +36,8 @@ #include "Events.h" #include "BOINCGUIApp.h" #include "AdvancedFrame.h" +#include "util.h" + #ifdef SIMPLEGUI #include "common/wxAnimate.h" @@ -87,13 +89,6 @@ EXTERN_C DWORD BOINCGetIdleTickCount(); IMPLEMENT_APP(CBOINCGUIApp) IMPLEMENT_DYNAMIC_CLASS(CBOINCGUIApp, wxApp) -// Ideally, we would access this using wxGetApp().m_use_sandbox in the Manager -// and gstate.m_use_sandbox in the Client, but it is used by some source files -// (filesys.C, check_security.C) that are linked with both Manager and Client -// so the most practical solution is to use a global. -int g_use_sandbox; - - bool CBrandingScheme::OnInit( wxConfigBase *pConfig ) { wxString strBaseConfigLocation = wxEmptyString; diff --git a/lib/boinc_cmd.C b/lib/boinc_cmd.C index 173f3ef317..d628563491 100644 --- a/lib/boinc_cmd.C +++ b/lib/boinc_cmd.C @@ -43,8 +43,6 @@ using std::string; #include "util.h" #include "version.h" -int g_use_sandbox = 0; - void usage() { fprintf(stderr, "\ @@ -148,6 +146,8 @@ int main(int argc, char** argv) { char passwd_buf[256], hostname_buf[256], *hostname=0; char* passwd = passwd_buf, *p; + g_use_sandbox = false; + strcpy(passwd_buf, ""); read_password_from_file(passwd_buf); diff --git a/lib/util.C b/lib/util.C index 09f6cb263a..58962b67ca 100755 --- a/lib/util.C +++ b/lib/util.C @@ -63,6 +63,14 @@ using std::min; using std::string; + +// Ideally, we would access this using wxGetApp().m_use_sandbox in the Manager +// and gstate.m_use_sandbox in the Client, but it is used by some source files +// (filesys.C, check_security.C) that are linked with both Manager and Client +// so the most practical solution is to use a global. +int g_use_sandbox; + + // Use this instead of strncpy(). // Result will always be null-terminated, and it's faster. // see http://www.gratisoft.us/todd/papers/strlcpy.html