diff --git a/checkin_notes b/checkin_notes index a5b7099fb8..e6f365ed9c 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7272,3 +7272,30 @@ David 5 July 2006 client/ cs_benchmark.C + +Charlie 6 July 2006 + - Mac sandbox: boinc_delete_file(), clean_out_dir(), boinc_rmdir () + all call remove_project_owned_file_or_dir() which uses switcher + helper application to remove subdirectories created & owned by + projects. + - Add License (GPL) to source files where missing. + + client/ + check_security.C + file_names.C,h + setprojectgrp.C + switcher.C + lib/ + filesys.C + mac_installer/ + release_boinc.sh + release_GridRepublic.sh + +Charlie 6 July 2006 + Mac: integrate task tray icon changes, fix compile errors. + + clientgui/ + BOINCGUIApp.cpp + BOINCTaskBar.cpp + mac/ + MacSysMenu.cpp,h diff --git a/client/check_security.C b/client/check_security.C index e5c98bf8e5..925e3e4aac 100644 --- a/client/check_security.C +++ b/client/check_security.C @@ -439,6 +439,10 @@ static int CheckNestedDirectories(char * basepath, int depth) { } if (isDirectory) { + if (depth > 1) + if ((sbuf.st_uid != boinc_master_uid) && (sbuf.st_gid != boinc_master_gid)) + continue; // We can't check subdirectories owned by boinc_project + retval = CheckNestedDirectories(full_path, depth + 1); if (retval) break; diff --git a/client/file_names.C b/client/file_names.C index d7239bc00a..95167cd9c7 100644 --- a/client/file_names.C +++ b/client/file_names.C @@ -283,4 +283,15 @@ int set_to_project_group(const char* path) { #endif } +int remove_project_owned_file_or_dir(const char* path) { +#ifdef SANDBOX + char cmd[1024]; + + sprintf(cmd, "%s/%s /bin/rm rm -fR \"%s\"", SWITCHER_DIR, SWITCHER_FILE_NAME, path); + return system(cmd); +#else + return ERR_UNLINK; +#endif +} + const char *BOINC_RCSID_7d362a6a52 = "$Id$"; diff --git a/client/file_names.h b/client/file_names.h index 6c5a5f6805..94ddf4e7d1 100644 --- a/client/file_names.h +++ b/client/file_names.h @@ -49,6 +49,8 @@ extern void get_sched_request_filename(PROJECT&, char*); extern void get_sched_reply_filename(PROJECT&, char*); extern void get_master_filename(PROJECT&, char*); extern int set_to_project_group(const char* path); +extern int remove_project_owned_file_or_dir(const char* path); + #define PROJECTS_DIR "projects" #define SLOTS_DIR "slots" diff --git a/client/setprojectgrp.C b/client/setprojectgrp.C index e4d5a7e57b..777b6b6757 100644 --- a/client/setprojectgrp.C +++ b/client/setprojectgrp.C @@ -1,3 +1,22 @@ +// Berkeley Open Infrastructure for Network Computing +// http://boinc.berkeley.edu +// Copyright (C) 2005 University of California +// +// This is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; +// either version 2.1 of the License, or (at your option) any later version. +// +// This software 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 Lesser General Public License for more details. +// +// To view the GNU Lesser General Public License visit +// http://www.gnu.org/copyleft/lesser.html +// or write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + // setprojectgrp.C // // When run as diff --git a/client/switcher.C b/client/switcher.C index 48b2c89616..1d6421fb5a 100644 --- a/client/switcher.C +++ b/client/switcher.C @@ -1,3 +1,22 @@ +// Berkeley Open Infrastructure for Network Computing +// http://boinc.berkeley.edu +// Copyright (C) 2005 University of California +// +// This is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; +// either version 2.1 of the License, or (at your option) any later version. +// +// This software 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 Lesser General Public License for more details. +// +// To view the GNU Lesser General Public License visit +// http://www.gnu.org/copyleft/lesser.html +// or write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + // switcher.C // // When run as @@ -7,10 +26,16 @@ #include #include #include +#include // for MAXPATHLEN int main(int argc, char** argv) { -#if 0 // For debugging +#if 0 // For debugging only + char current_dir[MAXPATHLEN]; + + getcwd( current_dir, sizeof(current_dir)); + fprintf(stderr, "current directory = %s\n", current_dir); + for (int i=0; i