Skip to content
Tcl Source Code History Of Ticket 1951574
Login

History Of Ticket 1951574

Artifacts Associated With Ticket 1951574

  1. Ticket change [9e5d42d96c] (rid 96461) by ralfixx on 2008-04-25 12:26:12:

    1. assignee initialized to: "vincentdarley"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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'
      
      
      
      
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "ralfixx"
    10. subsystem initialized to: "37. File System"
    11. title initialized to:
      problem with "file executable" on windows, tcl 8.5.2
      
    12. type initialized to: "Bug"
  2. Ticket change [f93783f9e4] (rid 91669) by ferrieux on 2008-04-25 20:51:12:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      The semantic mismatch between Unix and Windows file permissions is profound, and Samba cannot be entirely blamed. Moreover, you discovered that the Win32 function responsible for this check did exhibit the problem. Then, I'd requalify this not as a Tcl bug, but rather an feature request to work around an OS/Samba bug.
      
      Moreover, I wonder why somebody would be interested in the executable flag on Windows, where the extension .EXE .BAT (or whatever in PATHEXT) is, to my knowledge, the only criterion used by the OS itself to decide whether it should execute it or not. Am I right to believe this, in which case the thing to do would be to add an extension check in [file executable], or is there really an OS-enforced executable flag in some flavours of Windows, in which case the OS/Samba route is worth pursuing ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  3. Ticket change [fb630ab2a6] (rid 92058) by ralfixx on 2008-04-25 21:45:24:

    1. icomment:
      Logged In: YES 
      user_id=377375
      Originator: YES
      
      [ferrieux]
      > ... on Windows, where the extension .EXE .BAT (or
      > whatever in PATHEXT) is, to my knowledge, the only criterion used by
      > the OS itself to decide whether it should execute it or not. Am I
      > right to believe this, in which case the thing to do would be to add
      > an extension check in [file executable], or is there really an
      > OS-enforced executable flag in some flavours of Windows, in which
      > case the OS/Samba route is worth pursuing ?
      
      This .exe/.bat check is already performed by the function, right
      before the code section which performs the ACL check:
      
          if (mode & X_OK) {
      if (!(attr & FILE_ATTRIBUTE_DIRECTORY) && !NativeIsExec(nativePath)) {
          /*
           * It's not a directory and doesn't have the correct extension.
           * Therefore it can't be executable
           */
      
          Tcl_SetErrno(EACCES);
          return -1;
      }
          }
      
      This check (namely NativeIsExec()) succeeds for the file in question.
      
      But then, the extended check is performed which fails for the
      networked file.  
      
      I wonder whether this extended check is only relevant
      for non-plain-files (directories?) since there I see:
      
          % file executable l:/ralf/si++aegis/si++.4.0.C443/bin/winnt/
          1
          % file executable l:/ralf/si++aegis/si++.4.0.C443/bin/winnt/gen.exe
          0
      
      R'
      
      
    2. login: "ralfixx"
    3. mimetype: "text/plain"
    4. username: "ralfixx"
  4. Ticket change [1255e85ff1] (rid 95288) by dgp on 2012-02-03 00:41:09:

    1. closedate changed to: "2012-02-02T17:41:09"
    2. closer changed to: "dgp"
    3. icomment:
      
      Patch from fix-win-native-access branch
      committed for 8.4.20, 8.5.12, and 8.6b3.
      
      Continued testing strongly encouraged.
      
      In particular, the #define UNICODE variant
      of the trunk is likely to have some lingering
      problems.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Pending"
    8. username: "dgp"
  5. Ticket change [b78eaf04fd] (rid 134183) by dkf on 2013-09-24 22:03:15:

    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"