Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b78eaf04fd40619716b679de514611e200fbce32
Ticket: 1951574fffffffffffffffffffffffffffffffff
problem with "file executable" on windows, tcl 8.5.2
User & Date: dkf on 2013-09-24 22:03:15
Changes

  1. assignee changed to: "aku"
  2. closedate changed to: "2456560.41893361"
  3. closer changed to: "dkf"
  4. comment changed to:
    ActiveState TCL 8.5.2, Windows XP SP2
    
    'file executable' always returns 0, even on .exe and .bat when asked
    for a file on a network share:
    
        % info patchlevel
        8.5.2
    
        % set file L:/ralf/si++aegis/si++.4.0.C443/bin/winnt/gen.exe
        L:/ralf/si++aegis/si++.4.0.C443/bin/winnt/gen.exe
        % file exists $file
        1
        % file readable $file
        1
        % file executable $file
        0
    
    
    % file stat l:/ralf/si++aegis/si++.4.0.C443/bin/winnt/gen.exe stat
    % parray stat
    stat(atime) = 1209122103
    stat(ctime) = 1209068036
    stat(dev)   = 11
    stat(gid)   = 0
    stat(ino)   = 65447
    stat(mode)  = 33252
    stat(mtime) = 1209068036
    stat(nlink) = 1
    stat(size)  = 143360
    stat(type)  = file
    stat(uid)   = 0
    % file attributes l:/ralf/si++aegis/si++.4.0.C443/bin/winnt/gen.exe
    -archive 0 -hidden 0 -longname L:/ralf/si++aegis/si++.4.0.C443/bin/winnt/gen.exe
     -readonly 0 -shortname L:/ralf/SWN7X3~G/SA8C5U~X/bin/winnt/gen.exe -system 0
    
    The L:/ Network Share is an Samba share mounted from a linux box.
    
    
    However, when copying the files to local disk, the files are qualified
    as executable:
    
        % cp L:/ralf/si++aegis/si++.4.0.C443/bin/winnt/gen.exe d:/temp
        % file executable d:/temp/gen.exe
        1
    
    % file stat d:/temp/gen.exe stat
    % parray stat
    stat(atime) = 1209124275
    stat(ctime) = 1209064504
    stat(dev)   = 3
    stat(gid)   = 0
    stat(ino)   = 52961
    stat(mode)  = 33252
    stat(mtime) = 1209064504
    stat(nlink) = 1
    stat(size)  = 143360
    stat(type)  = file
    stat(uid)   = 0
    
    
    % file attributes  d:/temp/gen.exe
    -archive 0 -hidden 0 -longname D:/temp/gen.exe -readonly 0 -shortname
    D:/temp/gen.exe -system 0
    
    =============================
    
    In a debugging session I see that the problem is in tclwinfile.c, in NativeAccess(), #1702
    
    if (!(*tclWinProcs->accessCheckProc)(sdPtr, hToken, desiredAccess,
    &genMap, &privSet, &privSetSize, &grantedAccess,
    &accessYesNo)) {
    
    This maps to the Windows-API AccessCheck() libary function and returns 0 in accessYesNo for the network file and 1 for the local file.
    
    This currently is a real showstopper for us, so I'd appreciate any help...
    
    This also happens in 8.4.x, but not in 8.3.x which does not have the extended security-descriptor checks.
    
    Note that the file-stat-mode is the same for the network and local file and seems to include owner-execute-permissions for both files.
    
    
    Thanks
    R'
    
  5. foundin changed to: "8.5.2"
  6. login: "dkf"
  7. mimetype: "text/plain"
  8. severity changed to: "Minor"
  9. status changed to: "Closed"