Enforce that the working directory is an absolute path

git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@556 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
gombasg 2006-05-15 12:49:38 +00:00 committed by Adam Visegradi
parent 8c9ecc48a1
commit d15f74ba20
1 changed files with 7 additions and 0 deletions

View File

@ -127,6 +127,13 @@ int DC_init(const char *config_file)
return DC_ERR_CONFIG;
}
if (*cfgval != G_DIR_SEPARATOR)
{
DC_log(LOG_ERR, "The working directory must be an "
"absolute path");
return DC_ERR_CONFIG;
}
/* If we are started as a BOINC daemon, then the current dir is
* <projectroot>/bin, so we must change to the working directory */
if (chdir(cfgval))