Ejemplo n.º 1
0
int set_to_project_group(const char* path) {
    if (g_use_sandbox) {
        if (switcher_exec(SETPROJECTGRP_FILE_NAME, path)) {
            return ERR_CHOWN;
        }
    }
    return 0;
}
Ejemplo n.º 2
0
void kill_via_switcher(int pid) {
    char cmd[1024];

    if (!g_use_sandbox) return;

    // if project application is running as user boinc_project and
    // core client is running as user boinc_master, we cannot send
    // a signal directly, so use switcher.
    sprintf(cmd, "/bin/kill kill -s KILL %d", pid);
    switcher_exec(SWITCHER_FILE_NAME, cmd);
}
Ejemplo n.º 3
0
int remove_project_owned_file_or_dir(const char* path) {
    char cmd[1024];

    if (g_use_sandbox) {
        snprintf(cmd, sizeof(cmd), "/bin/rm rm -fR \"%s\"", path);
        if (switcher_exec(SWITCHER_FILE_NAME, cmd)) {
            return ERR_UNLINK;
        } else {
            return 0;
        }
    }
    return ERR_UNLINK;
}