James Carlson <james.d.carlson at sun.com> wrote:

> Assuming that other OSes present the same problem -- mere stat()
> doesn't trigger a fetch of the correct information, but opendir() does
> -- it'd be nice to see a standards-based solution for this.  I'm not
> sure that's a requirement here, though.
>
> I think the alternative (one that preserves the existing security
> checks) would be to add a new flag to fstatat(2).  Create a new flag
> called (say) AT_TRIGGER, and have it invoke the same autofs triggering
> that opendir() does, so that the node information returned is
> correct.  That way, you wouldn't have to do the double stat after
> opendir return, or disable the test.

First: I don't like a flag that lives inside st_mode as it could be in conflict 
with future POSIX enhancements.

The idea that:

f = open(".", 0);
fstatat(f, "dir", &stbuf, AT_TRIGGER);

returns the same struct stat as:

dp = opendir("dir");
stat("dir", &stbuf);

looks much more aligned to the spirit of POSIX.

J?rg

-- 
 EMail:joerg at schily.isdn.cs.tu-berlin.de (home) J?rg Schilling D-13353 Berlin
       js at cs.tu-berlin.de                (uni)  
       schilling at fokus.fraunhofer.de     (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

Reply via email to