Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id A811D9F9717 for ; Sun, 2 Sep 2007 20:51:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 01122-01 for ; Sun, 2 Sep 2007 20:51:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id CC4EF9F9684 for ; Sun, 2 Sep 2007 20:51:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l82Npoop019258; Sun, 2 Sep 2007 19:51:50 -0400 (EDT) To: Gregory Stark cc: "Oleg Bartunov" , "Pavel Stehule" , "PostgreSQL Hackers" Subject: Re: tsearch filenames unlikes special symbols and numbers In-reply-to: <87y7foir7t.fsf@oxford.xeocode.com> References: <162867790709021328i7771aa9jfe79268bccbf123d@mail.gmail.com> <18259.1188773171@sss.pgh.pa.us> <87y7foir7t.fsf@oxford.xeocode.com> Comments: In-reply-to Gregory Stark message dated "Mon, 03 Sep 2007 00:26:46 +0100" Date: Sun, 02 Sep 2007 19:51:50 -0400 Message-ID: <19257.1188777110@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/61 X-Sequence-Number: 107213 Gregory Stark writes: > "Tom Lane" writes: >> I made it reject all but latin letters, which is the same restriction >> that's in place for timezone set filenames. That might be overly >> strong, but we definitely have to forbid "." and "/" (and "\" on >> Windows). Do we want to restrict it to letters, digits, underscore? >> Or does it need to be weaker than that? > What's the problem with "."? ../../../../etc/passwd Possibly we could allow '.' as long as we forbade /, but the other trouble with allowing . is that it encourages people to try to specify the filetype suffix (as indeed Oleg was doing). I'd prefer to keep the suffixes out of the SQL object definitions, with an eye to possibly someday migrating all the configuration data inside the database. There's a reasonable argument for restricting the names used for these things in the SQL definitions to be valid SQL identifiers, so that that will work nicely... regards, tom lane