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

From dror
Subject Re: [PATCHES] [Patch] - Fix for bug #2558, InitDB failed
Date
Msg-id BAY124-W8734AD5E276C516D22CE1F94F0@phx.gbl
Whole thread Raw
List pgsql-hackers
<br />In addition to Andreas respond:<br /><br />1+2) Currently the initDB is used the tmp folder to write other
"Helperfiles"  that are deleted afterwards.<br />  <br /> The fix is suggested only for win machines ,I think that
redirectionis more risky (as we saw with this bug) than to do redirect output to a log file that you created and
controlit ,you gave the permission to and know exactly what its status (even if the reason is that some virus scanner
orany other software blocked access to one device or another).<br /> But, I suggest a new improvement:<br /> Check the
statusand if the command failed than run it  without redirection at all, (actually no redirection is needed in this
case, you can always run the process in silent mode).<br />  <br /> The interesting question that didn't get any answer
yetis:<br /> Why EnterpriseDB (which is based on postgress) find it important to change the redirection?<br /><br
/>Regards<br/> Dror,<br /><hr id="stopSpelling" /><br /> > Date: Tue, 15 Aug 2006 19:10:27 +0200<br />> From:
pgadmin@pse-consulting.de<br/>> To: tgl@sss.pgh.pa.us<br />> CC: bruce@momjian.us; pgsql-hackers@postgresql.org;
andrew@dunslane.net<br/>> Subject: Re: [HACKERS] [PATCHES] [Patch] - Fix for bug #2558, InitDB failed to run<br
/>><br />> Tom Lane wrote:<br />> > Andreas Pflug <pgadmin@pse-consulting.de> writes:<br />>
>   <br/>> >> what issues might arise if the output is redirected to a legal tmp file?<br />>
>>     <br/>> ><br />> > Well, (1) finding a place to put the temp file, ie a writable directory;<br
/>>> (2) ensuring the file is removed afterwards; (3) not exposing the user<br />>
> to security hazards due to unsafe use of a temp file (ye olde<br/>>
> overwrite-a-symlink risk).  Perhaps a few more I didn't think of.<br/>> >   <br />> <br />>
AFAICS all DEVNULL usages result from redirecting postmaster's output,<br/>>
which usually goes to $DATADIR/serverlog at runtime. If this would be<br/>>
used here too, (1) is as safe as any $DATADIR, (2) is as safe as<br/>>
cleaning up after failure usually is, (3) can't happen because the<br/>>
directory is checked to be empty before initdb anyway. Additionally,<br/>>
there's might be cases when a meaningful logfile from initdb is<br/>>
desirable too. So why no redirection to initlog or so?<br/>> <br />> Regards,<br />> Andreas<br />> <br
/>><br />> <br />> ---------------------------(end of broadcast)---------------------------<br />>
TIP 6: explain analyze is your friend<br/><br /><br /><hr />Be one of the first to try Windows Live Mail. <a
href="http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d"target="_new">Windows Live
Mail.</a>

pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: An Idea for planner hints
Next
From: "Jim C. Nasby"
Date:
Subject: Re: [PATCHES] Forcing current WAL file to be archived