Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2011-08-08
00:35 • Ticket [3385749fff] File open failures audited status still Open with 4 othe... artifact: 953025a873 user: twylite
2011-08-04
03:50 • Ticket [3385749fff]: 4 changes artifact: e3fc0f475d user: dkf
00:47 • Ticket [3385749fff]: 4 changes artifact: e31fed493b user: hobbs
2011-08-03
17:36 • New ticket [3385749fff]. artifact: e27108d1ed user: sampsonr

File open failures audited

Open3385749fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2011-08-03 17:36:31
At some points in the TCL C source, as well as in init.tcl, auto.tcl, and autoload.tcl, there are are file open(read) operations that do not check first to see if the file exists.  Instead, they rely on a catch, or reacting to the open calls' return code. 

Granted, this is a fairly common programming practice, but it presents a hassle in environments where the system is subject to high-level auditing (e.g. government systems). In those cases, every single failed file open call results in an audit record being generated. On a system with hundreds of users, this contributes to a management burden for the S/A.

I recommend that each such open attempt be wrapped with a [file exists] or a stat() call in the C.
hobbsplain2011-08-04 00:47:37
The lack of 'file exists' (or readable) is actually intentional because some systems have ACLs that have duped 'file readable' in the past, saying not readable, but they were.
dkfplain2011-08-04 03:50:29
There's also a race condition between an access()/stat() call and the open().
twyliteplain2011-08-08 00:35:19
Are you referring to files that are used by Tcl itself, or to operations initiated by software written in Tcl?

In the former case there may be an argument for doing a [file exists] (and accepting the race condition if it is not security sensitive).  

In the latter case an attempt was made to access the file, and if there is system-level auditing this fact _should_ be in the audit log.  If this is happening a lot, the security administrators _should_ be investigating why there are so many attempts to open non-existent files.
Log in (anonymous is fine) to add a comment.