Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > And then you have this case:
>
> > /usr/local/../bin/../..
>
> AFAICS, the patch I just proposed handles this.
>
> If I recall the code properly, we do not have to make canonicalize_path
> remove embedded "." or ".." --- that is, we do not have to simplify
>
> /usr/local/../bin
>
> But we do have to get rid of every trailing "." or "..", else there are
> failure cases when we replace the trailing component with an ordinary
> file name.
But what about "usr/local/../../.."? You loop is similar to what I
coded, but then when I realized I had to check for pending trims after I
run out of directories, and start appending them to create things like
../.., I gave up.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073