Minor races in sftp-server.c

Tony Finch dot at dotat.at
Thu Feb 6 13:16:00 EST 2003


On Wed, Feb 05, 2003 at 10:35:01PM +0100, Markus Friedl wrote:
> On Wed, Feb 05, 2003 at 07:26:04PM +0000, Tony Finch wrote:
> > There are a couple of races in sftp-server as this patch shows:
> 
> i think we can just remove the calls to stat.

No, that changes the semantics of the rename operation.
symlink(2) returns EEXIST if the second argument exists,
but rename(2) unlinks it silently. The current code tries
to prevent the user from renaming A to B when B exists.
This should be clear from the way my patch treats the
two cases differently, whereas they are treated the same
in the old code.

Tony.
-- 
f.a.n.finch  <dot at dotat.at>  http://dotat.at/
WIGHT PORTLAND PLYMOUTH: VARIABLE BECOMING SOUTHWESTERLY 3 OR 4, OCCASIONALLY
5. RAIN OR DRIZZLE. GOOD BECOMING MODERATE, OCCASIONALLY POOR.




More information about the openssh-unix-dev mailing list