marrakesh server - accept build script as arg

This commit is contained in:
Carsten Haitzler 2014-09-25 15:05:10 +09:00
parent 4410964129
commit b1b0ee5d6a
1 changed files with 4 additions and 4 deletions

View File

@ -11,6 +11,7 @@ static const char *sane_name_veto[] = {"../", "./", "/", NULL};
static const char *sane_name_ok = "01234567890-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.";
static char *repodir = "./repo";
static char *build_sh = "./mrk-srv-build.sh";
static int
sane_forbidden_path(const char *file, const char **forbidden)
@ -143,9 +144,7 @@ client_upload_end(Client *c)
{
fclose(c->f);
c->f = NULL;
snprintf(tmp, sizeof(tmp),
"./mrk-srv-build.sh %s %s",
c->dir, repodir);
snprintf(tmp, sizeof(tmp), "%s %s %s", build_sh, c->dir, repodir);
c->exe = ecore_exe_pipe_run(tmp,
ECORE_EXE_TERM_WITH_PARENT |
ECORE_EXE_NOT_LEADER, c);
@ -324,7 +323,7 @@ main(int argc, char **argv)
if (argc < 2)
{
printf("usage:\n"
" mrk-srv /path/to/repo\n"
" mrk-srv [REPO_DIR] [BUILD_SCRIPT]\n"
"\n");
exit(1);
}
@ -335,6 +334,7 @@ main(int argc, char **argv)
ecore_ipc_init();
if (argc > 1) repodir = ecore_file_realpath(argv[1]);
if (argc > 2) build_sh = ecore_file_realpath(argv[2]);
if (ipc_init())
{