]> git.pond.sub.org Git - empserver/commitdiff
Restrict xundump to tables with a file name
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 May 2011 20:20:58 +0000 (22:20 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Jun 2011 14:47:57 +0000 (16:47 +0200)
Tables with a file name are: any game state, and any table that's
initialized from a .config file.

Tables that are no longer customizable: "updates" (customization had
no effect, because update_get_schedule() overwrote it), "table",
"meta" and the symbol tables (customization couldn't change them
anyway), and news-chr (customizing r_newsstory[] was kind of neat, but
unsafe because they are format strings for sprintf()).

src/lib/common/xundump.c

index fbf1b9c2e2406c1c35c431ef676a433500ebd5d5..5d8190801272bad494fc2e84669b6b12d2ffac13 100644 (file)
@@ -784,7 +784,8 @@ xuheader(FILE *fp, int expected_table)
        return gripe("Expected table `%s', not `%s'",
                     ef_nameof(expected_table), name);
 
-    if (!ef_cadef(type) || !(ef_flags(type) & EFF_MEM)) {
+    if (!empfile[type].file
+       || !ef_cadef(type) || !(ef_flags(type) & EFF_MEM)) {
        CANT_HAPPEN(expected_table != EF_BAD);
        return gripe("Table `%s' is not permitted here", name);
     }