*** empty log message ***

svn path=/trunk/boinc/; revision=10323
This commit is contained in:
Charlie Fenton 2006-06-13 09:08:00 +00:00
parent 04cb6887aa
commit 03e6f39866
7 changed files with 42 additions and 11 deletions

View File

@ -5876,3 +5876,15 @@ David 12 June 2006
lib/
filesys.h
Charlie 13 June 2006
- more sandbox stuff, with #ifdef SANDBOX.
client/
app_start.C
client_types.C
file_names.C
gui_rpc_server.C
main.C
clientgui/
BOINCGUIApp.cpp

View File

@ -97,9 +97,10 @@ static int make_link(const char *existing, const char *new_link) {
fprintf(fp, "<soft_link>%s</soft_link>\n", existing);
fclose(fp);
#ifdef SANDBOX
boinc_chown(new_link, gstate.boinc_project_gid);
#endif
return boinc_chown(new_link, gstate.boinc_project_gid);
#else
return 0;
#endif
}
int ACTIVE_TASK::link_user_files() {

View File

@ -556,7 +556,7 @@ int FILE_INFO::set_permissions() {
// in case someone runs BOINC from different user
#ifdef SANDBOX
retval = chown(pathname, (uid_t)-1, gstate.boinc_project_gid);
retval = boinc_chown(pathname, gstate.boinc_project_gid);
if (retval) return retval;
if (executable) {
retval = chmod(pathname,

View File

@ -105,12 +105,16 @@ int make_project_dir(PROJECT& p) {
boinc_mkdir(PROJECTS_DIR);
#ifdef SANDBOX
boinc_chown(PROJECTS_DIR, gstate.boinc_projects_gid);
boinc_chown(PROJECTS_DIR, gstate.boinc_project_gid);
chmod(PROJECTS_DIR,
S_IRUSR|S_IWUSR|S_IXUSR
|S_IRGRP|S_IXGRP
);
#endif
get_project_dir(&p, buf);
retval = boinc_mkdir(buf);
#ifdef SANDBOX
boinc_chown(buf, gstate.boinc_projects_gid);
boinc_chown(buf, gstate.boinc_project_gid);
#endif
return retval;
}
@ -138,12 +142,16 @@ int make_slot_dir(int slot) {
}
boinc_mkdir(SLOTS_DIR);
#ifdef SANDBOX
boinc_chown(SLOTS_DIR, gstate.boinc_projects_gid);
boinc_chown(SLOTS_DIR, gstate.boinc_project_gid);
chmod(SLOTS_DIR,
S_IRUSR|S_IWUSR|S_IXUSR
|S_IRGRP|S_IXGRP
);
#endif
get_slot_dir(slot, buf);
int retval = boinc_mkdir(buf);
#ifdef SANDBOX
boinc_chown(buf, gstate.boinc_projects_gid);
boinc_chown(buf, gstate.boinc_project_gid);
#endif
return retval;
}

View File

@ -103,7 +103,7 @@ int GUI_RPC_CONN_SET::get_password() {
// they can cause code to execute as this user.
// So better protect it.
//
#ifdef sandbox
#ifdef SANDBOX
// Allow group access so authorized administrator can modify it
chmod(GUI_RPC_PASSWD_FILE, S_IRUSR|S_IWUSR | S_IRGRP | S_IWGRP);
#else

View File

@ -345,7 +345,7 @@ static void init_core_client(int argc, char** argv) {
#endif
#ifdef sandbox
#ifdef SANDBOX
umask (2); // Set file creation mask to be writable by both user and group
// Our umask will be inherited by all our child processes
#endif

View File

@ -23,6 +23,8 @@
#ifdef __WXMAC__
#include <Carbon/Carbon.h>
#include "filesys.h"
#include "util.h"
#endif
#include "stdwx.h"
@ -241,7 +243,7 @@ bool CBrandingScheme::OnInit( wxConfigBase *pConfig ) {
bool CBOINCGUIApp::OnInit() {
#ifdef sandbox
#ifdef SANDBOX
umask (2); // Set file creation mask to be writable by both user and group
// Our umask will be inherited by all our child processes
#endif
@ -316,8 +318,16 @@ bool CBOINCGUIApp::OnInit() {
if (success) {
// If SetWD failed, don't create a directory in wrong place
strDirectory += wxT("BOINC Data"); // We don't customize BOINC Data directory name for branding
if (! wxDirExists(strDirectory))
if (! wxDirExists(strDirectory)) {
#ifdef SANDBOX
gid_t gid;
success = wxMkdir(strDirectory, 0750); // Does nothing if dir exists
lookup_group("boinc_project", gid);
boinc_chown("BOINC Data", gid);
#else
success = wxMkdir(strDirectory, 0777); // Does nothing if dir exists
#endif
}
success = ::wxSetWorkingDirectory(strDirectory);
// wxChar *wd = wxGetWorkingDirectory(buf, 1000); // For debugging
}