Re: Remove sort files

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Michael Richards <michael(at)fastmail(dot)ca>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Remove sort files
Date: 2001-05-23 01:11:58
Message-ID: 200105230111.f4N1BwN24369@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> > The only unusual part is the use of system("find...rm...") to
> > remove the files in pg_sorttemp. Seemed cleaner than doing fancy
> > directory walking code in C.
>
> Should this figure out and use a path to the find command? Unless
> postgres sets CWD, is it possible as-is to coerce it into rming some
> files you did not intend to have rm'd? I didn't have/spend time
> looking at it with a fine toothcomb, but usually calling find and rm
> without an explicit path is a Bad Thing(tm).

I do use a full path for find:

find DataDir -...

Here is an updated patch which forces find and rm to come from /bin or
/usr/bin. Seems safer that way.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
unknown_filename text/plain 3.9 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2001-05-23 15:05:47 Re: Remove sort files
Previous Message Michael Richards 2001-05-23 00:48:38 Re: Remove sort files