home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: haug@grok20.columbiasc.NCR.COM ("Brian R. Haug")
-
- In article <1992Mar21.232333.20048@uunet.uu.net> karish@mindcraft.com
- (Chuck Karish) writes:
- >In article <1992Mar20.225009.29556@uunet.uu.net> I wrote
- >>I've recently encountered a problem with seekdir in that it does not work
- >>when the directory is on a device incapable of seeking (like the /dev/fd
- >>filesystem in SVR4) because seekdir calls lseek which fails.
- >
- >Then I guess you'll have to convert the directory into a seekable
- >form, perhaps by copying it into memory.
-
- This was considered, but was not acceptable for two reasons:
- 1) rewinddir is implemented as a call to seekdir, and POSIX requires
- rewinddir to "refer to the current state of the corresponding
- directory, as a call to opendir() would have done." See 5.1.2.2
- lines 51-54. This puts me back at square one again with regard
- to seeking. I probably should have made the rewinddir point
- better in my original post.
- 2) The directory could be huge, allocating a megabyte, or even several K
- of memory was deemed inappropriate for our implementation.
-
- >>POSIX seems to have done a good job covering all the bases, as it does not
- >>allow chroot, which would prevent re-opening the file to implement rewinddir.
- >
- >If you cache the directory, all it takes is a pointer assignment.
- >POSIX doesn't require that you maintain cache consistency on
- >the directory image, either.
-
- Unless I've mis-understood what you're saying here, I have to disagree, see
- the section of the standard mentioned earlier.
-
- >Are you saying that SVID and XPG3 require that an open directory
- >stream remain useful after a call to chroot() that would make
- >the directory itself inaccessible?
-
- That's my interpretation. Granted you can not open any of the files
- that you find in that directory, but I should still be able to access
- the directory (until closedir is called). After all, I can access files
- not available from the current root directory IF I had them open before
- the chroot call. Seems like the same idea to me.
-
- Knowing your reputation, I appreciate you taking time to respond. I
- think you've helped me better explain the problems we perceive.
-
-
-
- Volume-Number: Volume 27, Number 38
-
-