]> git.pond.sub.org Git - empserver/commitdiff
(EF_IS_VIEW): New.
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 13 Aug 2006 07:29:30 +0000 (07:29 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 13 Aug 2006 07:29:30 +0000 (07:29 +0000)
(xdump): Use it to deny access to views when denying access to game
state.  Fixes the previous revision.

include/file.h
src/lib/commands/xdump.c

index 2e7c0cbb33073e6acc9622bdb1cafe12ba8c1799..71c5e1c10b7368ea7aca69a16d0cdc04efa0c148 100644 (file)
@@ -158,6 +158,7 @@ enum {
 };
 
 #define EF_IS_GAME_STATE(type) (EF_SECTOR <= (type) && (type) <= EF_REALM)
+#define EF_IS_VIEW(type) (EF_COUNTRY <= (type) && (type) < EF_MAX)
 
 extern struct castr *ef_cadef(int);
 extern int ef_read(int, int, void *);
index 9122eae6a02e86488033ad0f307df04d9ed082c0..f09fcb03d31263993d1b12655c4fd8dcbc123d2a 100644 (file)
@@ -405,7 +405,7 @@ xdump(void)
     if (type >= 0 && type < EF_MAX) {
        if (meta)
            return xdmeta(type);
-       else if (EF_IS_GAME_STATE(type)
+       else if ((EF_IS_GAME_STATE(type) || EF_IS_VIEW(type))
                 && (player->ncomstat & NORM) != NORM) {
            pr("Access to table %s denied\n", ef_nameof(type));
            return RET_FAIL;