Tcl Source Code

View Ticket
Login
Ticket UUID: 1100671
Title: Hard-coded attribute number for -permissions
Type: Bug Created on: 2005-01-12 05:45:41
Submitter: coldstore Assigned to: dkf
Subsystem: 37. File System Severity:
Priority: 5 Medium Last modified: 2005-01-14 21:17:47
Status: Closed Closed by: dkf
Resolution: Fixed Closed on: 2005-01-14 14:17:47
Version: obsolete: 8.5a3
Description:
tclFCmd.c line 539 in CopyRenameOneFile:
Tcl_FSFileAttrsSet(NULL, 2, target, perm);
tclIOUtil.c line 2980 in TclLoadFile:
Tcl_FSFileAttrsSet(NULL, 2, copyToPtr, perm);

Both assume that the -permissions file attribute has
index 2 in the filesystem destination of the copy
operation.

This is only guaranteed to be the case for Unix native
filesystems, as far as I can tell, and it completely
ignores the attribute string table returned by the vfs
layer for this file system.

Either the index should be generated from the attribute
string table, or it should be somewhere documented that
attribute index 2 *must* be -permissions if you intend
to use [file copy] over the vfs.
User Comments:
vincentdarley added on 2005-01-13 00:10:31:
Logged In: YES 
user_id=32170

The second of these two examples is not really a problem,
since we can be sure this is in the native filesystem (and
the importance of '2' is documented in tclUnixFCmd.c).

The first of your examples might operate on any file in any
filesystem, however, so that one is a problem...

Any patch to fix the problem appreciated.

vincentdarley added on 2005-01-13 01:37:54:
Logged In: YES 
user_id=32170

Can you please test the attached patch?

vincentdarley added on 2005-01-13 01:37:57:

File Added - 115595: fileperm.diff

dkf added on 2005-01-14 21:17:46:
Logged In: YES 
user_id=79902

Fixed in HEAD using helper function: TclFSFileAttrIndex.

Attachments: