WG15 Defect Report Ref: 14519-09
Topic: TEXT_IO files should not have EXECUTE


This is an approved interpretation of 14519:1994.

.

Last update: 1997-05-20


                                                                14519-92 #9

Class: No change

 _____________________________________________________________________________


	Topic:			TEXT_IO files should not have EXECUTE 
				rights by default
	Relevant Sections:	ISO/IEC 14519:1994:  section 8.1.1.2


Defect Report:
-----------------------

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.

WG15 response for 9945-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?

 _____________________________________________________________________________