Algol 68 open, book, channel RFC
chris hermansen
clhermansen@gmail.com
Sat Jun 6 03:31:36 GMT 2026
Me again,
I came to a few provisional decisions tonight.
van Vliet has his open call a procedure find_book_in_system (which is
nowhere else used). I changed this to attempt_to_open_and_link:
- no buffer is involved (because I will let POSIX routines handle the
buffering for now)
- I need somewhere to put the file descriptor returned by the POSIX open,
so attempt_to_open_and_link will put it in the Book
- I'm not messing with fstat nor access nor any of that because of this
warning I see in the access man page:
Warning: Using these calls to check if a user is authorized to, for
example, open a file before actually doing so using open(2) creates a
security hole, because the user might exploit the short time interval
between checking and opening the file to manipulate it. For this reason,
the use of this system call should be avoided. (In the example just
described, a safer alternative would be to temporarily switch the process's
effective user ID to the real ID and then call open(2).)
So, yeah, "just call open" (and similarly for establish and create).
The POSIX open, when it fails, doesn't really play well with van Vliet's
"channel preferences" - for example, EACCES is a bit of an omnibus error:
The requested access to the file is not allowed, or search permission
is denied for one of the directories in the path prefix of path, or the
file did not exist yet and write access to the parent directory is not
allowed.
I guess I can reflect on what I wanted vs the POSIX errno code and puzzle
it out, but for now I'm just going to signal van Vliet's "badidf" error.
Anyone who would like to argue with these provisional decisions, please do!
--
Chris Hermansen · clhermansen "at" gmail "dot" com
C'est ma façon de parler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/algol68/attachments/20260605/5feb3a95/attachment.htm>
More information about the Algol68
mailing list