diff options
author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-07-05 23:50:38 +0000 |
---|---|---|
committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-07-05 23:50:38 +0000 |
commit | 37d631212417d0e40f71fcad2c2a1df907165aa0 (patch) | |
tree | 294e302c0f6878125981ddd569608339548fc63b /code/qcommon | |
parent | 30a59a88ffc64710e1974fb3c93461a6f40a10e7 (diff) | |
download | ioquake3-aero-37d631212417d0e40f71fcad2c2a1df907165aa0.tar.gz ioquake3-aero-37d631212417d0e40f71fcad2c2a1df907165aa0.zip |
* (bug 3610) Server sending unnecessary newline with SV_ConSay_F (Tyler Schwend
<TylerSchwend@gmail.com>)
* (bug 3623) COMMAND is mapped to the ALT key (Matthias <Kapffer@macbay.de>)
* (bug 3665) Typo error in FS_FOpenFileByMode function (TsT <tst2006@gmail.com>)
* (bug 3669) Some files left out of Solaris Packages (Vincent Cojot
<vincent@cojot.name>)
* (bug 3680) server quit messages (Ben Millwood)
* (bug 3682) Maps with >1024 models cause a segfault (misantropia
<bnoordhuis@gmail.com>)
* (bug 3683) R_FindShader(): negative lightmap indexes cause stray pointers
(misantropia <bnoordhuis@gmail.com>)
* (bug 3688) q3asm potential segfault fix and other changes (TsT
<tst2006@gmail.com>)
* (bug 3695) Not allowing to write file with lib extention (.dll/.so/...) (TsT
<tst2006@gmail.com>)
* (bug 3696) make-macosx-ub.sh outdated by revision 1340; test for Tiger not
working (Matthias <Kapffer@macbay.de>)
* (bug 3698) #error reported as warning in q3cpp (and no #warning support)
(Ben Millwood)
* (bug 3703) restoring the valued pre-SDL window behaviour (/dev/humancontroller
<devhc97@gmail.com>)
git-svn-id: svn://svn.icculus.org/quake3/trunk@1405 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon')
-rw-r--r-- | code/qcommon/common.c | 3 | ||||
-rw-r--r-- | code/qcommon/files.c | 36 |
2 files changed, 37 insertions, 2 deletions
diff --git a/code/qcommon/common.c b/code/qcommon/common.c index 9dc4b17..d4cab1e 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -331,8 +331,9 @@ do the apropriate things. */ void Com_Quit_f( void ) { // don't try to shutdown if we are in a recursive error + char *p = Cmd_Args( ); if ( !com_errorEntered ) { - SV_Shutdown ("Server quit"); + SV_Shutdown (p[0] ? p : "Server quit"); CL_Shutdown (); Com_Shutdown (); FS_Shutdown(qtrue); diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 64fe8d5..821de07 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -496,6 +496,24 @@ static qboolean FS_CreatePath (char *OSPath) { /* ================= +FS_FilenameIsExecutable + +ERR_FATAL if trying to maniuplate a file with the platform library extension +================= + */ +static void FS_FilenameIsExecutable( const char *filename, const char *function ) +{ + // Check if the filename ends with the library extension + if( !Q_stricmp( filename + strlen( filename ) - strlen( DLL_EXT ), DLL_EXT ) ) + { + Com_Error( ERR_FATAL, "%s: Not allowed to write '%s' due to %s extension\n", + function, filename, DLL_EXT ); + } +} + + +/* +================= FS_CopyFile Copy a fully specified file from one place to another @@ -508,6 +526,8 @@ static void FS_CopyFile( char *fromOSPath, char *toOSPath ) { Com_Printf( "copy %s to %s\n", fromOSPath, toOSPath ); + FS_FilenameIsExecutable( toOSPath, __FUNCTION__ ); + if (strstr(fromOSPath, "journal.dat") || strstr(fromOSPath, "journaldata.dat")) { Com_Printf( "Ignoring journal files\n"); return; @@ -549,6 +569,8 @@ FS_Remove =========== */ void FS_Remove( const char *osPath ) { + FS_FilenameIsExecutable( osPath, __FUNCTION__ ); + remove( osPath ); } @@ -559,6 +581,8 @@ FS_HomeRemove =========== */ void FS_HomeRemove( const char *homePath ) { + FS_FilenameIsExecutable( homePath, __FUNCTION__ ); + remove( FS_BuildOSPath( fs_homepath->string, fs_gamedir, homePath ) ); } @@ -636,6 +660,8 @@ fileHandle_t FS_SV_FOpenFileWrite( const char *filename ) { Com_Printf( "FS_SV_FOpenFileWrite: %s\n", ospath ); } + FS_FilenameIsExecutable( ospath, __FUNCTION__ ); + if( FS_CreatePath( ospath ) ) { return 0; } @@ -745,6 +771,8 @@ void FS_SV_Rename( const char *from, const char *to ) { Com_Printf( "FS_SV_Rename: %s --> %s\n", from_ospath, to_ospath ); } + FS_FilenameIsExecutable( to_ospath, __FUNCTION__ ); + if (rename( from_ospath, to_ospath )) { // Failed, try copying it and deleting the original FS_CopyFile ( from_ospath, to_ospath ); @@ -777,6 +805,8 @@ void FS_Rename( const char *from, const char *to ) { Com_Printf( "FS_Rename: %s --> %s\n", from_ospath, to_ospath ); } + FS_FilenameIsExecutable( to_ospath, __FUNCTION__ ); + if (rename( from_ospath, to_ospath )) { // Failed, try copying it and deleting the original FS_CopyFile ( from_ospath, to_ospath ); @@ -838,6 +868,8 @@ fileHandle_t FS_FOpenFileWrite( const char *filename ) { Com_Printf( "FS_FOpenFileWrite: %s\n", ospath ); } + FS_FilenameIsExecutable( ospath, __FUNCTION__ ); + if( FS_CreatePath( ospath ) ) { return 0; } @@ -884,6 +916,8 @@ fileHandle_t FS_FOpenFileAppend( const char *filename ) { Com_Printf( "FS_FOpenFileAppend: %s\n", ospath ); } + FS_FilenameIsExecutable( ospath, __FUNCTION__ ); + if( FS_CreatePath( ospath ) ) { return 0; } @@ -3397,7 +3431,7 @@ int FS_FOpenFileByMode( const char *qpath, fileHandle_t *f, fsMode_t mode ) { } break; default: - Com_Error( ERR_FATAL, "FSH_FOpenFile: bad mode" ); + Com_Error( ERR_FATAL, "FS_FOpenFileByMode: bad mode" ); return -1; } |