Re: [PATCHES] [Patch] - Fix for bug #2558, InitDB failed to run - Mailing list pgsql-hackers

From Andreas Pflug
Subject Re: [PATCHES] [Patch] - Fix for bug #2558, InitDB failed to run
Date
Msg-id 44E20003.4010907@pse-consulting.de
Whole thread Raw
In response to Re: [PATCHES] [Patch] - Fix for bug #2558, InitDB failed to run  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Andreas Pflug <pgadmin@pse-consulting.de> writes:
>   
>> what issues might arise if the output is redirected to a legal tmp file?
>>     
>
> Well, (1) finding a place to put the temp file, ie a writable directory;
> (2) ensuring the file is removed afterwards; (3) not exposing the user
> to security hazards due to unsafe use of a temp file (ye olde
> overwrite-a-symlink risk).  Perhaps a few more I didn't think of.
>   

AFAICS all DEVNULL usages result from redirecting postmaster's output,
which usually goes to $DATADIR/serverlog at runtime. If this would be
used here too, (1) is as safe as any $DATADIR, (2) is as safe as
cleaning up after failure usually is, (3) can't happen because the
directory is checked to be empty before initdb anyway. Additionally,
there's might be cases when a meaningful logfile from initdb is
desirable too. So why no redirection to initlog or so?

Regards,
Andreas




pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [PATCHES] Forcing current WAL file to be archived
Next
From: "Jim C. Nasby"
Date:
Subject: Re: [PATCHES] Forcing current WAL file to be archived