<div dir="ltr">Hi, <div><br></div><div>I have this error that I want to fix:</div><div><br></div><div><div>  Insecure dependency in bind while running with -T switch at /usr/lib/perl/5.14/IO/Socket.pm line 202.</div></div>
<div><br></div><div>To me, the weirder part is not the error message itself, but how it appears. Enclosed list [1], and also available under <a href="http://pastebin.com/wqcHGfme">http://pastebin.com/wqcHGfme</a>, is the source code that invokes perl with the -T switch, and does not show the above insecure dependency issue. </div>
<div><br></div><div>Now take a look at this (minor) change:</div><div><br></div><div><br></div><div><div><font face="courier new, monospace">$ diff -wU 1 pixelserv2 pixelserv2</font></div><div><font face="courier new, monospace">--- pixelserv2  2013-12-02 20:41:46.075685600 -0500</font></div>
<div><font face="courier new, monospace">+++ pixelserv3  2013-12-02 20:37:29.943685600 -0500</font></div><div><font face="courier new, monospace">@@ -4,2 +4,4 @@</font></div><div><font face="courier new, monospace"> </font></div>
<div><font face="courier new, monospace">+my $conffile = "/etc/pixelserv.ip";</font></div><div><font face="courier new, monospace">+</font></div><div><font face="courier new, monospace"> my $crlf  = "\015\012";</font></div>
<div><font face="courier new, monospace">@@ -9,4 +11,8 @@</font></div><div><font face="courier new, monospace"> </font></div><div><font face="courier new, monospace">+open(my $fh, "<", $conffile) || die "can't open $conffile: $!";</font></div>
<div><font face="courier new, monospace">+my $listento = do { local $/; <$fh> };</font></div><div><font face="courier new, monospace">+close($fh) || die "can't close $conffile: $!";</font></div><div><font face="courier new, monospace">+</font></div>
<div><font face="courier new, monospace"> my $sock = new IO::Socket::INET(</font></div><div><font face="courier new, monospace">-    LocalHost => '0.0.0.0',</font></div><div><font face="courier new, monospace">+    LocalHost => $listento,</font></div>
<div><font face="courier new, monospace">     LocalPort => '80',</font></div></div><div><font face="courier new, monospace"><br></font></div><div><br></div><div>To me, the change is really minor, but the impact is huge. I now have such insecure dependency issue. </div>
<div><br></div><div>Why it was OK, and now is not? How to fix it?</div><div><br></div><div>Thanks</div><div><br></div><div>Antonio</div><div><br></div><div>[1] source list<br></div><div><ol style="margin:0px;padding:0px 0px 0px 48px;color:rgb(172,172,172);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono',monospace,serif;font-size:12px;line-height:21px;background-color:rgb(248,248,248)">
<li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(102,102,102);font-style:italic">#! /usr/bin/perl -Tw</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> </div></li>
<li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="font-weight:bold">use</span> IO<span class="" style="color:rgb(51,153,51)">::</span><span class="" style="color:rgb(0,102,0)">Socket</span><span class="" style="color:rgb(51,153,51)">::</span><span class="" style="color:rgb(0,102,0)">INET</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> </div></li>
<li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(177,177,0)">my</span> <span class="" style="color:rgb(0,0,255)">$crlf</span>  <span class="" style="color:rgb(51,153,51)">=</span> <span class="" style="color:rgb(255,0,0)">"<span class="" style="color:rgb(0,0,153);font-weight:bold">\0</span>15<span class="" style="color:rgb(0,0,153);font-weight:bold">\0</span>12"</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(177,177,0)">my</span> <span class="" style="color:rgb(0,0,255)">$pixel</span> <span class="" style="color:rgb(51,153,51)">=</span> <span class="" style="color:rgb(0,0,102)">pack</span><span class="" style="color:rgb(0,153,0)">(</span> <span class="" style="color:rgb(255,0,0)">"C*"</span><span class="" style="color:rgb(51,153,51)">,</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,0,102)">qw</span><span class="" style="color:rgb(0,153,0)">(</span><span class="" style="color:rgb(204,102,204)">71</span> <span class="" style="color:rgb(204,102,204)">73</span> <span class="" style="color:rgb(204,102,204)">70</span> <span class="" style="color:rgb(204,102,204)">56</span> <span class="" style="color:rgb(204,102,204)">57</span> <span class="" style="color:rgb(204,102,204)">97</span> <span class="" style="color:rgb(204,102,204)">1</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">1</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">128</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">255</span> <span class="" style="color:rgb(204,102,204)">255</span> <span class="" style="color:rgb(204,102,204)">255</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">33</span> <span class="" style="color:rgb(204,102,204)">249</span> <span class="" style="color:rgb(204,102,204)">4</span> <span class="" style="color:rgb(204,102,204)">1</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">44</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">1</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">1</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">2</span> <span class="" style="color:rgb(204,102,204)">2</span> <span class="" style="color:rgb(204,102,204)">68</span> <span class="" style="color:rgb(204,102,204)">1</span> <span class="" style="color:rgb(204,102,204)">0</span> <span class="" style="color:rgb(204,102,204)">59</span><span class="" style="color:rgb(0,153,0)">)</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(0,153,0)">)</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> </div></li>
<li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(177,177,0)">my</span> <span class="" style="color:rgb(0,0,255)">$sock</span> <span class="" style="color:rgb(51,153,51)">=</span> <span class="" style="font-weight:bold">new</span> IO<span class="" style="color:rgb(51,153,51)">::</span><span class="" style="color:rgb(0,102,0)">Socket</span><span class="" style="color:rgb(51,153,51)">::</span><span class="" style="color:rgb(0,102,0)">INET</span><span class="" style="color:rgb(0,153,0)">(</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    LocalHost <span class="" style="color:rgb(51,153,51)">=></span> <span class="" style="color:rgb(255,0,0)">'0.0.0.0'</span><span class="" style="color:rgb(51,153,51)">,</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    LocalPort <span class="" style="color:rgb(51,153,51)">=></span> <span class="" style="color:rgb(255,0,0)">'80'</span><span class="" style="color:rgb(51,153,51)">,</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    Proto     <span class="" style="color:rgb(51,153,51)">=></span> <span class="" style="color:rgb(255,0,0)">'tcp'</span><span class="" style="color:rgb(51,153,51)">,</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    Listen    <span class="" style="color:rgb(51,153,51)">=></span> <span class="" style="color:rgb(204,102,204)">30</span><span class="" style="color:rgb(51,153,51)">,</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    Reuse     <span class="" style="color:rgb(51,153,51)">=></span> <span class="" style="color:rgb(204,102,204)">1</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(0,153,0)">)</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> </div></li>
<li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(177,177,0)">if</span> <span class="" style="color:rgb(0,153,0)">(</span> <span class="" style="color:rgb(51,153,51)">!</span><span class="" style="color:rgb(0,0,102)">defined</span><span class="" style="color:rgb(0,153,0)">(</span><span class="" style="color:rgb(0,0,255)">$sock</span><span class="" style="color:rgb(0,153,0)">)</span> <span class="" style="color:rgb(0,153,0)">)</span> <span class="" style="color:rgb(0,153,0)">{</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,0,102)">print</span> <span class="" style="color:rgb(255,0,0)">"error : cannot bind : $! exit<span class="" style="color:rgb(0,0,153);font-weight:bold">\n</span>"</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,0,102)">exit</span><span class="" style="color:rgb(0,153,0)">(</span><span class="" style="color:rgb(204,102,204)">1</span><span class="" style="color:rgb(0,153,0)">)</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(0,153,0)">}</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> </div></li>
<li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(177,177,0)">while</span> <span class="" style="color:rgb(0,153,0)">(</span><span class="" style="color:rgb(177,177,0)">my</span>  <span class="" style="color:rgb(0,0,255)">$new_sock</span> <span class="" style="color:rgb(51,153,51)">=</span> <span class="" style="color:rgb(0,0,255)">$sock</span><span class="" style="color:rgb(51,153,51)">-></span><span class="" style="color:rgb(0,0,102)">accept</span><span class="" style="color:rgb(0,153,0)">(</span><span class="" style="color:rgb(0,153,0)">)</span> <span class="" style="color:rgb(0,153,0)">)</span> <span class="" style="color:rgb(0,153,0)">{</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(177,177,0)">while</span> <span class="" style="color:rgb(0,153,0)">(</span><span class="" style="color:rgb(51,153,51)"><</span><span class="" style="color:rgb(0,0,255)">$new_sock</span><span class="" style="color:rgb(51,153,51)">></span><span class="" style="color:rgb(0,153,0)">)</span> <span class="" style="color:rgb(0,153,0)">{</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">        <span class="" style="color:rgb(0,0,102)">chop</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">        <span class="" style="color:rgb(0,0,102)">chop</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> </div></li>
<li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">        <span class="" style="color:rgb(102,102,102);font-style:italic"># print "$_\n";</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">        <span class="" style="color:rgb(177,177,0)">if</span> <span class="" style="color:rgb(0,153,0)">(</span> <span class="" style="color:rgb(0,0,255)">$_</span> <span class="" style="color:rgb(177,177,0)">eq</span> <span class="" style="color:rgb(255,0,0)">''</span> <span class="" style="color:rgb(0,153,0)">)</span> <span class="" style="color:rgb(0,153,0)">{</span> <span class="" style="color:rgb(177,177,0)">last</span><span class="" style="color:rgb(51,153,51)">;</span> <span class="" style="color:rgb(0,153,0)">}</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,153,0)">}</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,0,102)">print</span> <span class="" style="color:rgb(0,0,255)">$new_sock</span> <span class="" style="color:rgb(255,0,0)">"HTTP/1.1 200 OK$crlf"</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,0,102)">print</span> <span class="" style="color:rgb(0,0,255)">$new_sock</span> <span class="" style="color:rgb(255,0,0)">"Content-type: image/gif$crlf"</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,0,102)">print</span> <span class="" style="color:rgb(0,0,255)">$new_sock</span> <span class="" style="color:rgb(255,0,0)">"Accept-ranges: bytes$crlf"</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,0,102)">print</span> <span class="" style="color:rgb(0,0,255)">$new_sock</span> <span class="" style="color:rgb(255,0,0)">"Content-length: 43$crlf$crlf"</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,0,102)">print</span> <span class="" style="color:rgb(0,0,255)">$new_sock</span> <span class="" style="color:rgb(0,0,255)">$pixel</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,0,102)">shutdown</span><span class="" style="color:rgb(0,153,0)">(</span> <span class="" style="color:rgb(0,0,255)">$new_sock</span><span class="" style="color:rgb(51,153,51)">,</span> <span class="" style="color:rgb(204,102,204)">2</span> <span class="" style="color:rgb(0,153,0)">)</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)">    <span class="" style="color:rgb(0,0,102)">undef</span><span class="" style="color:rgb(0,153,0)">(</span><span class="" style="color:rgb(0,0,255)">$new_sock</span><span class="" style="color:rgb(0,153,0)">)</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(0,153,0)">}</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> </div></li>
<li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(0,0,102)">close</span><span class="" style="color:rgb(0,153,0)">(</span><span class="" style="color:rgb(0,0,255)">$sock</span><span class="" style="color:rgb(0,153,0)">)</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(0,0,102)">exit</span><span class="" style="color:rgb(0,153,0)">(</span><span class="" style="color:rgb(204,102,204)">0</span><span class="" style="color:rgb(0,153,0)">)</span><span class="" style="color:rgb(51,153,51)">;</span></div>
</li></ol></div><div><br></div></div>