Changeset 79307
- Timestamp:
- 06/08/11 17:52:52 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl
r79302 r79307 55 55 foreach link [links_list $destroot] { 56 56 set points_to [file link $link] 57 if { [string compare [file pathtype $points_to] {absolute}] == 0 } { 58 if {[regexp $destroot $points_to]} { 59 ui_debug "Absolute link path pointing to inside of destroot" 60 return -code error "Absolute link path pointing to inside of destroot" 57 if { [file pathtype $points_to] eq {absolute} } { 58 #This might be changed for RegExp support 59 if {[regexp $destroot$prefix $points_to]} { 60 ui_debug "$link is an absolute link to a path inside destroot" 61 return -code error "$link is an absolute link to a path inside destroot" 61 62 } else { 62 ui_debug " Absolute link path pointing to outside ofdestroot"63 ui_debug "$link is an absolute link to a path outside destroot" 63 64 } 64 } elseif { [string compare [file pathtype $points_to] {relative}] == 0 } {65 regsub $destroot$prefix/ $link "" link_without_destroot66 set dir_depth [regexp -all / $link_without_destroot]67 set return_depth [regsub -all {\.\./} $points_to "" points_to_without_returns]68 set return_delta [expr $return_depth - [regexp -all / $points_to_without_returns]]69 if { $return_delta < $dir_depth } {70 65 ui_debug "Relative link path pointing to inside of destroot" 66 } elseif {[file pathtype $points_to] eq {relative}} { 67 if {[regexp $destroot$prefix [file normalize [file join [file dirname $link] $points_to]]]} { 68 ui_debug "$link is a relative link to a path inside destroot" 71 69 } else { 72 ui_debug " Relative link path pointing to outside ofdestroot"73 return -code error " Relative link path pointing to outside ofdestroot"70 ui_debug "$link is a relative link to a path outside destroot" 71 return -code error "$link is a relative link to a path outside destroot" 74 72 } 75 73 }
Note: See TracChangeset
for help on using the changeset viewer.

