Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cd4da8806fd657ec185921c229d1452d6e2c19aa60c99aaf02e057f334a1bfe5
Ticket: 1613456fffffffffffffffffffffffffffffffff
file readable lies with samba shared folder or file
User & Date: sebres on 2018-03-21 19:25:33
Changes

  1. icomment:
    Admittedly I still could not reproduce it directly, but I saw in some logs of my customers the signals it may indeed take place (successful opening implicitly after logging it was not readable).
    
    Looking into NativeAccess in tclWinFile.c could possibly explain it, because IMHO current realization may be not always suitable for some constellations with samba shares.
    Additionally it could cause the race conditions inside.
    
    By the way, I believe it should be extremely inperformant on some network shares, so I had tested it and indeed noticed a high performance degradation.
    Even open/close is more faster.
    
    So I have bound (via ffidl) the CRT-access_s function (just to compare it also), below you'll find the results of:
    
    <pre><code>
    package require Ffidlrt
    ffidl::callout _access_s {pointer-utf8 int} int [ffidl::symbol msvcr90.dll _access_s] stdcall
    ffidl::callout _waccess_s {pointer int} int [ffidl::symbol msvcr90.dll _waccess_s] stdcall
    
    set path {z:\any\path\with\read\access\on\network\drive.txt}
    
    # timerate it 250ms ... #
    
    %  file exists $path 
    58.0534 µs/# 4305 # 17225.5 #/sec 249.920 nett-ms
    
    %  set f [open $path rb]; close $f 
    145.348 µs/# 1721 # 6880.0 #/sec 250.144 nett-ms
    
    %  file readable $path 
    3882.55 µs/# 65 # 257.56 #/sec 252.366 nett-ms
    
    %  _access_s $path 04 
    54.0879 µs/# 4620 # 18488.4 #/sec 249.886 nett-ms
    
    %  _waccess_s [::ffidl::get-unicode $path] 04 
    55.5223 µs/# 4501 # 18010.8 #/sec 249.906 nett-ms
    </code></pre>
    
    @Harald, possibly if you can reproduce it again, and if you've ffidl, could you possibly test this `expr {[_access_s $path 04] == 0}` will return 1 (GRANTED), where `file readable $path` still returns 0.
    
    In this case we could rewrite it using this CRT-primitives (and for exec/owner check using `fstat` with _S_IREAD|_S_IWRITE|_S_IEXEC combinations or something similar).
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"