Permission-less saveconfig

This commit is contained in:
cypress 2024-07-06 11:05:04 -07:00 committed by peter0x44
parent 4b7a1e3fb0
commit ac12778fa5

View file

@ -4167,11 +4167,15 @@ static void Cmd_WriteConfig_f(void)
Q_snprintfz(fname, sizeof(fname), "%s", filename); Q_snprintfz(fname, sizeof(fname), "%s", filename);
COM_RequireExtension(fname, ".cfg", sizeof(fname)); COM_RequireExtension(fname, ".cfg", sizeof(fname));
// NZ:P Start -- Restricting saveconfig like this seems silly, but I imagine I'll eat those works eventually.
#if 0
if (Cmd_IsInsecure() && strncmp(fname, "data/", 5)) if (Cmd_IsInsecure() && strncmp(fname, "data/", 5))
{ {
Con_Printf ("%s %s: not allowed\n", Cmd_Argv(0), Cmd_Args()); Con_Printf ("%s %s: not allowed\n", Cmd_Argv(0), Cmd_Args());
return; return;
} }
#endif
// NZ:P End
FS_DisplayPath(fname, FS_BASEGAMEONLY, displayname, sizeof(displayname)); FS_DisplayPath(fname, FS_BASEGAMEONLY, displayname, sizeof(displayname));
FS_CreatePath(fname, FS_BASEGAMEONLY); FS_CreatePath(fname, FS_BASEGAMEONLY);