Use of the information contained in this unapproved document is at your own risk
.Last update: 04 September,1996
1003.5-92 #9
Class: No change
This response will be incorporated in an IEEE interpretations
publication, and will be also made available on-line on the IEEE
SPAsystem.
_____________________________________________________________________________
Interpretation Number: XXXX
Topic: TEXT_IO files should not have EXECUTE
rights by default
Relevant Sections: IEEE Std 1003.5-1992: section 8.1.1.2
Interpretation Request:
-----------------------
The default protection for a file created by TEXT_IO is currently
specified to be READ_WRITE_EXECUTE. This results in text files that
can be inadvertently executed (as shell scripts), even though that is
not the intent. The default protection for a file created using
POSIX_IO does not include EXECUTE, so TEXT_IO files should not include
EXECUTE, either.
IEEE Interpretation for 1003.1-1990 (9945-1:1990):
--------------------------------------------------
The standard is correct as written. Although the common definition of
text file does not require the file to have Execute permissions, there
is nothing to prevent the user from using Ada's TEXT_IO to write
shellscripts that should be executable.
Rationale for Interpretation:
-----------------------------
The basic analogy for this is to look at the protections on a file
created by the POSIX.1 creat() operation. This operation does not
automatically mask out the EXECUTE bits. Therefore, despite the
appeal of restricting TEXT_IO files to READ and WRITE permissions
only, the standard does 'the right thing'.
Note that the user can prevent EXECUTE privileges via either his
process permission set or via an explicit permission string passed as
part of the TEXT_IO form parameter.
Here is an interesting question for the Ada Rapporteur Group: Can an
implementation provide something besides the null string "" as the
default for the TEXT_IO Form parameter?
_____________________________________________________________________________