From 08c302746cfb71118499df231fed76d4f7ba2bcd Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 12 Jun 2009 11:12:47 +0000 Subject: [PATCH] Mac Sandbox: check_security() writes path of bad file to stderr for some error codes svn path=/trunk/boinc/; revision=18392 --- checkin_notes | 8 ++++++ client/check_security.cpp | 5 ++++ clientgui/BOINCGUIApp.cpp | 52 +++++++++++++++++++-------------------- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/checkin_notes b/checkin_notes index d2bba9fb6a..23bd3ec0dc 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5498,3 +5498,11 @@ David 11 June 2009 html/inc/ countries.inc forum.inc + + Mac Sandbox: check_security() writes path of bad file to stderr for some + error codes. + + client/ + check_security.cpp + clientgui/ + BOINCGUIApp.cpp diff --git a/client/check_security.cpp b/client/check_security.cpp index 2bc46263e3..a4c2a25438 100644 --- a/client/check_security.cpp +++ b/client/check_security.cpp @@ -485,6 +485,7 @@ static int CheckNestedDirectories(char * basepath, int depth, int use_sandbox) { int retval = 0; DIR *dirp; dirent *dp; + static int errShown = 0; dirp = opendir(basepath); if (dirp == NULL) // Should never happen @@ -572,6 +573,10 @@ static int CheckNestedDirectories(char * basepath, int depth, int use_sandbox) { closedir(dirp); + if (retval && !errShown) { + fprintf(stderr, "Permissions error %d at %s\n", retval, full_path); + errShown = 1; + } return retval; } diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 900b9e7ca9..712ae8adb3 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -247,6 +247,32 @@ bool CBOINCGUIApp::OnInit() { } if (!success) iErrorCode = -1016; + + // Initialize the BOINC Diagnostics Framework + int dwDiagnosticsFlags = + BOINC_DIAG_DUMPCALLSTACKENABLED | + BOINC_DIAG_HEAPCHECKENABLED | + BOINC_DIAG_MEMORYLEAKCHECKENABLED | +#if defined(__WXMSW__) || defined(__WXMAC__) + BOINC_DIAG_REDIRECTSTDERR | + BOINC_DIAG_REDIRECTSTDOUT | +#endif + BOINC_DIAG_TRACETOSTDOUT; + + diagnostics_init( + dwDiagnosticsFlags, + "stdoutgui", + "stderrgui" + ); + + + // Enable Logging and Trace Masks + m_pLog = new wxLogBOINC(); + wxLog::SetActiveTarget(m_pLog); + + m_pLog->AddTraceMask(wxT("Function Start/End")); + m_pLog->AddTraceMask(wxT("Function Status")); + #ifdef SANDBOX // Make sure owners, groups and permissions are correct for the current setting of g_use_sandbox @@ -282,32 +308,6 @@ bool CBOINCGUIApp::OnInit() { } #endif // SANDBOX - // Initialize the BOINC Diagnostics Framework - int dwDiagnosticsFlags = - BOINC_DIAG_DUMPCALLSTACKENABLED | - BOINC_DIAG_HEAPCHECKENABLED | - BOINC_DIAG_MEMORYLEAKCHECKENABLED | -#if defined(__WXMSW__) || defined(__WXMAC__) - BOINC_DIAG_REDIRECTSTDERR | - BOINC_DIAG_REDIRECTSTDOUT | -#endif - BOINC_DIAG_TRACETOSTDOUT; - - diagnostics_init( - dwDiagnosticsFlags, - "stdoutgui", - "stderrgui" - ); - - - // Enable Logging and Trace Masks - m_pLog = new wxLogBOINC(); - wxLog::SetActiveTarget(m_pLog); - - m_pLog->AddTraceMask(wxT("Function Start/End")); - m_pLog->AddTraceMask(wxT("Function Status")); - - // Enable known image types wxInitAllImageHandlers();