delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/08/16/05:57:39

Date: Wed, 16 Aug 2000 12:50:28 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: lauras AT softhome DOT net
Message-Id: <3405-Wed16Aug2000125028+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b
CC: djgpp-workers AT delorie DOT com
In-reply-to: <399A58A0.473D5E04@softhome.net> (message from Laurynas Biveinis
on Wed, 16 Aug 2000 11:02:24 +0200)
Subject: Re: Patch: open() adjustment for symlinks
References: <39998D7D DOT 70F85B9E AT softhome DOT net> <5137-Tue15Aug2000223737+0300-eliz AT is DOT elta DOT co DOT il> <399A58A0 DOT 473D5E04 AT softhome DOT net>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Wed, 16 Aug 2000 11:02:24 +0200
> From: Laurynas Biveinis <lauras AT softhome DOT net>
> 
> One more thing is unclear: in open() there is another _open() call, if
> the first fail. I assume it is OK to get away with single _open() call
> in readlink(), if it has SH_DENYNO set?

I'm not sure I understand how readlink is going to call _open, but
opening a file with SH_DENYNO as the default is not always a good
idea.  Take a look at the table of sharing behavior in RBIL, under
function 3Dh of Int 21: at least for SHARE.EXE it seems to say that,
if the file is open by another program in compatibility mode, and you
open it with SH_DENYNO, it fails if the file is not read-only
(whatever that means), even if, like in readlink, you open the file
for read-only access.

So perhaps we need the same two-step dance in readlink as well, just
to be on the safe side.  This is a minefield, and we alrteady know
that RBIL doesn't tell the whole truth, either.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019