mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 16:30:43 +00:00
work towards a more secure qfs
This commit is contained in:
parent
68d2167c9e
commit
851d203916
19 changed files with 193 additions and 167 deletions
|
@ -539,23 +539,22 @@ CL_Record (const char *argv1)
|
|||
if (mapname[k] == '.')
|
||||
mapname[k] = '\0';
|
||||
|
||||
snprintf (name, sizeof (name), "%s/%s-%s", qfs_gamedir_path,
|
||||
snprintf (name, sizeof (name), "%s/%s-%s", qfs_gamedir->dir.def,
|
||||
timestring, mapname);
|
||||
} else {
|
||||
snprintf (name, sizeof (name), "%s/%s", qfs_gamedir_path, argv1);
|
||||
snprintf (name, sizeof (name), "%s/%s", qfs_gamedir->dir.def, argv1);
|
||||
}
|
||||
|
||||
// open the demo file
|
||||
#ifdef HAVE_ZLIB
|
||||
if (demo_gzip->int_val) {
|
||||
QFS_DefaultExtension (name, ".qwd.gz");
|
||||
cls.demofile = Qopen (name, va ("wbz%d",
|
||||
bound (1, demo_gzip->int_val, 9)));
|
||||
cls.demofile = QFS_WOpen (name, demo_gzip->int_val);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
QFS_DefaultExtension (name, ".qwd");
|
||||
cls.demofile = Qopen (name, "wb");
|
||||
cls.demofile = QFS_WOpen (name, 0);
|
||||
}
|
||||
if (!cls.demofile) {
|
||||
Con_Printf ("ERROR: couldn't open.\n");
|
||||
|
@ -577,7 +576,7 @@ CL_Record (const char *argv1)
|
|||
MSG_WriteByte (&buf, svc_serverdata);
|
||||
MSG_WriteLong (&buf, PROTOCOL_VERSION);
|
||||
MSG_WriteLong (&buf, cl.servercount);
|
||||
MSG_WriteString (&buf, qfs_gamedir_file);
|
||||
MSG_WriteString (&buf, qfs_gamedir->gamedir);
|
||||
|
||||
if (cl.spectator)
|
||||
MSG_WriteByte (&buf, cl.playernum | 128);
|
||||
|
@ -844,12 +843,12 @@ CL_ReRecord_f (void)
|
|||
if (cls.demorecording)
|
||||
CL_Stop_f ();
|
||||
|
||||
snprintf (name, sizeof (name), "%s/%s", qfs_gamedir_path, Cmd_Argv (1));
|
||||
snprintf (name, sizeof (name), "%s/%s", qfs_gamedir->dir.def, Cmd_Argv (1));
|
||||
|
||||
// open the demo file
|
||||
QFS_DefaultExtension (name, ".qwd");
|
||||
|
||||
cls.demofile = Qopen (name, "wb");
|
||||
cls.demofile = QFS_WOpen (name, 0);
|
||||
if (!cls.demofile) {
|
||||
Con_Printf ("ERROR: couldn't open.\n");
|
||||
return;
|
||||
|
|
|
@ -1072,13 +1072,11 @@ CL_Download_f (void)
|
|||
}
|
||||
|
||||
snprintf (cls.downloadname, sizeof (cls.downloadname), "%s/%s",
|
||||
qfs_gamedir_path, Cmd_Argv (1));
|
||||
|
||||
QFS_CreatePath (cls.downloadname);
|
||||
qfs_gamedir->dir.def, Cmd_Argv (1));
|
||||
|
||||
strncpy (cls.downloadtempname, cls.downloadname,
|
||||
sizeof (cls.downloadtempname));
|
||||
cls.download = Qopen (cls.downloadname, "wb");
|
||||
cls.download = QFS_WOpen (cls.downloadname, 0);
|
||||
if (cls.download) {
|
||||
cls.downloadtype = dl_single;
|
||||
|
||||
|
@ -1413,10 +1411,9 @@ Host_WriteConfiguration (void)
|
|||
QFile *f;
|
||||
|
||||
if (host_initialized && cl_writecfg->int_val) {
|
||||
char *path = va ("%s/config.cfg", qfs_gamedir_path);
|
||||
char *path = va ("%s/config.cfg", qfs_gamedir->dir.def);
|
||||
|
||||
QFS_CreatePath (path);
|
||||
f = Qopen (path, "w");
|
||||
f = QFS_WOpen (path, 0);
|
||||
if (!f) {
|
||||
Con_Printf ("Couldn't write config.cfg.\n");
|
||||
return;
|
||||
|
|
|
@ -324,7 +324,7 @@ Model_NextDownload (void)
|
|||
"downloaded.\n\n", cl.model_name[i]);
|
||||
Con_Printf ("You may need to download or purchase a %s client "
|
||||
"pack in order to play on this server.\n\n",
|
||||
qfs_gamedir_file);
|
||||
qfs_gamedir->gamedir);
|
||||
CL_Disconnect ();
|
||||
return;
|
||||
}
|
||||
|
@ -489,18 +489,14 @@ CL_ParseDownload (void)
|
|||
}
|
||||
// open the file if not opened yet
|
||||
if (!cls.download) {
|
||||
if (!qfs_gamedir->skinpath
|
||||
|| !*qfs_gamedir->skinpath
|
||||
|| strncmp (cls.downloadtempname, "skins/", 6))
|
||||
snprintf (name, sizeof (name), "%s/%s", qfs_gamedir_path,
|
||||
if (strncmp (cls.downloadtempname, "skins/", 6))
|
||||
snprintf (name, sizeof (name), "%s/%s", qfs_gamedir->dir.def,
|
||||
cls.downloadtempname);
|
||||
else
|
||||
snprintf (name, sizeof (name), "%s/%s/%s", fs_userpath->string,
|
||||
qfs_gamedir->skinpath, cls.downloadtempname);
|
||||
snprintf (name, sizeof (name), "%s/%s", qfs_gamedir->dir.skins,
|
||||
cls.downloadtempname + 6);
|
||||
|
||||
QFS_CreatePath (name);
|
||||
|
||||
cls.download = Qopen (name, "wb");
|
||||
cls.download = QFS_WOpen (name, 0);
|
||||
if (!cls.download) {
|
||||
cls.downloadname[0] = 0;
|
||||
net_message->readcount += size;
|
||||
|
@ -532,20 +528,18 @@ CL_ParseDownload (void)
|
|||
|
||||
// rename the temp file to it's final name
|
||||
if (strcmp (cls.downloadtempname, cls.downloadname)) {
|
||||
if (!qfs_gamedir->skinpath
|
||||
|| !*qfs_gamedir->skinpath
|
||||
|| strncmp (cls.downloadtempname, "skins/", 6)) {
|
||||
snprintf (oldn, sizeof (oldn), "%s/%s", qfs_gamedir_path,
|
||||
if (strncmp (cls.downloadtempname, "skins/", 6)) {
|
||||
snprintf (oldn, sizeof (oldn), "%s/%s", qfs_gamedir->dir.def,
|
||||
cls.downloadtempname);
|
||||
snprintf (newn, sizeof (newn), "%s/%s", qfs_gamedir_path,
|
||||
snprintf (newn, sizeof (newn), "%s/%s", qfs_gamedir->dir.def,
|
||||
cls.downloadname);
|
||||
} else {
|
||||
snprintf (oldn, sizeof (oldn), "%s/%s/%s", fs_userpath->string,
|
||||
qfs_gamedir->skinpath, cls.downloadtempname);
|
||||
snprintf (newn, sizeof (newn), "%s/%s/%s", fs_userpath->string,
|
||||
qfs_gamedir->skinpath, cls.downloadname);
|
||||
snprintf (oldn, sizeof (oldn), "%s/%s", qfs_gamedir->dir.skins,
|
||||
cls.downloadtempname + 6);
|
||||
snprintf (newn, sizeof (newn), "%s/%s", qfs_gamedir->dir.skins,
|
||||
cls.downloadname + 6);
|
||||
}
|
||||
r = Qrename (oldn, newn);
|
||||
r = QFS_Rename (oldn, newn);
|
||||
if (r)
|
||||
Con_Printf ("failed to rename, %s.\n", strerror (errno));
|
||||
}
|
||||
|
@ -679,7 +673,7 @@ CL_ParseServerData (void)
|
|||
// game directory
|
||||
str = MSG_ReadString (net_message);
|
||||
|
||||
if (!strequal (qfs_gamedir_file, str)) {
|
||||
if (!strequal (qfs_gamedir->gamedir, str)) {
|
||||
// save current config
|
||||
Host_WriteConfiguration ();
|
||||
cflag = true;
|
||||
|
|
|
@ -46,9 +46,11 @@ static __attribute__ ((unused)) const char rcsid[] =
|
|||
#include <sys/stat.h>
|
||||
|
||||
#include "QF/console.h"
|
||||
#include "QF/dstring.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/quakefs.h"
|
||||
#include "QF/va.h"
|
||||
#include "QF/zone.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
@ -136,30 +138,22 @@ CF_GetFileSize (const char *path)
|
|||
static void
|
||||
CF_BuildQuota (void)
|
||||
{
|
||||
char *file, *path;
|
||||
static dstring_t *path;
|
||||
struct dirent *i;
|
||||
DIR *dir;
|
||||
|
||||
path = Hunk_TempAlloc (strlen (qfs_gamedir_path) + 1 + strlen (CF_DIR) + 256 +
|
||||
1);
|
||||
if (!path)
|
||||
return;
|
||||
path = dstring_new ();
|
||||
dsprintf (path, "%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, CF_DIR);
|
||||
|
||||
strcpy(path, qfs_gamedir_path);
|
||||
strcpy(path + strlen(path), "/");
|
||||
strcpy(path + strlen(path), CF_DIR);
|
||||
|
||||
dir = opendir (path);
|
||||
dir = opendir (path->str);
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
file = path + strlen(path);
|
||||
|
||||
cf_cursize = 0;
|
||||
|
||||
while ((i = readdir(dir))) {
|
||||
strcpy (file, i->d_name);
|
||||
cf_cursize += CF_GetFileSize (path);
|
||||
cf_cursize += CF_GetFileSize (va ("%s/%s", path->str, i->d_name));
|
||||
}
|
||||
closedir (dir);
|
||||
}
|
||||
|
@ -207,7 +201,8 @@ CF_CloseAllFiles ()
|
|||
int
|
||||
CF_Open (const char *path, const char *mode)
|
||||
{
|
||||
char *fullpath, *j;
|
||||
char *j;
|
||||
dstring_t *fullpath = dstring_new ();
|
||||
int desc, oldsize, i;
|
||||
QFile *file;
|
||||
|
||||
|
@ -232,31 +227,25 @@ CF_Open (const char *path, const char *mode)
|
|||
return -1;
|
||||
}
|
||||
|
||||
fullpath = malloc(strlen(qfs_gamedir_path) + 1 + strlen(CF_DIR)
|
||||
+ strlen(path) + 1);
|
||||
if (!fullpath) {
|
||||
return -1;
|
||||
}
|
||||
dsprintf (fullpath, "%s/%s/%s/%s", fs_userpath->string,
|
||||
qfs_gamedir->dir.def, CF_DIR, path);
|
||||
|
||||
strcpy(fullpath, qfs_gamedir_path);
|
||||
strcpy(fullpath + strlen(fullpath), "/");
|
||||
strcpy(fullpath + strlen(fullpath), CF_DIR);
|
||||
j = fullpath + strlen(fullpath);
|
||||
j = fullpath->str + strlen(fullpath->str) - strlen (path);
|
||||
for (i = 0; path[i]; i++, j++) // strcpy, but force lowercase
|
||||
*j = tolower(path[i]);
|
||||
*j = '\0';
|
||||
|
||||
if (CF_AlreadyOpen(fullpath, mode[0])) {
|
||||
free (fullpath);
|
||||
if (CF_AlreadyOpen(fullpath->str, mode[0])) {
|
||||
dstring_delete (fullpath);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mode[0] == 'w')
|
||||
oldsize = CF_GetFileSize (fullpath);
|
||||
oldsize = CF_GetFileSize (fullpath->str);
|
||||
else
|
||||
oldsize = 0;
|
||||
|
||||
file = Qopen (fullpath, mode);
|
||||
file = Qopen (fullpath->str, mode);
|
||||
if (file) {
|
||||
if (cf_openfiles >= cf_filepcount) {
|
||||
cf_filepcount++;
|
||||
|
@ -269,7 +258,7 @@ CF_Open (const char *path, const char *mode)
|
|||
|
||||
for (desc = 0; cf_filep[desc].file; desc++)
|
||||
;
|
||||
cf_filep[desc].path = fullpath;
|
||||
cf_filep[desc].path = fullpath->str;
|
||||
cf_filep[desc].file = file;
|
||||
cf_filep[desc].buf = 0;
|
||||
cf_filep[desc].size = 0;
|
||||
|
|
|
@ -59,7 +59,7 @@ SV_Gamedir_f (void)
|
|||
const char *dir;
|
||||
|
||||
if (Cmd_Argc () == 1) {
|
||||
Con_Printf ("Current gamedir: %s\n", qfs_gamedir_file);
|
||||
Con_Printf ("Current gamedir: %s\n", qfs_gamedir->gamedir);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -200,7 +200,6 @@ static void
|
|||
SV_Fraglogfile_f (void)
|
||||
{
|
||||
char name[MAX_OSPATH];
|
||||
int i;
|
||||
|
||||
if (sv_fraglogfile) {
|
||||
SV_Printf ("Frag file logging off.\n");
|
||||
|
@ -208,19 +207,7 @@ SV_Fraglogfile_f (void)
|
|||
sv_fraglogfile = NULL;
|
||||
return;
|
||||
}
|
||||
// find an unused name
|
||||
for (i = 0; i < 1000; i++) {
|
||||
snprintf (name, sizeof (name), "%s/frag_%i.log", qfs_gamedir_path, i);
|
||||
sv_fraglogfile = Qopen (name, "r");
|
||||
if (!sv_fraglogfile) { // can't read it, so create this one
|
||||
sv_fraglogfile = Qopen (name, "w");
|
||||
if (!sv_fraglogfile)
|
||||
i = 1000; // give error
|
||||
break;
|
||||
}
|
||||
Qclose (sv_fraglogfile);
|
||||
}
|
||||
if (i == 1000) {
|
||||
if (!QFS_NextFilename (name, "frag_", ".log")) {
|
||||
SV_Printf ("Can't open any logfiles.\n");
|
||||
sv_fraglogfile = NULL;
|
||||
return;
|
||||
|
@ -1070,14 +1057,15 @@ SV_Snap (int uid)
|
|||
|
||||
snprintf (pcxname, sizeof (pcxname), "%d-00.pcx", uid);
|
||||
|
||||
snprintf (checkname, sizeof (checkname), "%s/snap", qfs_gamedir_path);
|
||||
snprintf (checkname, sizeof (checkname), "%s/%s/snap", fs_userpath->string,
|
||||
qfs_gamedir->dir.def);
|
||||
QFS_CreatePath (va ("%s/dummy", checkname));
|
||||
|
||||
for (i = 0; i <= 99; i++) {
|
||||
pcxname[strlen (pcxname) - 6] = i / 10 + '0';
|
||||
pcxname[strlen (pcxname) - 5] = i % 10 + '0';
|
||||
snprintf (checkname, sizeof (checkname), "%s/snap/%s",
|
||||
qfs_gamedir_path, pcxname);
|
||||
snprintf (checkname, sizeof (checkname), "%s/%s/snap/%s",
|
||||
fs_userpath->string, qfs_gamedir->dir.def, pcxname);
|
||||
if (Sys_FileTime (checkname) == -1)
|
||||
break; // file doesn't exist
|
||||
}
|
||||
|
|
|
@ -593,7 +593,7 @@ SV_Stop (int reason)
|
|||
if (demo.disk)
|
||||
Qclose (demo.file);
|
||||
|
||||
sprintf (path, "%s/%s/%s", qfs_gamedir_path, demo.path->str, demo.name->str);
|
||||
sprintf (path, "%s/%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, demo.path->str, demo.name->str);
|
||||
unlink (path);
|
||||
|
||||
strcpy (path + strlen (path) - 3, "txt");
|
||||
|
@ -1102,7 +1102,7 @@ SV_Record_f (void)
|
|||
if (sv.demorecording)
|
||||
SV_Stop_f ();
|
||||
|
||||
dsprintf (name, "%s/%s/%s%s%s", qfs_gamedir_path, sv_demoDir->string,
|
||||
dsprintf (name, "%s/%s/%s/%s%s%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string,
|
||||
sv_demoPrefix->string, SV_CleanName (Cmd_Argv (1)),
|
||||
sv_demoSuffix->string);
|
||||
|
||||
|
@ -1223,7 +1223,7 @@ SV_EasyRecord_f (void)
|
|||
}
|
||||
|
||||
// Make sure the filename doesn't contain illegal characters
|
||||
dsprintf (name2, "%s/%s/%s%s%s", qfs_gamedir_path, sv_demoDir->string,
|
||||
dsprintf (name2, "%s/%s/%s/%s%s%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string,
|
||||
sv_demoPrefix->string, SV_CleanName (name->str),
|
||||
sv_demoSuffix->string);
|
||||
QFS_CreatePath (name2->str);
|
||||
|
@ -1266,8 +1266,8 @@ SV_DemoList_f (void)
|
|||
dir_t dir;
|
||||
file_t *list;
|
||||
|
||||
Con_Printf ("content of %s/%s/ *.mvd\n", qfs_gamedir_path, sv_demoDir->string);
|
||||
dir = Sys_listdir (va ("%s/%s", qfs_gamedir_path, sv_demoDir->string), ".mvd");
|
||||
Con_Printf ("content of %s/%s/%s/ *.mvd\n", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string);
|
||||
dir = Sys_listdir (va ("%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string), ".mvd");
|
||||
list = dir.files;
|
||||
if (!list->name[0]) {
|
||||
Con_Printf ("no demos\n");
|
||||
|
@ -1307,7 +1307,7 @@ SV_DemoNum (int num)
|
|||
file_t *list;
|
||||
dir_t dir;
|
||||
|
||||
dir = Sys_listdir (va ("%s/%s", qfs_gamedir_path, sv_demoDir->string), ".mvd");
|
||||
dir = Sys_listdir (va ("%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string), ".mvd");
|
||||
list = dir.files;
|
||||
|
||||
if (num <= 0)
|
||||
|
@ -1376,7 +1376,7 @@ SV_DemoRemove_f (void)
|
|||
ptr++;
|
||||
|
||||
dir =
|
||||
Sys_listdir (va ("%s/%s", qfs_gamedir_path, sv_demoDir->string), ".mvd");
|
||||
Sys_listdir (va ("%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string), ".mvd");
|
||||
list = dir.files;
|
||||
for (i = 0; list->name[0]; list++) {
|
||||
if (strstr (list->name, ptr)) {
|
||||
|
@ -1384,7 +1384,7 @@ SV_DemoRemove_f (void)
|
|||
SV_Stop_f ();
|
||||
|
||||
// stop recording first;
|
||||
sprintf (path, "%s/%s/%s", qfs_gamedir_path, sv_demoDir->string,
|
||||
sprintf (path, "%s/%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string,
|
||||
list->name);
|
||||
if (!unlink (path)) {
|
||||
Con_Printf ("removing %s...\n", list->name);
|
||||
|
@ -1407,7 +1407,7 @@ SV_DemoRemove_f (void)
|
|||
dsprintf (name, "%s", Cmd_Argv (1));
|
||||
QFS_DefaultExtension (name->str, ".mvd");
|
||||
|
||||
sprintf (path, "%s/%s/%s", qfs_gamedir_path, sv_demoDir->string, name->str);
|
||||
sprintf (path, "%s/%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string, name->str);
|
||||
|
||||
if (sv.demorecording && !strcmp (name->str, demo.name->str))
|
||||
SV_Stop_f ();
|
||||
|
@ -1459,7 +1459,7 @@ SV_DemoRemoveNum_f (void)
|
|||
if (sv.demorecording && !strcmp (name, demo.name->str))
|
||||
SV_Stop_f ();
|
||||
|
||||
sprintf (path, "%s/%s/%s", qfs_gamedir_path, sv_demoDir->string, name);
|
||||
sprintf (path, "%s/%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string, name);
|
||||
if (!unlink (path)) {
|
||||
Con_Printf ("demo %s succesfully removed\n", name);
|
||||
/*
|
||||
|
@ -1504,7 +1504,7 @@ SV_DemoInfoAdd_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
sprintf (path, "%s/%s/%s", qfs_gamedir_path, demo.path->str,
|
||||
sprintf (path, "%s/%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, demo.path->str,
|
||||
SV_DemoName2Txt (demo.name->str));
|
||||
} else {
|
||||
name = SV_DemoTxTNum (atoi (Cmd_Argv (1)));
|
||||
|
@ -1514,7 +1514,7 @@ SV_DemoInfoAdd_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
sprintf (path, "%s/%s/%s", qfs_gamedir_path, sv_demoDir->string, name);
|
||||
sprintf (path, "%s/%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string, name);
|
||||
}
|
||||
|
||||
if ((f = Qopen (path, "a+t")) == NULL) {
|
||||
|
@ -1551,7 +1551,7 @@ SV_DemoInfoRemove_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
sprintf (path, "%s/%s/%s", qfs_gamedir_path, demo.path->str,
|
||||
sprintf (path, "%s/%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, demo.path->str,
|
||||
SV_DemoName2Txt (demo.name->str));
|
||||
} else {
|
||||
name = SV_DemoTxTNum (atoi (Cmd_Argv (1)));
|
||||
|
@ -1561,7 +1561,7 @@ SV_DemoInfoRemove_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
sprintf (path, "%s/%s/%s", qfs_gamedir_path, sv_demoDir->string, name);
|
||||
sprintf (path, "%s/%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string, name);
|
||||
}
|
||||
|
||||
if (unlink (path))
|
||||
|
@ -1589,7 +1589,7 @@ SV_DemoInfo_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
sprintf (path, "%s/%s/%s", qfs_gamedir_path, demo.path->str,
|
||||
sprintf (path, "%s/%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, demo.path->str,
|
||||
SV_DemoName2Txt (demo.name->str));
|
||||
} else {
|
||||
name = SV_DemoTxTNum (atoi (Cmd_Argv (1)));
|
||||
|
@ -1599,7 +1599,7 @@ SV_DemoInfo_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
sprintf (path, "%s/%s/%s", qfs_gamedir_path, sv_demoDir->string, name);
|
||||
sprintf (path, "%s/%s/%s/%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string, name);
|
||||
}
|
||||
|
||||
if ((f = Qopen (path, "rt")) == NULL) {
|
||||
|
|
|
@ -1536,7 +1536,8 @@ SV_WriteIP_f (void)
|
|||
QFile *f;
|
||||
const char *type;
|
||||
|
||||
snprintf (name, sizeof (name), "%s/listip.cfg", qfs_gamedir_path);
|
||||
snprintf (name, sizeof (name), "%s/%s/listip.cfg", fs_userpath->string,
|
||||
qfs_gamedir->dir.def);
|
||||
|
||||
SV_Printf ("Writing IP Filters to %s.\n", name);
|
||||
|
||||
|
|
|
@ -353,7 +353,8 @@ locs_loc (void)
|
|||
if (!mapname)
|
||||
Sys_Error ("Can't duplicate mapname!");
|
||||
map_to_loc (cl.worldmodel->name,mapname);
|
||||
snprintf (locfile, sizeof (locfile), "%s/%s", qfs_gamedir_path, mapname);
|
||||
snprintf (locfile, sizeof (locfile), "%s/%s/%s", fs_userpath->string,
|
||||
qfs_gamedir->dir.def, mapname);
|
||||
free(mapname);
|
||||
|
||||
if (strcasecmp (Cmd_Argv(1),"save") == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue