[openjk] 06/09: Shared: Disallow intentionally writing to default configs.

Simon McVittie smcv at debian.org
Tue Mar 14 11:31:23 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository openjk.

commit 4654c461ec334c0c433fdd50b31f9d99d1752d04
Author: Ensiform <ensiform at gmail.com>
Date:   Mon Mar 13 22:50:10 2017 -0500

    Shared: Disallow intentionally writing to default configs.
---
 code/qcommon/common.cpp   | 6 ++++++
 codemp/qcommon/common.cpp | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/code/qcommon/common.cpp b/code/qcommon/common.cpp
index 135f6d7..d1ba92a 100644
--- a/code/qcommon/common.cpp
+++ b/code/qcommon/common.cpp
@@ -1246,6 +1246,12 @@ void Com_WriteConfig_f( void ) {
 		return;
 	}
 
+	if(!FS_FilenameCompare(filename, "mpdefault.cfg") || !FS_FilenameCompare(filename, "default.cfg"))
+	{
+		Com_Printf( S_COLOR_YELLOW "Com_WriteConfig_f: The filename \"%s\" is reserved! Please choose another name.\n", filename );
+		return;
+	}
+
 	Com_Printf( "Writing %s.\n", filename );
 	Com_WriteConfigToFile( filename );
 }
diff --git a/codemp/qcommon/common.cpp b/codemp/qcommon/common.cpp
index fb9f050..675e6b5 100644
--- a/codemp/qcommon/common.cpp
+++ b/codemp/qcommon/common.cpp
@@ -1364,6 +1364,12 @@ void Com_WriteConfig_f( void ) {
 		return;
 	}
 
+	if(!FS_FilenameCompare(filename, "mpdefault.cfg") || !FS_FilenameCompare(filename, "default.cfg"))
+	{
+		Com_Printf( S_COLOR_YELLOW "Com_WriteConfig_f: The filename \"%s\" is reserved! Please choose another name.\n", filename );
+		return;
+	}
+
 	Com_Printf( "Writing %s.\n", filename );
 	Com_WriteConfigToFile( filename );
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git



More information about the Pkg-games-commits mailing list