nasty filename rejected

If you've had any problems with Nexuiz, or would like to report bugs, post here.

Moderators: Nexuiz Moderators, Moderators

nasty filename rejected

Postby Nil » Thu Feb 08, 2007 7:01 pm

Hi,

7051 noticed today that in Delight's server log there are many occurences of
Code: Select all
^7FS_Open("data/maps/.mapcfg", "rb", false): nasty filename rejected
^7FS_Open("maps/.mapcfg", "rb", false): nasty filename rejected

I think this happens cos the condition in fs.c in the engine code, line 1559, applies:
Code: Select all
// all: forbid leading dot on any filename for any reason
       if (strstr(path, "/."))
               return 2; // attempt to go outside the game directory


It looks like these "/.mapcfg" names are coming from GotoNextMap im qcsrc/server/g_world.qc, line 1580ff:

Code: Select all
// cvar "nextmap" always gets priority
if(TryFile(strcat("maps/", cvar_string("nextmap"), ".mapcfg")))
{
   localcmd(strcat("exec \"maps/", cvar_string("nextmap"), ".mapcfg\"\n"));
   return;
}


(Source is from 2007-01-23)

Maybe "nextmap" should be tested for content before trying to exec the mapconfig?

The "filename rejected" message doesn't occur when I change map with chmap or when I set "nextmap" to anything before time limit or frag limit is reached.

Or are the "nast filename rejected" messages hints on some other problem?
Nil
Advanced member
 
Posts: 81
Joined: Wed Mar 01, 2006 5:10 pm

Postby cyan » Thu Feb 08, 2007 7:13 pm

why the fuck is it nasty o_O :roll:

esteel ur a nerd u figure it out :P
irc://irc.quakenet.org/#careland

- cYan & Lunas IRC channel :P
cyan
Alien
 
Posts: 159
Joined: Tue Feb 28, 2006 9:57 pm
Location: Aabybro, Denmark

Re: nasty filename rejected

Postby KadaverJack » Thu Feb 08, 2007 7:46 pm

Nil wrote:Or are the "nast filename rejected" messages hints on some other problem?

No, the messages are obviously caused by engine changes between 2.2.2 and 2.2.3...
Anyway, i added a check if nextmap is empty, which seemed redundant before and the error mesages are gone...

cyan wrote:why the fuck is it nasty o_O :roll:

The error message is there to prevent the use of ".." within filenames, which would allow to read/write files outside of the gamedir. It's a bit too strict, since it also forbids names like ".mapcfg", but it's fast and reliable.
Last edited by KadaverJack on Sun Mar 11, 2007 11:58 pm, edited 1 time in total.
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Re: nasty filename rejected

Postby Nil » Thu Feb 08, 2007 8:01 pm

KadaverJack wrote:No, the messages are obviously caused by engine changes between 2.2.2 and 2.2.3...
Anyway, i added a check if nextmap is empty, which seemed redundant before and the error mesages are gone...

Thanks!
Nil
Advanced member
 
Posts: 81
Joined: Wed Mar 01, 2006 5:10 pm

Postby ZyanKLee » Sun Mar 11, 2007 11:40 pm

ok, and for me: what does this mean? is it fixed in >=2.2.4 ?
ZyanKLee
Alien
 
Posts: 151
Joined: Sun Feb 18, 2007 8:58 pm
Location: Germany

Postby KadaverJack » Mon Mar 12, 2007 12:01 am

ZyanKLee wrote:ok, and for me: what does this mean? is it fixed in >=2.2.4 ?

yes
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby ZyanKLee » Mon Mar 12, 2007 3:45 pm

thx
ZyanKLee
Alien
 
Posts: 151
Joined: Sun Feb 18, 2007 8:58 pm
Location: Germany

Re: nasty filename rejected

Postby divVerent » Mon Mar 12, 2007 11:12 pm

I just wanted to add that one may safely ignore the messages in 2.2.3. The added check just prevents the warning from appearing - it never was a critical problem, that is, it never caused wrong or missing map changes.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby ZyanKLee » Tue Mar 13, 2007 10:23 am

yeah thats right ... but it causes annoying messages in the IRC-chan ;)
ZyanKLee
Alien
 
Posts: 151
Joined: Sun Feb 18, 2007 8:58 pm
Location: Germany


Return to Nexuiz - Support / Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron