forked from enlightenment/efl
edje_decc: -no-build-sh
Don't output build.sh SVN revision: 44132
This commit is contained in:
parent
5233aff034
commit
6396f3fb00
|
@ -30,6 +30,7 @@ SrcFile_List *srcfiles = NULL;
|
||||||
Font_List *fontlist = NULL;
|
Font_List *fontlist = NULL;
|
||||||
|
|
||||||
int line = 0;
|
int line = 0;
|
||||||
|
int build_sh = 1;
|
||||||
|
|
||||||
int decomp(void);
|
int decomp(void);
|
||||||
void output(void);
|
void output(void);
|
||||||
|
@ -41,7 +42,7 @@ main_help(void)
|
||||||
{
|
{
|
||||||
printf
|
printf
|
||||||
("Usage:\n"
|
("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"
|
"\n"
|
||||||
,progname);
|
,progname);
|
||||||
}
|
}
|
||||||
|
@ -66,6 +67,8 @@ main(int argc, char **argv)
|
||||||
i++;
|
i++;
|
||||||
file_out = argv[i];
|
file_out = argv[i];
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(argv[i], "-no-build-sh"))
|
||||||
|
build_sh = 0;
|
||||||
}
|
}
|
||||||
if (!file_in)
|
if (!file_in)
|
||||||
{
|
{
|
||||||
|
@ -292,17 +295,25 @@ output(void)
|
||||||
FILE *f;
|
FILE *f;
|
||||||
SrcFile *sf = eina_list_data_get(srcfiles->list);
|
SrcFile *sf = eina_list_data_get(srcfiles->list);
|
||||||
|
|
||||||
snprintf(out, sizeof(out), "%s/build.sh", outdir);
|
|
||||||
printf("Output Build Script: %s\n", out);
|
if (build_sh)
|
||||||
if (strstr(out, "../"))
|
|
||||||
{
|
{
|
||||||
printf("ERROR: potential security violation. attempt to write in parent dir.\n");
|
snprintf(out, sizeof(out), "%s/build.sh", outdir);
|
||||||
exit (-1);
|
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)
|
if (file_out)
|
||||||
{
|
{
|
||||||
|
@ -312,9 +323,6 @@ output(void)
|
||||||
|
|
||||||
chmod(out, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP);
|
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);
|
eet_close(ef);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue