Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 531ed03e1abdf46d7973987e83b884330241e256
Ticket: 3092089fffffffffffffffffffffffffffffffff
[file normalize] can remove path components
User & Date: oehhar on 2013-01-07 17:27:29
Changes

  1. icomment:
    Thank you, Jan, for the patch.
    
    I have build and tested it, together with tk8.5.13 on Win Vista 32bit GER and msvc 6++.
    
    Startup of tcl and tk over a restricted junction is ok.
    Practical test: (junction setup as described in former post:
     - tcl in c:\test2\tcl-bug-3092089
     - Junction c:\test2_junction to c:\test2 )
    Start wish in c:\test2_junction\tcl8513-bug-3092089\bin\wish85t.exe
    ---wish console---
    % file normalize c:/test2_junction
    C:/test2_junction
    % info nameofexecutable
    c:/test2_junction/tcl8513-bug-3092089/bin/wish85t.exe
    % file normalize [info nameofexecutable]
    C:/test2/tcl8513-bug-3092089/bin/wish85t.exe
    % file normalize c:/test2_junction/nonexisting_folder
    C:/test2/nonexisting_folder
    % open c:/test2_junction/tcl8513-bug-3092089/include/tcl.h
    file2aa5ad8
    ---END---
    Here is a comparison to tcl8.5.13 (not started over the junction):
    ---wish console---
    % file normalize c:/test2_junction
    C:/test2_junction
    % file normalize c:/test2_junction/tcl8513-bug-3092089/bin/wish85t.exe
    C:/test2_junction//bin/wish85t.exe
    % file normalize c:/test2_junction/nonexisting_folder
    C:/test2_junction/nonexisting_folder
    open c:/test2_junction/tcl8513-bug-3092089/include/tcl.h
    file2aa7318
    ---END---
    All bugs disapeared. To resolve "file normalize c:/test2_junction" to "c:/test2" instead
    "C:/test2_junction" is IMHO a "Nice to have".
    
    Make test results of the patch and the regular 8.5.13 release are below.
    The following tests fail in the different versions:
    Test # : bugfix : 8.5.13
    ------------------------------
    filesystem-1.3 : fail : fail
    filesystem-1.4 : fail : fail
    io-39.8 : fail : ok
    io-39.9 : fail : ok
    winFCmd-6.1 : fail : fail
    winFCmd-6.9 : fail : fail
    winFCmd-6.13 : fail : fail
    winFCmd-9.3 : fail : fail
    winFCmd-12.6 : fail : fail
    
    Thus, there are the two io tests failing in the bug fix release which did succeed in the 8.5.13 release.
    I have no idea why.
    
    Thank you,
    Harald
    ---------------------------------------------------------------------------
    
    --- Make test of the bugfix release --
    
    nmake -f Makefile.vc release OPTS=threads
    nmake -f Makefile.vc test OPTS=threads
    
    ==== filesystem-1.3 link normalisation FAILED
    ==== Contents of test case:
    
        testPathEqual [file normalize [file join dir.dir foo]]  [file normalize [fil
    e join dir.link foo]]
    
    ---- Result was:
    not equal: C:/test/tcl-bug-3092089/win/dir.dir/foo C:/test/tcl-bug-3092089/win/d
    ir.link/foo
    ---- Result should have been (exact matching):
    1
    ==== filesystem-1.3 FAILED
    
    
    
    ==== filesystem-1.4 link normalisation FAILED
    ==== Contents of test case:
    
        testPathEqual [file normalize [file join dir.dir inside.file]]  [file normal
    ize [file join dir.link inside.file]]
    
    ---- Result was:
    not equal: C:/test/tcl-bug-3092089/win/dir.dir/inside.file C:/test/tcl-bug-30920
    89/win/dir.link/inside.file
    ---- Result should have been (exact matching):
    1
    ==== filesystem-1.4 FAILED
    
    ==== io-39.8 Tcl_SetChannelOption, different buffering options FAILED
    ==== Contents of test case:
    
        file delete $path(test1)
        set f1 [open $path(test1) w]
        set l ""
        fconfigure $f1 -translation lf -buffering none -eofchar {}
        puts -nonewline $f1 hello
        lappend l [file size $path(test1)]
        puts -nonewline $f1 hello
        lappend l [file size $path(test1)]
        fconfigure $f1 -buffering full
        puts -nonewline $f1 hello
        lappend l [file size $path(test1)]
        fconfigure $f1 -buffering none
        lappend l [file size $path(test1)]
        puts -nonewline $f1 hello
        lappend l [file size $path(test1)]
        close $f1
        lappend l [file size $path(test1)]
        set l
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: couldn't open "C:/test/tcl-bug-3092089/win/test1": permission de
    nied
        while executing
    "open $path(test1) w"
        ("uplevel" body line 3)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: POSIX EACCES {permission denied}
    ==== io-39.8 FAILED
    
    ==== io-39.9 Tcl_SetChannelOption, blocking mode FAILED
    ==== Contents of test case:
    
        file delete $path(test1)
        set f1 [open $path(test1) w]
        close $f1
        set f1 [open $path(test1) r]
        set x ""
        lappend x [fconfigure $f1 -blocking]
        fconfigure $f1 -blocking off
        lappend x [fconfigure $f1 -blocking]
        lappend x [gets $f1]
        lappend x [read $f1 1000]
        lappend x [fblocked $f1]
        lappend x [eof $f1]
        close $f1
        set x
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: couldn't open "C:/test/tcl-bug-3092089/win/test1": permission de
    nied
        while executing
    "open $path(test1) w"
        ("uplevel" body line 3)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: POSIX EACCES {permission denied}
    ==== io-39.9 FAILED
    
    ==== winFCmd-6.1 TclpRemoveDirectory: errno: EACCES FAILED
    ==== Contents of test case:
    
        cleanup
        file mkdir td1
        testchmod 000 td1
        catch {
            testfile rmdir td1
            file exists td1
        } r
        catch {
            testchmod 777 td1
            cleanup
        }
        set r
    
    ---- Result was:
    td1 EACCES
    ---- Result should have been (exact matching):
    0
    ==== winFCmd-6.1 FAILED
    
    
    
    ==== winFCmd-6.9 TclpRemoveDirectory: errno == EACCES FAILED
    ==== Contents of test case:
    
        cleanup
        file mkdir td1
        testchmod 000 td1
        catch {
            testfile rmdir td1
            file exists td1
        } r
        catch {
            testchmod 777 td1
            cleanup
        }
        set r
    
    ---- Result was:
    td1 EACCES
    ---- Result should have been (exact matching):
    0
    ==== winFCmd-6.9 FAILED
    
    ==== winFCmd-6.13 TclpRemoveDirectory: write-protected FAILED
    ==== Contents of test case:
    
        cleanup
        file mkdir td1
        testchmod 000 td1
        catch {
            testfile rmdir td1
            file exists td1
        } r
        catch {
            testchmod 777 td1
            cleanup
        }
        set r
    
    ---- Result was:
    td1 EACCES
    ---- Result should have been (exact matching):
    0
    ==== winFCmd-6.13 FAILED
    
    
    
    ==== winFCmd-9.3 TraversalDelete: DOTREE_PRED FAILED
    ==== Contents of test case:
    
        cleanup
        file mkdir td1/td2
        testchmod 000 td1
        catch {
            testfile rmdir -force td1
            file exists td1
        } r
        catch {
            testchmod 777 td1
            cleanup
        }
        set r
    
    ---- Result was:
    td1 EACCES
    ---- Result should have been (exact matching):
    0
    ==== winFCmd-9.3 FAILED
    
    ==== winFCmd-12.6 ConvertFileNameFormat: absolute path with drive FAILED
    ==== Contents of test case:
    
        catch {file delete -force -- c:/td1}
        close [open c:/td1 w]
        list [catch {string tolower [file attributes c:/td1 -longname]} msg] $msg [f
    ile delete -force -- c:/td1]
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: couldn't open "c:/td1": invalid argument
        while executing
    "open c:/td1 w"
        ("uplevel" body line 3)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: POSIX EINVAL {invalid argument}
    ==== winFCmd-12.6 FAILED
    
    -- Make test of tcl8.5.13 --
    
    ==== filesystem-1.3 link normalisation FAILED
    ==== Contents of test case:
    
        testPathEqual [file normalize [file join dir.dir foo]]  [file normalize [fil
    e join dir.link foo]]
    
    ---- Result was:
    not equal: C:/test/tcl8.5.13/win/dir.dir/foo C:/test/tcl8.5.13/win/dir.link/foo
    ---- Result should have been (exact matching):
    1
    ==== filesystem-1.3 FAILED
    
    
    
    ==== filesystem-1.4 link normalisation FAILED
    ==== Contents of test case:
    
        testPathEqual [file normalize [file join dir.dir inside.file]]  [file normal
    ize [file join dir.link inside.file]]
    
    ---- Result was:
    not equal: C:/test/tcl8.5.13/win/dir.dir/inside.file C:/test/tcl8.5.13/win/dir.l
    ink/inside.file
    ---- Result should have been (exact matching):
    1
    ==== filesystem-1.4 FAILED
    
    ==== winFCmd-6.1 TclpRemoveDirectory: errno: EACCES FAILED
    ==== Contents of test case:
    
        cleanup
        file mkdir td1
        testchmod 000 td1
        catch {
            testfile rmdir td1
            file exists td1
        } r
        catch {
            testchmod 777 td1
            cleanup
        }
        set r
    
    ---- Result was:
    td1 EACCES
    ---- Result should have been (exact matching):
    0
    ==== winFCmd-6.1 FAILED
    
    
    
    ==== winFCmd-6.9 TclpRemoveDirectory: errno == EACCES FAILED
    ==== Contents of test case:
    
        cleanup
        file mkdir td1
        testchmod 000 td1
        catch {
            testfile rmdir td1
            file exists td1
        } r
        catch {
            testchmod 777 td1
            cleanup
        }
        set r
    
    ---- Result was:
    td1 EACCES
    ---- Result should have been (exact matching):
    0
    ==== winFCmd-6.9 FAILED
    
    ==== winFCmd-6.13 TclpRemoveDirectory: write-protected FAILED
    ==== Contents of test case:
    
        cleanup
        file mkdir td1
        testchmod 000 td1
        catch {
            testfile rmdir td1
            file exists td1
        } r
        catch {
            testchmod 777 td1
            cleanup
        }
        set r
    
    ---- Result was:
    td1 EACCES
    ---- Result should have been (exact matching):
    0
    ==== winFCmd-6.13 FAILED
    
    
    
    ==== winFCmd-9.3 TraversalDelete: DOTREE_PRED FAILED
    ==== Contents of test case:
    
        cleanup
        file mkdir td1/td2
        testchmod 000 td1
        catch {
            testfile rmdir -force td1
            file exists td1
        } r
        catch {
            testchmod 777 td1
            cleanup
        }
        set r
    
    ---- Result was:
    td1 EACCES
    ---- Result should have been (exact matching):
    0
    ==== winFCmd-9.3 FAILED
    
    ==== winFCmd-12.6 ConvertFileNameFormat: absolute path with drive FAILED
    ==== Contents of test case:
    
        catch {file delete -force -- c:/td1}
        close [open c:/td1 w]
        list [catch {string tolower [file attributes c:/td1 -longname]} msg] $msg [f
    ile delete -force -- c:/td1]
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: couldn't open "c:/td1": invalid argument
        while executing
    "open c:/td1 w"
        ("uplevel" body line 3)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: POSIX EINVAL {invalid argument}
    ==== winFCmd-12.6 FAILED
    
    
    
    
  2. login: "oehhar"
  3. mimetype: "text/plain"
  4. username: "oehhar"