mirror of https://github.com/BOINC/boinc.git
- server: is_project_dir() was checking that cgi-bin is a directory.
This doesn't work if it's a symlink to a dir. Check for that too. svn path=/trunk/boinc/; revision=25480
This commit is contained in:
parent
adab6254bc
commit
9caa637a4d
|
@ -2964,7 +2964,11 @@ Rom 22 Mar 2012
|
||||||
vbox.cpp
|
vbox.cpp
|
||||||
|
|
||||||
David 22 Mar 2012
|
David 22 Mar 2012
|
||||||
- client/server:
|
- client/server: add optional <dont_use_dcf/> to schedule reply.
|
||||||
|
If set, client won't use DCF for this project.
|
||||||
|
Make this the default in server code;
|
||||||
|
we now do runtime estimation entirely on the server side,
|
||||||
|
and the client-side mechanism is counterproductive.
|
||||||
|
|
||||||
sched/
|
sched/
|
||||||
sched_types.cpp,h
|
sched_types.cpp,h
|
||||||
|
@ -2974,3 +2978,13 @@ David 22 Mar 2012
|
||||||
work_fetch.cpp
|
work_fetch.cpp
|
||||||
cs_scheduler.cpp
|
cs_scheduler.cpp
|
||||||
cpu_sched.cpp
|
cpu_sched.cpp
|
||||||
|
|
||||||
|
David 23 Mar 2012
|
||||||
|
- server: is_project_dir() was checking that cgi-bin is a directory.
|
||||||
|
This doesn't work if it's a symlink to a dir.
|
||||||
|
Check for that too.
|
||||||
|
|
||||||
|
lib/
|
||||||
|
filesys.cpp,h
|
||||||
|
sched/
|
||||||
|
sched_config.cpp
|
||||||
|
|
|
@ -105,6 +105,12 @@ int is_dir(const char* path) {
|
||||||
return (!retval && (((sbuf.st_mode) & S_IFMT) == S_IFDIR));
|
return (!retval && (((sbuf.st_mode) & S_IFMT) == S_IFDIR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int is_dir_follow_symlinks(const char* path) {
|
||||||
|
struct stat sbuf;
|
||||||
|
int retval = stat(path, &sbuf);
|
||||||
|
return (!retval && (((sbuf.st_mode) & S_IFMT) == S_IFDIR));
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
int is_symlink(const char* path) {
|
int is_symlink(const char* path) {
|
||||||
struct stat sbuf;
|
struct stat sbuf;
|
||||||
|
|
|
@ -59,6 +59,7 @@ extern "C" {
|
||||||
extern char boinc_failed_file[256];
|
extern char boinc_failed_file[256];
|
||||||
extern int is_file(const char* path);
|
extern int is_file(const char* path);
|
||||||
extern int is_dir(const char* path);
|
extern int is_dir(const char* path);
|
||||||
|
extern int is_dir_follow_symlinks(const char* path);
|
||||||
extern int is_symlink(const char* path);
|
extern int is_symlink(const char* path);
|
||||||
extern int boinc_truncate(const char*, double);
|
extern int boinc_truncate(const char*, double);
|
||||||
extern int boinc_file_exists(const char* path);
|
extern int boinc_file_exists(const char* path);
|
||||||
|
|
|
@ -377,7 +377,7 @@ static bool is_project_dir(const char* dir) {
|
||||||
sprintf(buf, "%s/%s", dir, CONFIG_FILE);
|
sprintf(buf, "%s/%s", dir, CONFIG_FILE);
|
||||||
if (!is_file(buf)) return false;
|
if (!is_file(buf)) return false;
|
||||||
sprintf(buf, "%s/cgi-bin", dir);
|
sprintf(buf, "%s/cgi-bin", dir);
|
||||||
if (!is_dir(buf)) return false;
|
if (!is_dir_follow_symlinks(buf)) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue