Re: Remove sort files

From: "Michael Richards" <michael(at)fastmail(dot)ca>
To: pgman(at)candle(dot)pha(dot)pa(dot)us
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Remove sort files
Date: 2001-05-23 00:48:38
Message-ID: 3B0B08E6.000121.68010@frodo.searchcanada.ca
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).

-Michael
_________________________________________________________________
http://fastmail.ca/ - Fast Free Web Email for Canadians
>From pgsql-patches-owner(at)postgresql(dot)org Tue May 22 21:09:00 2001
Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4N0txA53485
for <pgsql-patches(at)postgresql(dot)org>; Tue, 22 May 2001 20:55:59 -0400 (EDT)
(envelope-from pgman(at)candle(dot)pha(dot)pa(dot)us)
Received: (from pgman(at)localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4N0tpV17150;
Tue, 22 May 2001 20:55:51 -0400 (EDT)
From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Message-Id: <200105230055(dot)f4N0tpV17150(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Remove sort files
In-Reply-To: <3B0B08E6(dot)000121(dot)68010(at)frodo(dot)searchcanada(dot)ca> "from Michael Richards
at May 22, 2001 08:48:38 pm"
To: Michael Richards <michael(at)fastmail(dot)ca>
Date: Tue, 22 May 2001 20:55:51 -0400 (EDT)
CC: pgsql-patches(at)postgresql(dot)org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
X-Archive-Number: 200105/160
X-Sequence-Number: 808

> > 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 believe it is in /usr/bin on every OS, right? My guess is I have to
have configure find it. Let me get on that for 'find' and 'rm'. If
they are not found, I will skip it.

--
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

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-05-23 01:11:58 Re: Remove sort files
Previous Message Bruce Momjian 2001-05-23 00:36:14 Remove sort files