On Mon, Dec 28, 2009 at 10:51:47PM -0600, Stan Hoeppner wrote:

> satishkumarp2k1 put forth on 12/28/2009 9:29 PM:
> 
> > Yes, correct. All the alias files are generated using perl scripts, which
> > run periodically. The scripts actually generate temporary alias files (while
> > generating the aliases) and then just use "mv" command to the actual alias
> > file. Do you still think lookup might fail even in this case??

The "mv" is unsafe if it moves files across file-systems. Perl or C code
that uses system("mv $old $new") to rename(2) a file instead of using
the rename(2) system call (perldoc -f rename) is written by programmers
who should not be trusted with system code.

> How big is the alias file and how busy is this server?

This is not relevant. In-place rename(2) is atomic, and unless dbm(3)
files are used instead of Berkeley DB, smtpd(8) will not fail to find
recipients when an old indexed table is replaced by a new table, and the
recipient is present in both.

Programmers who use system("mv ...") cannot be trusted to write
robust code to update critical system configuration files.

-- 
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:majord...@postfix.org?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.

Reply via email to