From 27100c7caf78a9bc36eb693e0c9ef3a7b6b7e592 Mon Sep 17 00:00:00 2001 From: barbieri Date: Wed, 2 Dec 2009 21:00:57 +0000 Subject: [PATCH] edje_decc: -no-build-sh Don't output build.sh git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@44132 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/edje_decc.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/bin/edje_decc.c b/src/bin/edje_decc.c index 40e6179..7e586f3 100644 --- a/src/bin/edje_decc.c +++ b/src/bin/edje_decc.c @@ -30,6 +30,7 @@ SrcFile_List *srcfiles = NULL; Font_List *fontlist = NULL; int line = 0; +int build_sh = 1; int decomp(void); void output(void); @@ -41,7 +42,7 @@ main_help(void) { printf ("Usage:\n" - "\t%s input_file.edj [-main-out file.edc]\n" + "\t%s input_file.edj [-main-out file.edc] [-no-build-sh]\n" "\n" ,progname); } @@ -66,6 +67,8 @@ main(int argc, char **argv) i++; file_out = argv[i]; } + else if (!strcmp(argv[i], "-no-build-sh")) + build_sh = 0; } if (!file_in) { @@ -292,17 +295,25 @@ output(void) FILE *f; SrcFile *sf = eina_list_data_get(srcfiles->list); - snprintf(out, sizeof(out), "%s/build.sh", outdir); - printf("Output Build Script: %s\n", out); - if (strstr(out, "../")) + + if (build_sh) { - printf("ERROR: potential security violation. attempt to write in parent dir.\n"); - exit (-1); + snprintf(out, sizeof(out), "%s/build.sh", outdir); + printf("Output Build Script: %s\n", out); + if (strstr(out, "../")) + { + printf("ERROR: potential security violation. attempt to write in parent dir.\n"); + exit (-1); + } + f = fopen(out, "wb"); + fprintf(f, "#!/bin/sh\n"); + fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n", edje_file->compiler, sf->name, outdir); + fclose(f); + + printf("\n*** CAUTION ***\n" + "Please check the build script for anything malicious " + "before running it!\n\n"); } - f = fopen(out, "wb"); - fprintf(f, "#!/bin/sh\n"); - fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n", edje_file->compiler, sf->name, outdir); - fclose(f); if (file_out) { @@ -312,9 +323,6 @@ output(void) chmod(out, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP); - printf("\n*** CAUTION ***\n" - "Please check the build script for anything malicious " - "before running it!\n\n"); } eet_close(ef); } -- 2.7.4