Ejemplo n.º 1
0
/*
    Security checks. Make sure we are staring with a safe environment
 */
static int checkEnvironment(cchar *program)
{
#if ME_UNIX_LIKE
    char   *home;
    home = mprGetCurrentPath();
    if (unixSecurityChecks(program, home) < 0) {
        return -1;
    }
    app->pathVar = sjoin("PATH=", getenv("PATH"), ":", mprGetAppDir(), NULL);
    putenv(app->pathVar);
#endif
    return 0;
}
Ejemplo n.º 2
0
/*
 *  Security checks. Make sure we are staring with a safe environment
 */
int checkEnvironment(Mpr *mpr, cchar *program, cchar *home)
{
#if BLD_UNIX_LIKE
    char    *path;
    /*
     *  Ensure the binaries directory is in the path. Used by ejs to run ejsweb from /usr/local/bin
     */
    path = mprStrcat(mpr, -1, "PATH=", getenv("PATH"), ":", mprGetAppDir(mpr), NULL);
    putenv(path);
#endif
#if BLD_UNIX_LIKE
    if (unixSecurityChecks(mpr, program, home) < 0) {
        return -1;
    }
#endif
    return 0;
}