if (r->class == CLASS_EXTERNAL) log_d("executing %s %s", cp->cgi_argv[0], cp->cgi_argv[1]); else log_d("executing %s", cp->cgi_argv[0]);
if (debug) { if (r->class == CLASS_EXTERNAL) log_d("executing %s %s", cp->cgi_argv[0], cp->cgi_argv[1]); else log_d("executing %s", cp->cgi_argv[0]); }
static int exec_cgi(struct request *r){	struct cgi_parameters *cp;	if (setuid(0) != -1) {		if (r->c->script_user) {			if (become_user(r->c->script_user) == -1)				return cgi_error(r, 404);		} else if (r->c->run_scripts_as_owner) {			if (set_uids(r->finfo.st_uid, r->finfo.st_gid) == -1)				return cgi_error(r, 404);		} else {			log_d("cannot run scripts withouth changing identity");			return cgi_error(r, 404);		}	}	if (getuid() == 0 || geteuid() == 0) {		log_d("cannot run scripts as the super-user");		return cgi_error(r, 500);	}	cp = malloc(sizeof *cp);	if (cp == 0)		return cgi_error(r, 500);	cp->cgi_envc = 0;	cp->cgi_envp = 0;	cp->cgi_argc = 0;	cp->cgi_argv = 0;	if (init_cgi_env(r, cp) == -1) {		destroy_parameters(cp);		return cgi_error(r, 500);	}	if (r->class == CLASS_EXTERNAL)		log_d("executing %s %s", cp->cgi_argv[0], cp->cgi_argv[1]);	else		log_d("executing %s", cp->cgi_argv[0]);	execve(cp->cgi_argv[0], (char **) cp->cgi_argv, cp->cgi_envp);	lerror("execve");	destroy_parameters(cp);	return cgi_error(r, 404);}