<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Is there a particular reason that you interleaved the handling of "resolvedPath" around the handling of "normalizedPath"?</div><div class=""><br class=""></div><div class="">vq</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 23, 2014, at 5:27 AM, <a href="mailto:ionic@macports.org" class="">ionic@macports.org</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="msg" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><dl class="meta" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt; border: 1px solid rgb(0, 0, 102); background-color: rgb(51, 102, 153); padding: 6px; color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial;"><dt style="font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt; float: left; width: 6em; font-weight: bold;" class="">Revision</dt><dd class=""><a href="https://trac.macports.org/changeset/129924" style="font-weight: bold; color: rgb(204, 204, 102);" class="">129924</a></dd><dt style="font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt; float: left; width: 6em; font-weight: bold;" class="">Author</dt><dd class=""><a href="mailto:ionic@macports.org" style="font-weight: bold; color: rgb(204, 204, 102);" class="">ionic@macports.org</a></dd><dt style="font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt; float: left; width: 6em; font-weight: bold;" class="">Date</dt><dd class="">2014-12-23 02:27:30 -0800 (Tue, 23 Dec 2014)</dd></dl><h3 style="font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt; font-weight: bold;" class="">Log Message</h3><pre style="overflow: auto; background-color: rgb(255, 255, 204); border: 1px solid rgb(255, 170, 0); padding: 6px; background-position: initial initial; background-repeat: initial initial;" class="">base: handle symlink as basename correctly for trace mode sandbox.</pre><h3 style="font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt; font-weight: bold;" class="">Modified Paths</h3><ul style="font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt;" class=""><li style="font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt;" class=""><a href="x-msg://86/#trunkbasesrcport10porttracetcl" class="">trunk/base/src/port1.0/porttrace.tcl</a></li></ul></div><div id="patch" style="width: 706px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><h3 style="font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt; font-weight: bold;" class="">Diff</h3><a id="trunkbasesrcport10porttracetcl" class=""></a><div class="modfile" style="border: 1px solid rgb(204, 204, 204); margin: 10px 0px;"><h4 style="font-family: verdana, arial, helvetica, sans-serif; font-size: 10pt; padding: 8px; background-color: rgb(51, 102, 153); color: rgb(255, 255, 255); margin: 0px; background-position: initial initial; background-repeat: initial initial;" class="">Modified: trunk/base/src/port1.0/porttrace.tcl (129923 =&gt; 129924)</h4><pre class="diff" style="padding: 0px 0px 10px; line-height: 1.2em; margin: 0px; width: 704px; background-color: rgb(238, 238, 238); overflow: auto; background-position: initial initial; background-repeat: initial initial;"><span style="display: block; padding: 0px 10px;" class="">
<span class="info" style="color: rgb(136, 136, 136); background-color: rgb(255, 255, 255); display: block; padding: 0px 10px; background-position: initial initial; background-repeat: initial initial;">--- trunk/base/src/port1.0/porttrace.tcl        2014-12-23 08:07:12 UTC (rev 129923)
+++ trunk/base/src/port1.0/porttrace.tcl        2014-12-23 10:27:30 UTC (rev 129924)
</span><span class="lines" style="display: block; padding: 0px 10px; color: rgb(136, 136, 136); background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial;">@@ -68,10 +68,28 @@
</span><span class="cx" style="display: block; padding: 0px 10px;">         lappend mapping "=" "<a href="smb://=" class="">\\=</a>"
</span><span class="cx" style="display: block; padding: 0px 10px;"> 
</span><span class="cx" style="display: block; padding: 0px 10px;">         set normalizedPath [file normalize $path]
</span><ins style="background-color: rgb(221, 255, 221); text-decoration: none; display: block; padding: 0px 10px; background-position: initial initial; background-repeat: initial initial;" class="">+        # file normalize will leave symlinks as the very last
+        # path component intact. This will, for instance, prevent /tmp from
+        # being resolved to /private/tmp.
+        # Also use file readlink to counter this behavior.
+        # file readlink returns an error, if the last component is not
+        # a symlink. Catch that.
+        set resolvedPath {}
+        if {![catch {file readlink $path}]} {
+          set resolvedPath [file readlink $path]
+
+          if {[string length $resolvedPath] &gt; 0 &amp;&amp; [string index $resolvedPath 0] ne "/"} {
+              # Canonicalize.
+              set resolvedPath [file normalize [file dirname $path]/$resolvedPath]
+          }
+        }
</ins><span class="cx" style="display: block; padding: 0px 10px;">         lappend sndbxlst "[string map $mapping $path]=$action"
</span><span class="cx" style="display: block; padding: 0px 10px;">         if {$normalizedPath ne $path} {
</span><span class="cx" style="display: block; padding: 0px 10px;">             lappend sndbxlst "[string map $mapping $normalizedPath]=$action"
</span><span class="cx" style="display: block; padding: 0px 10px;">         }
</span><ins style="background-color: rgb(221, 255, 221); text-decoration: none; display: block; padding: 0px 10px; background-position: initial initial; background-repeat: initial initial;" class="">+        if {[string length $resolvedPath] &gt; 0 &amp;&amp; $resolvedPath ne $path} {
+            lappend sndbxlst "[string map $mapping $resolvedPath]=$action"
+        }
</ins><span class="cx" style="display: block; padding: 0px 10px;">     }
</span><span class="cx" style="display: block; padding: 0px 10px;"> 
</span><span class="cx" style="display: block; padding: 0px 10px;">     ##
</span></span></pre></div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">macports-changes mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:macports-changes@lists.macosforge.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">macports-changes@lists.macosforge.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.macosforge.org/mailman/listinfo/macports-changes" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.macosforge.org/mailman/listinfo/macports-changes</a></div></blockquote></div><br class=""></body></html>