From 2d4bb86ae27a3fa3c7679c38ae6360d7639d49b1 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 7 Nov 2023 04:11:56 -0800 Subject: [PATCH 1/2] Modularise check + add forbidden filename Add another forbidden file name in submissions: prog.alt (prog.alt.c is allowed). Modularise the checks for invalid filenames in entries. For instance in check_extra_file() there's no need to check each extra filename and then give the same error message changing the macro of the filename that's disallowed when we can just print the string being tested against. The only difference is that there's one if (with multiple checks) and instead of duplicating the same error message we just print it once with the string being tested against. Note that there are two sets of checks: one for extra files being required filenames and another for disallowed filenames. Make sure to use the macros for the filenames, not the literal strings (e.g. use PROG_FILENAME not "prog"). Check filenames in alphabetical order (I think :-) .. very tired so maybe missed one or two). Note that the function check_extra_file() CANNOT be used in every case so it's not used except in chkentry! --- CHANGES.md | 24 +++++++++++++++++++++ mkiocccentry.c | 6 ++++-- soup/entry_util.c | 53 ++++++++++------------------------------------- soup/entry_util.h | 10 ++++----- txzchk.c | 7 ++++--- 5 files changed, 48 insertions(+), 52 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 34980b365..25c8114b7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,29 @@ # Major changes to the IOCCC entry toolkit +## Release 1.0.55 2023-11-07 + +Add another forbidden file name in submissions: `prog.alt` (prog.alt.c is +allowed). + +Modularise the checks for invalid filenames in entries. For instance in +`check_extra_file()` there's no need to check each extra filename and then give +the same error message changing the macro of the filename that's disallowed when +we can just print the string being tested against. The only difference is that +there's one if (with multiple checks) and instead of duplicating the same error +message we just print it once with the string being tested against. Note that +there are two sets of checks: one for extra files being required filenames and +another for disallowed filenames. + +Make sure to use the macros for the filenames, not the literal strings (e.g. use +`PROG_FILENAME` not `"prog"`). + +Check filenames in alphabetical order (I think :-) .. very tired so maybe missed +one or two). + +Note that the function `check_extra_file()` CANNOT be used in every case so it's +not used except in chkentry! + + ## Release 1.0.54 2023-11-06 The following filenames are no longer allowed in an entry's extra files list: diff --git a/mkiocccentry.c b/mkiocccentry.c index 11a94656b..d963c2c17 100644 --- a/mkiocccentry.c +++ b/mkiocccentry.c @@ -3038,8 +3038,10 @@ check_extra_data_files(struct info *infop, char const *entry_dir, char const *cp not_reached(); } - if (!strcasecmp(args[i], "README.md") || !strcasecmp(args[i], "index.html") || !strcasecmp(args[i], "inventory.html") || - !strcasecmp(args[i], "prog.orig.c") || !strcasecmp(args[i], "prog.orig") || !strcasecmp(args[i], "prog")) { + if (!strcasecmp(args[i], README_MD_FILENAME) || !strcasecmp(args[i], INDEX_HTML_FILENAME) || + !strcasecmp(args[i], INVENTORY_HTML_FILENAME) || !strcasecmp(args[i], PROG_FILENAME) || + !strcasecmp(args[i], PROG_ALT_FILENAME) || !strcasecmp(args[i], PROG_ORIG_FILENAME) || + !strcasecmp(args[i], PROG_ORIG_C_FILENAME)) { fpara(stderr, "", "An extra file cannot be named any of:", diff --git a/soup/entry_util.c b/soup/entry_util.c index 3e0d3ea80..715e455a2 100644 --- a/soup/entry_util.c +++ b/soup/entry_util.c @@ -2879,52 +2879,21 @@ test_extra_file(char const *str) } /* verify that extra_file does not match a mandatory filename */ - if (strcasecmp(str, INFO_JSON_FILENAME) == 0) { + if (!strcasecmp(str, AUTH_JSON_FILENAME) || !strcasecmp(str, INFO_JSON_FILENAME) || + !strcasecmp(str, MAKEFILE_FILENAME) || !strcasecmp(str, PROG_C_FILENAME) || + !strcasecmp(str, REMARKS_FILENAME)) { json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches a mandatory file %s", INFO_JSON_FILENAME); - return false; - } else if (strcasecmp(str, AUTH_JSON_FILENAME) == 0) { - json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches a mandatory file %s", AUTH_JSON_FILENAME); - return false; - } else if (strcasecmp(str, PROG_C_FILENAME) == 0) { - json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches a mandatory file %s", PROG_C_FILENAME); - return false; - } else if (strcasecmp(str, MAKEFILE_FILENAME) == 0) { - json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches a mandatory file %s", MAKEFILE_FILENAME); - return false; - } else if (strcasecmp(str, REMARKS_FILENAME) == 0) { - json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches a mandatory file %s", REMARKS_FILENAME); + "invalid: extra_file matches a mandatory file: <%s>", str); return false; } /* also verify it does not match a disallowed filename */ - else if (strcasecmp(str, README_MD_FILENAME) == 0) { - json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches invalid filename %s", README_MD_FILENAME); - return false; - } else if (strcasecmp(str, PROG_ORIG_C_FILENAME) == 0) { - json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches invalid filename %s", PROG_ORIG_C_FILENAME); - return false; - } else if (strcasecmp(str, PROG_ORIG_FILENAME) == 0) { - json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches invalid filename %s", PROG_ORIG_FILENAME); - return false; - } else if (strcasecmp(str, INDEX_HTML_FILENAME) == 0) { - json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches invalid filename %s", INDEX_HTML_FILENAME); - return false; - } else if (strcasecmp(str, INVENTORY_HTML_FILENAME) == 0) { - json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches invalid filename %s", INVENTORY_HTML_FILENAME); - return false; - } else if (strcasecmp(str, PROG_FILENAME) == 0) { - json_dbg(JSON_DBG_MED, __func__, - "invalid: extra_file matches invalid filename %s", PROG_FILENAME); - return false; + else if (!strcasecmp(str, INDEX_HTML_FILENAME) || !strcasecmp(str, INVENTORY_HTML_FILENAME) || + !strcasecmp(str, PROG_FILENAME) || !strcasecmp(str, PROG_ALT_FILENAME) || + !strcasecmp(str, PROG_ORIG_FILENAME) || !strcasecmp(str, PROG_ORIG_C_FILENAME) || + !strcasecmp(str, README_MD_FILENAME)) { + json_dbg(JSON_DBG_MED, __func__, + "invalid: extra_file matches disallowed filename: <%s>", str); + return false; } json_dbg(JSON_DBG_MED, __func__, "extra_file is valid"); return true; diff --git a/soup/entry_util.h b/soup/entry_util.h index 31317062e..6935ab506 100644 --- a/soup/entry_util.h +++ b/soup/entry_util.h @@ -40,13 +40,13 @@ #define PROG_C_FILENAME "prog.c" #define REMARKS_FILENAME "remarks.md" #define MAKEFILE_FILENAME "Makefile" -#define README_MD_FILENAME "README.md" -#define PROG_ORIG_C_FILENAME "prog.orig.c" -#define PROG_FILENAME "prog" -#define PROG_ORIG_FILENAME "prog.orig" #define INDEX_HTML_FILENAME "index.html" #define INVENTORY_HTML_FILENAME "inventory.html" - +#define PROG_FILENAME "prog" +#define PROG_ALT_FILENAME "prog.alt" +#define PROG_ORIG_FILENAME "prog.orig" +#define PROG_ORIG_C_FILENAME "prog.orig.c" +#define README_MD_FILENAME "README.md" /* * IOCCC author information diff --git a/txzchk.c b/txzchk.c index f7a1e2019..0d7c0d975 100644 --- a/txzchk.c +++ b/txzchk.c @@ -652,9 +652,10 @@ check_txz_file(char const *tarball_path, char const *dir_name, struct txz_file * ++tarball.unsafe_chars; warn(__func__, "%s: file basename does not match regexp ^[0-9A-Za-z][0-9A-Za-z._+-]*$: %s", tarball_path, file->basename); - } else if (!strcasecmp(file->basename, README_MD_FILENAME) || !strcasecmp(file->basename, PROG_ORIG_C_FILENAME) || - !strcasecmp(file->basename, PROG_FILENAME) || !strcasecmp(file->basename, PROG_ORIG_FILENAME) || - !strcasecmp(file->basename, INDEX_HTML_FILENAME) || !strcasecmp(file->basename, INVENTORY_HTML_FILENAME)) { + } else if (!strcasecmp(file->basename, INDEX_HTML_FILENAME) || !strcasecmp(file->basename, INVENTORY_HTML_FILENAME) || + !strcasecmp(file->basename, PROG_FILENAME) || !strcasecmp(file->basename, PROG_ALT_FILENAME) || + !strcasecmp(file->basename, PROG_ORIG_FILENAME) || !strcasecmp(file->basename, PROG_ORIG_C_FILENAME) || + !strcasecmp(file->basename, README_MD_FILENAME)) { ++tarball.total_feathers; ++tarball.invalid_filenames; warn(__func__, "%s: filename not allowed: %s", tarball_path, file->basename); From c6d71f3e8794799ba4d3da9220b0bade2026658a Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 7 Nov 2023 04:13:15 -0800 Subject: [PATCH 2/2] Add bad manifest filenames tests Each forbidden filename in the manifest now has a separate file to check it including prog.alt. The -34.json file was also updated to have prog.alt as an extra filename though it might be better to also check this for other files too if this is not done (been too long and too many other changes in the other repo to recall if this is done or not). That means that under test_ioccc/test_JSON/info.json/bad individual files that have an extra file with the names of: - README.md - index.html - inventory.html - prog - prog.alt - prog.orig - prog.orig.c have been added. Unless other files have to be added later to the list of disallowed filenames or there needs to be a more specific check in mkiocccentry for filenames of the required files this should complete the disallowed and required filenames checks. --- .../info.json/bad/info.manifest-34.json | 1 + .../bad/info.manifest-README-md.json | 47 ++++++++++++++++++ .../bad/info.manifest-index-html.json | 47 ++++++++++++++++++ .../bad/info.manifest-inventory-html.json | 47 ++++++++++++++++++ .../info.json/bad/info.manifest-prog-alt.json | 47 ++++++++++++++++++ .../bad/info.manifest-prog-orig-c.json | 48 +++++++++++++++++++ .../bad/info.manifest-prog-orig.json | 48 +++++++++++++++++++ .../info.json/bad/info.manifest-prog.json | 47 ++++++++++++++++++ 8 files changed, 332 insertions(+) create mode 100644 test_ioccc/test_JSON/info.json/bad/info.manifest-README-md.json create mode 100644 test_ioccc/test_JSON/info.json/bad/info.manifest-index-html.json create mode 100644 test_ioccc/test_JSON/info.json/bad/info.manifest-inventory-html.json create mode 100644 test_ioccc/test_JSON/info.json/bad/info.manifest-prog-alt.json create mode 100644 test_ioccc/test_JSON/info.json/bad/info.manifest-prog-orig-c.json create mode 100644 test_ioccc/test_JSON/info.json/bad/info.manifest-prog-orig.json create mode 100644 test_ioccc/test_JSON/info.json/bad/info.manifest-prog.json diff --git a/test_ioccc/test_JSON/info.json/bad/info.manifest-34.json b/test_ioccc/test_JSON/info.json/bad/info.manifest-34.json index 2a89899b7..b8ca0dc0e 100644 --- a/test_ioccc/test_JSON/info.json/bad/info.manifest-34.json +++ b/test_ioccc/test_JSON/info.json/bad/info.manifest-34.json @@ -39,6 +39,7 @@ {"remarks" : "remarks.md"}, {"extra_file" : "README.md"}, {"extra_file" : "prog.orig.c"}, + {"extra_file" : "prog.alt"}, {"extra_file" : "prog.orig"}, {"extra_file" : "prog"}, {"extra_file" : "index.html"}, diff --git a/test_ioccc/test_JSON/info.json/bad/info.manifest-README-md.json b/test_ioccc/test_JSON/info.json/bad/info.manifest-README-md.json new file mode 100644 index 000000000..b3f15c852 --- /dev/null +++ b/test_ioccc/test_JSON/info.json/bad/info.manifest-README-md.json @@ -0,0 +1,47 @@ +{ + "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", + "IOCCC_info_version" : "1.14 2023-02-04", + "IOCCC_contest" : "IOCCCMOCK", + "IOCCC_year" : 2023, + "mkiocccentry_version" : "1.0.2 2023-11-06", + "iocccsize_version" : "28.13 2023-02-04", + "chkentry_version" : "1.0 2023-02-04", + "fnamchk_version" : "1.0 2023-02-04", + "txzchk_version" : "1.0.2 2023-11-06", + "IOCCC_contest_id" : "12345678-1234-4321-abcd-1234567890ab", + "entry_num" : 0, + "title" : "title-for-entry0", + "abstract" : "abstract for entry #0", + "tarball" : "entry.12345678-1234-4321-abcd-1234567890ab-0.1675547786.txz", + "rule_2a_size" : 0, + "rule_2b_size" : 0, + "empty_override" : true, + "rule_2a_override" : false, + "rule_2a_mismatch" : false, + "rule_2b_override" : false, + "highbit_warning" : false, + "nul_warning" : false, + "trigraph_warning" : false, + "wordbuf_warning" : false, + "ungetc_warning" : false, + "Makefile_override" : false, + "first_rule_is_all" : true, + "found_all_rule" : true, + "found_clean_rule" : true, + "found_clobber_rule" : true, + "found_try_rule" : true, + "test_mode" : false, + "manifest" : [ + {"info_JSON" : ".info.json"}, + {"auth_JSON" : ".auth.json"}, + {"c_src" : "prog.c"}, + {"Makefile" : "Makefile"}, + {"remarks" : "remarks.md"}, + {"extra_file" : "README.md"} + ], + "formed_timestamp" : 1675547786, + "formed_timestamp_usec" : 13685, + "timestamp_epoch" : "Thu Jan 01 00:00:00 1970 UTC", + "min_timestamp" : 1675547786, + "formed_UTC" : "Sat Feb 04 21:56:26 2023 UTC" +} diff --git a/test_ioccc/test_JSON/info.json/bad/info.manifest-index-html.json b/test_ioccc/test_JSON/info.json/bad/info.manifest-index-html.json new file mode 100644 index 000000000..2314531cf --- /dev/null +++ b/test_ioccc/test_JSON/info.json/bad/info.manifest-index-html.json @@ -0,0 +1,47 @@ +{ + "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", + "IOCCC_info_version" : "1.14 2023-02-04", + "IOCCC_contest" : "IOCCCMOCK", + "IOCCC_year" : 2023, + "mkiocccentry_version" : "1.0.2 2023-11-06", + "iocccsize_version" : "28.13 2023-02-04", + "chkentry_version" : "1.0 2023-02-04", + "fnamchk_version" : "1.0 2023-02-04", + "txzchk_version" : "1.0.2 2023-11-06", + "IOCCC_contest_id" : "12345678-1234-4321-abcd-1234567890ab", + "entry_num" : 0, + "title" : "title-for-entry0", + "abstract" : "abstract for entry #0", + "tarball" : "entry.12345678-1234-4321-abcd-1234567890ab-0.1675547786.txz", + "rule_2a_size" : 0, + "rule_2b_size" : 0, + "empty_override" : true, + "rule_2a_override" : false, + "rule_2a_mismatch" : false, + "rule_2b_override" : false, + "highbit_warning" : false, + "nul_warning" : false, + "trigraph_warning" : false, + "wordbuf_warning" : false, + "ungetc_warning" : false, + "Makefile_override" : false, + "first_rule_is_all" : true, + "found_all_rule" : true, + "found_clean_rule" : true, + "found_clobber_rule" : true, + "found_try_rule" : true, + "test_mode" : false, + "manifest" : [ + {"info_JSON" : ".info.json"}, + {"auth_JSON" : ".auth.json"}, + {"c_src" : "prog.c"}, + {"Makefile" : "Makefile"}, + {"remarks" : "remarks.md"}, + {"extra_file" : "index.html"} + ], + "formed_timestamp" : 1675547786, + "formed_timestamp_usec" : 13685, + "timestamp_epoch" : "Thu Jan 01 00:00:00 1970 UTC", + "min_timestamp" : 1675547786, + "formed_UTC" : "Sat Feb 04 21:56:26 2023 UTC" +} diff --git a/test_ioccc/test_JSON/info.json/bad/info.manifest-inventory-html.json b/test_ioccc/test_JSON/info.json/bad/info.manifest-inventory-html.json new file mode 100644 index 000000000..48e35c561 --- /dev/null +++ b/test_ioccc/test_JSON/info.json/bad/info.manifest-inventory-html.json @@ -0,0 +1,47 @@ +{ + "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", + "IOCCC_info_version" : "1.14 2023-02-04", + "IOCCC_contest" : "IOCCCMOCK", + "IOCCC_year" : 2023, + "mkiocccentry_version" : "1.0.2 2023-11-06", + "iocccsize_version" : "28.13 2023-02-04", + "chkentry_version" : "1.0 2023-02-04", + "fnamchk_version" : "1.0 2023-02-04", + "txzchk_version" : "1.0.2 2023-11-06", + "IOCCC_contest_id" : "12345678-1234-4321-abcd-1234567890ab", + "entry_num" : 0, + "title" : "title-for-entry0", + "abstract" : "abstract for entry #0", + "tarball" : "entry.12345678-1234-4321-abcd-1234567890ab-0.1675547786.txz", + "rule_2a_size" : 0, + "rule_2b_size" : 0, + "empty_override" : true, + "rule_2a_override" : false, + "rule_2a_mismatch" : false, + "rule_2b_override" : false, + "highbit_warning" : false, + "nul_warning" : false, + "trigraph_warning" : false, + "wordbuf_warning" : false, + "ungetc_warning" : false, + "Makefile_override" : false, + "first_rule_is_all" : true, + "found_all_rule" : true, + "found_clean_rule" : true, + "found_clobber_rule" : true, + "found_try_rule" : true, + "test_mode" : false, + "manifest" : [ + {"info_JSON" : ".info.json"}, + {"auth_JSON" : ".auth.json"}, + {"c_src" : "prog.c"}, + {"Makefile" : "Makefile"}, + {"remarks" : "remarks.md"}, + {"extra_file" : "inventory.html"} + ], + "formed_timestamp" : 1675547786, + "formed_timestamp_usec" : 13685, + "timestamp_epoch" : "Thu Jan 01 00:00:00 1970 UTC", + "min_timestamp" : 1675547786, + "formed_UTC" : "Sat Feb 04 21:56:26 2023 UTC" +} diff --git a/test_ioccc/test_JSON/info.json/bad/info.manifest-prog-alt.json b/test_ioccc/test_JSON/info.json/bad/info.manifest-prog-alt.json new file mode 100644 index 000000000..c9f91d420 --- /dev/null +++ b/test_ioccc/test_JSON/info.json/bad/info.manifest-prog-alt.json @@ -0,0 +1,47 @@ +{ + "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", + "IOCCC_info_version" : "1.14 2023-02-04", + "IOCCC_contest" : "IOCCCMOCK", + "IOCCC_year" : 2023, + "mkiocccentry_version" : "1.0.2 2023-11-06", + "iocccsize_version" : "28.13 2023-02-04", + "chkentry_version" : "1.0 2023-02-04", + "fnamchk_version" : "1.0 2023-02-04", + "txzchk_version" : "1.0.2 2023-11-06", + "IOCCC_contest_id" : "12345678-1234-4321-abcd-1234567890ab", + "entry_num" : 0, + "title" : "title-for-entry0", + "abstract" : "abstract for entry #0", + "tarball" : "entry.12345678-1234-4321-abcd-1234567890ab-0.1675547786.txz", + "rule_2a_size" : 0, + "rule_2b_size" : 0, + "empty_override" : true, + "rule_2a_override" : false, + "rule_2a_mismatch" : false, + "rule_2b_override" : false, + "highbit_warning" : false, + "nul_warning" : false, + "trigraph_warning" : false, + "wordbuf_warning" : false, + "ungetc_warning" : false, + "Makefile_override" : false, + "first_rule_is_all" : true, + "found_all_rule" : true, + "found_clean_rule" : true, + "found_clobber_rule" : true, + "found_try_rule" : true, + "test_mode" : false, + "manifest" : [ + {"info_JSON" : ".info.json"}, + {"auth_JSON" : ".auth.json"}, + {"c_src" : "prog.c"}, + {"Makefile" : "Makefile"}, + {"remarks" : "remarks.md"}, + {"extra_file" : "prog.alt"} + ], + "formed_timestamp" : 1675547786, + "formed_timestamp_usec" : 13685, + "timestamp_epoch" : "Thu Jan 01 00:00:00 1970 UTC", + "min_timestamp" : 1675547786, + "formed_UTC" : "Sat Feb 04 21:56:26 2023 UTC" +} diff --git a/test_ioccc/test_JSON/info.json/bad/info.manifest-prog-orig-c.json b/test_ioccc/test_JSON/info.json/bad/info.manifest-prog-orig-c.json new file mode 100644 index 000000000..10493b0aa --- /dev/null +++ b/test_ioccc/test_JSON/info.json/bad/info.manifest-prog-orig-c.json @@ -0,0 +1,48 @@ +{ + "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", + "IOCCC_info_version" : "1.14 2023-02-04", + "IOCCC_contest" : "IOCCCMOCK", + "IOCCC_year" : 2023, + "mkiocccentry_version" : "1.0.2 2023-11-06", + "iocccsize_version" : "28.13 2023-02-04", + "chkentry_version" : "1.0 2023-02-04", + "fnamchk_version" : "1.0 2023-02-04", + "txzchk_version" : "1.0.2 2023-11-06", + "IOCCC_contest_id" : "12345678-1234-4321-abcd-1234567890ab", + "entry_num" : 0, + "title" : "title-for-entry0", + "abstract" : "abstract for entry #0", + "tarball" : "entry.12345678-1234-4321-abcd-1234567890ab-0.1675547786.txz", + "rule_2a_size" : 0, + "rule_2b_size" : 0, + "empty_override" : true, + "rule_2a_override" : false, + "rule_2a_mismatch" : false, + "rule_2b_override" : false, + "highbit_warning" : false, + "nul_warning" : false, + "trigraph_warning" : false, + "wordbuf_warning" : false, + "ungetc_warning" : false, + "Makefile_override" : false, + "first_rule_is_all" : true, + "found_all_rule" : true, + "found_clean_rule" : true, + "found_clobber_rule" : true, + "found_try_rule" : true, + "test_mode" : false, + "manifest" : [ + {"info_JSON" : ".info.json"}, + {"auth_JSON" : ".auth.json"}, + {"c_src" : "prog.c"}, + {"Makefile" : "Makefile"}, + {"remarks" : "remarks.md"}, + {"extra_file" : "README.md"}, + {"extra_file" : "prog.orig.c"} + ], + "formed_timestamp" : 1675547786, + "formed_timestamp_usec" : 13685, + "timestamp_epoch" : "Thu Jan 01 00:00:00 1970 UTC", + "min_timestamp" : 1675547786, + "formed_UTC" : "Sat Feb 04 21:56:26 2023 UTC" +} diff --git a/test_ioccc/test_JSON/info.json/bad/info.manifest-prog-orig.json b/test_ioccc/test_JSON/info.json/bad/info.manifest-prog-orig.json new file mode 100644 index 000000000..7f2f9c0bc --- /dev/null +++ b/test_ioccc/test_JSON/info.json/bad/info.manifest-prog-orig.json @@ -0,0 +1,48 @@ +{ + "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", + "IOCCC_info_version" : "1.14 2023-02-04", + "IOCCC_contest" : "IOCCCMOCK", + "IOCCC_year" : 2023, + "mkiocccentry_version" : "1.0.2 2023-11-06", + "iocccsize_version" : "28.13 2023-02-04", + "chkentry_version" : "1.0 2023-02-04", + "fnamchk_version" : "1.0 2023-02-04", + "txzchk_version" : "1.0.2 2023-11-06", + "IOCCC_contest_id" : "12345678-1234-4321-abcd-1234567890ab", + "entry_num" : 0, + "title" : "title-for-entry0", + "abstract" : "abstract for entry #0", + "tarball" : "entry.12345678-1234-4321-abcd-1234567890ab-0.1675547786.txz", + "rule_2a_size" : 0, + "rule_2b_size" : 0, + "empty_override" : true, + "rule_2a_override" : false, + "rule_2a_mismatch" : false, + "rule_2b_override" : false, + "highbit_warning" : false, + "nul_warning" : false, + "trigraph_warning" : false, + "wordbuf_warning" : false, + "ungetc_warning" : false, + "Makefile_override" : false, + "first_rule_is_all" : true, + "found_all_rule" : true, + "found_clean_rule" : true, + "found_clobber_rule" : true, + "found_try_rule" : true, + "test_mode" : false, + "manifest" : [ + {"info_JSON" : ".info.json"}, + {"auth_JSON" : ".auth.json"}, + {"c_src" : "prog.c"}, + {"Makefile" : "Makefile"}, + {"remarks" : "remarks.md"}, + {"extra_file" : "README.md"}, + {"extra_file" : "prog.orig"} + ], + "formed_timestamp" : 1675547786, + "formed_timestamp_usec" : 13685, + "timestamp_epoch" : "Thu Jan 01 00:00:00 1970 UTC", + "min_timestamp" : 1675547786, + "formed_UTC" : "Sat Feb 04 21:56:26 2023 UTC" +} diff --git a/test_ioccc/test_JSON/info.json/bad/info.manifest-prog.json b/test_ioccc/test_JSON/info.json/bad/info.manifest-prog.json new file mode 100644 index 000000000..8aafce394 --- /dev/null +++ b/test_ioccc/test_JSON/info.json/bad/info.manifest-prog.json @@ -0,0 +1,47 @@ +{ + "no_comment" : "mandatory comment: because comments were removed from the original JSON spec", + "IOCCC_info_version" : "1.14 2023-02-04", + "IOCCC_contest" : "IOCCCMOCK", + "IOCCC_year" : 2023, + "mkiocccentry_version" : "1.0.2 2023-11-06", + "iocccsize_version" : "28.13 2023-02-04", + "chkentry_version" : "1.0 2023-02-04", + "fnamchk_version" : "1.0 2023-02-04", + "txzchk_version" : "1.0.2 2023-11-06", + "IOCCC_contest_id" : "12345678-1234-4321-abcd-1234567890ab", + "entry_num" : 0, + "title" : "title-for-entry0", + "abstract" : "abstract for entry #0", + "tarball" : "entry.12345678-1234-4321-abcd-1234567890ab-0.1675547786.txz", + "rule_2a_size" : 0, + "rule_2b_size" : 0, + "empty_override" : true, + "rule_2a_override" : false, + "rule_2a_mismatch" : false, + "rule_2b_override" : false, + "highbit_warning" : false, + "nul_warning" : false, + "trigraph_warning" : false, + "wordbuf_warning" : false, + "ungetc_warning" : false, + "Makefile_override" : false, + "first_rule_is_all" : true, + "found_all_rule" : true, + "found_clean_rule" : true, + "found_clobber_rule" : true, + "found_try_rule" : true, + "test_mode" : false, + "manifest" : [ + {"info_JSON" : ".info.json"}, + {"auth_JSON" : ".auth.json"}, + {"c_src" : "prog.c"}, + {"Makefile" : "Makefile"}, + {"remarks" : "remarks.md"}, + {"extra_file" : "prog"} + ], + "formed_timestamp" : 1675547786, + "formed_timestamp_usec" : 13685, + "timestamp_epoch" : "Thu Jan 01 00:00:00 1970 UTC", + "min_timestamp" : 1675547786, + "formed_UTC" : "Sat Feb 04 21:56:26 2023 UTC" +}