From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bruce Barnett Newsgroups: gmane.emacs.help Subject: Re: NON-trivial regular expression problem (could not find on google) Date: 24 Jan 2003 11:20:11 GMT Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <7606630f.0301181219.60384da2@posting.google.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1043407597 11673 80.91.224.249 (24 Jan 2003 11:26:37 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 24 Jan 2003 11:26:37 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18c1yg-00031S-00 for ; Fri, 24 Jan 2003 12:26:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18c1y4-0004IM-00 for gnu-help-gnu-emacs@m.gmane.org; Fri, 24 Jan 2003 06:25:52 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.alt.net!netheaven.com!usenet Original-Newsgroups: comp.lang.lisp,comp.lang.awk,comp.unix.shell,gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: 208.20.133.66 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Original-Xref: shelby.stanford.edu comp.lang.lisp:103367 comp.lang.awk:24548 comp.unix.shell:140383 gnu.emacs.help:109404 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5925 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5925 democrat@india.com (Instant Democracy) writes: > The task is to eliminate patterns such as > DIRNAME/../ > from the path because they are redundant. I assume that you are also trying to deal with security issues. (Someone trying deliberately to gain access to fles outside of a directory) Don't forget to include these cases: DIRNAME/./../ DIRNAME/././../ etc. And also consider whatever quoting/conversions might occur. Hex encoding? Backslashes? How are "//" interpreted? Some cases these are treated as a single slash. Other cases it's the top of the directory. A/DIRNAME//../ - is this A, or / ? -- Sending unsolicited commercial e-mail to this account incurs a fee of $500 per message, and acknowledges the legality of this contract.