<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Small Dropbear</title>
	<atom:link href="http://enc.com.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://enc.com.au</link>
	<description>umm</description>
	<lastBuildDate>Wed, 22 Feb 2012 03:37:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>VMware Player on Debian</title>
		<link>http://enc.com.au/2012/02/vmware-player-on-debian/</link>
		<comments>http://enc.com.au/2012/02/vmware-player-on-debian/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 07:50:01 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Emulators]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[VMware Player]]></category>
		<category><![CDATA[VMware Server]]></category>

		<guid isPermaLink="false">http://enc.com.au/?p=613</guid>
		<description><![CDATA[For various reasons, having vmware running on my desktop would be kind of useful.  VMware provide a Free (as in beer) version of their software called VMware Player. I downloaded the file VMware-Player-4.0.2-591240.x86_64.bundle off their website and tried to build it. It failed to build. Given my previous lack of success with VMware server, I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://enc.com.au/2012/02/vmware-player-on-debian/screenshot-at-2012-02-18-184434/" rel="attachment wp-att-619"><img class="alignright  wp-image-619" title="VMware Player with Debian" src="http://enc.com.au/wp-content/uploads/2012/02/Screenshot-at-2012-02-18-184434-300x282.png" alt="" width="240" height="226" /></a>For various reasons, having vmware running on my desktop would be kind of useful.  VMware provide a Free (as in beer) version of their software called <a class="zem_slink" title="VMware Player" href="http://www.vmware.com/products/player/" rel="homepage">VMware Player</a>. I downloaded the file VMware-Player-4.0.2-591240.x86_64.bundle off their website and tried to build it.</p>

<p>It failed to build. Given my previous lack of success with <a class="zem_slink" title="VMware Server" href="http://www.vmware.com/products/server/" rel="homepage">VMware server</a>, I wasn&#8217;t too surprised.  What was surprising was it wasn&#8217;t too hard to fix it.  The problem was that the vmnet module would not compile and that was due to three things:
<ul>
    <li>net device ops no longer has set&#95;multicast&#95;list (in netif.c)</li>
    <li>the linux module header needs to be included to define THIS_MODULE</li>
    <li>skb&#95;frag&#95;t has been redefined and needs an adjustment</li>
</ul>
The patch is only a few lines and means I can compile vmware on my <a class="zem_slink" title="Debian" href="http://www.debian.org/" rel="homepage">Debian sid</a> computer running kernel 3.2.0-1</p>

<p><a href="http://enc.com.au/2012/02/vmware-player-on-debian/vmnet-patch/" rel="attachment wp-att-614">vmnet.patch</a></p>

<p>To use it, you will need to find where the modules are built, for me it is /usr/lib/vmware/modules/source
<ol>
    <li>mv vmnet.tar vmnet2.tar</li>
    <li>tar xf vmnet2.tar</li>
    <li>patch -p1 &lt; vmnet.patch</li>
    <li>tar cf vmnet.tar vmnet-only</li>
</ol>
With that you can run the player which will try to build the modules and you&#8217;re done!</p>

<p>&nbsp;</p>

<p>&nbsp;
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
    <li class="zemanta-article-ul-li"><a href="http://www.cnx-software.com/2012/02/15/cross-compiling-vmware-view-for-arm-linux-in-debianubuntu">imabonehead: Cross-compiling VMWare View for ARM Linux (in Debian/Ubuntu) | CNXSoft &#8211; Embedded Software Development</a> (cnx-software.com)</li>
    <li class="zemanta-article-ul-li"><a href="http://tech2copycat.wordpress.com/2012/02/05/have-you-ever-t/">Virtually Run Another OS in your System</a> (tech2copycat.wordpress.com)</li>
    <li class="zemanta-article-ul-li"><a href="http://aslakjohansen.wordpress.com/2011/11/28/upgrade-to-oneiric-breaks-vmware-player/">Upgrade to Oneiric breaks VMWare Player</a> (aslakjohansen.wordpress.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"></a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://enc.com.au/2012/02/vmware-player-on-debian/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Unlucky sometimes</title>
		<link>http://enc.com.au/2012/01/unlucky-sometimes/</link>
		<comments>http://enc.com.au/2012/01/unlucky-sometimes/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 05:12:37 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[psmisc]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Buffer overflow]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Strcpy]]></category>

		<guid isPermaLink="false">http://enc.com.au/?p=603</guid>
		<description><![CDATA[Sometimes life throws little curves at you to see if you are still awake, today has been one of those days. fglrx is (apparently) fixed I&#8217;ve had a long-running problem with fglrx on my laptop.  The problem stems from ATI closed-source drivers with one of those laptops that has an ATI and Intel driver. It [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes life throws little curves at you to see if you are still awake, today has been one of those days.
<h2>fglrx is (apparently) fixed</h2>
I&#8217;ve had a long-running problem with fglrx on my laptop.  The problem stems from <a class="zem_slink" title="ATI Technologies" href="http://amd.com/" rel="homepage">ATI</a> closed-source drivers with one of those laptops that has an ATI and Intel driver. It means I am basically using the slow Intel chip only.  This morning I had enough and backed up my home and started to rebuild the laptop with <span class='bm_keywordlink'><a href="http://www.debian.org/">debian</a></span> 6.0.3.</p>

<p>So I kicked off the very very slow process of reformatting the crypto drive (it has taken 5 hours and still going) let it gurgle on its merry way and started to read my email.  One of the  emails was that my <a title="Debian bug about fglrx driver crashing" href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=649239">bug about fglrx not working</a> is closed, apparently it is fixed.  If I had read that 10 minutes earlier, a simple &#8216;apt-get install <a class="zem_slink" title="AMD Catalyst" href="http://sites.amd.com/us/game/downloads/Pages/downloads.aspx" rel="homepage">fglrx-driver</a>&#8216; would of perhaps fixed it; oh well.</p>

<p>My problem is now is do I move to the latest driver and hope their fix is my fix or leave it with some ancient version?  My preference is the former; I only hope it works!
<h2>psmisc 22.15 and <a class="zem_slink" title="Buffer overflow" href="http://en.wikipedia.org/wiki/Buffer_overflow" rel="wikipedia">buffer overflows</a></h2>
psmisc has a program called pstree which prints the set of processes in a tree fashion.  It hasn&#8217;t changed much for quite a while.  I released version 22.15 and the Debian package 22.15-1.  22.15-1 I also adopted the<a title="Debian Hardening guidelines" href="http://wiki.debian.org/Hardening"> harden CFLAGS</a> as suggested for procps.</p>

<p>I was a little surprised that I received an important bug.  The report was saying I had a buffer overflow introduced in 22.15-1, but no relevant code had changed.  The compiler options had done their job and stopped a buffer being overflowed.</p>

<p>But where exactly was the overflow?  Running gdb on pstree quickly showed that it was line 267 of pstree.c which uses <a class="zem_slink" title="Strcpy" href="http://en.wikipedia.org/wiki/Strcpy" rel="wikipedia">strcpy()</a>.  That function set off warning bells. The relevant code is:</p>


<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">    PROC <span style="color: #339933;">*</span>new<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>new <span style="color: #339933;">=</span> malloc<span style="color: #009900;">&#40;</span><span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span>PROC<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        perror<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;malloc&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        exit<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    strcpy<span style="color: #009900;">&#40;</span>new<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>comm<span style="color: #339933;">,</span> comm<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<p>&nbsp;</p>

<p>Now comm is the short command name you find in <a class="zem_slink" title="Procfs" href="http://en.wikipedia.org/wiki/Procfs" rel="wikipedia">/proc/</a>/stat.  It is fixed in the kernel at 16 characters.  The PROC structure has this field as 17 characters long, one extra for the NUL.  I went and checked the Linux source and yes, it is still 16 characters long.  The clue was in the name of the program that it died on.
<pre>#6  new_proc (comm=0x6111b0 "{console-kit-dae}", pid=1571, uid=0)
    at pstree.c:267</pre>
&nbsp;</p>

<p>That string is 17 characters long. The problem is that 16 characters is for the name only. If the name is in brackets or braces, then that 16 character limit doesn&#8217;t apply.  The buffer overflow bug has been there for a long time, but only with the compiler flags did it become visible.</p>

<p>Given you need to read names out of the /proc filesystem and if someone can fiddle with that you have bigger problems it doesn&#8217;t seem to be too much of an issue.  It should be (and is in Debian 22.15-2) fixed but is a nice example of the compiler catching bad things.</p>

<p>&nbsp;
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
    <li class="zemanta-article-ul-li"><a href="http://blogs.windriver.com/wind_river_blog/2012/01/detecting-security-problems-using-static-analysis-to-catch-them-early-and-less-expensively.html">Detecting security problems &#8211; using static analysis to catch them early and less expensively</a> (blogs.windriver.com)</li>
    <li class="zemanta-article-ul-li"><a href="http://thexploit.com/secdev/a-textbook-buffer-overflow-a-look-at-the-freebsd-telnetd-code/">A Textbook Buffer Overflow: A Look at the FreeBSD telnetd Code</a> (thexploit.com)</li>
    <li class="zemanta-article-ul-li"><a href="http://alitarhini.wordpress.com/2012/01/23/exploit-the-buffer-buffer-overflow-attack/">Exploit the buffer &#8211; Buffer Overflow Attack</a> (alitarhini.wordpress.com)</li>
    <li class="zemanta-article-ul-li"><a href="http://blog.aurel32.net/94">Aurelien Jarno: Performances of open-source Radeon driver</a> (aurel32.net)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"></a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://enc.com.au/2012/01/unlucky-sometimes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MediaServer with Rygel</title>
		<link>http://enc.com.au/2012/01/mediaserver-with-rygel/</link>
		<comments>http://enc.com.au/2012/01/mediaserver-with-rygel/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 11:24:29 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Digital Living Network Alliance]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Media server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://enc.com.au/?p=595</guid>
		<description><![CDATA[Like a lot of  people, I have one of those set-top TV boxes that can record TV shows at set times.  I made sure that I could get at the files (using a FTP server in this case) and that the files were some sort of common standard (MPEG 4 TS).  I also have a [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 85px"><a href="http://www.flickr.com/photos/17731548@N00/1339414099"><img class="zemanta-img-inserted zemanta-img-configured" title="Rygel XVI" src="http://farm2.static.flickr.com/1259/1339414099_942f8ceee9_m.jpg" alt="Rygel XVI" width="75" height="75" /></a><p class="wp-caption-text">Image by Cayusa via Flickr</p></div>

<p>Like a lot of  people, I have one of those set-top TV boxes that can record TV shows at set times.  I made sure that I could get at the files (using a FTP server in this case) and that the files were some sort of common standard (<a class="zem_slink" title="MPEG-4" href="http://en.wikipedia.org/wiki/MPEG-4" rel="wikipedia">MPEG 4</a> TS).  I also have a bunch of mp3 music files.</p>

<p>That&#8217;s fine when I&#8217;m on the desktop because the files are local.  I wanted to make these available to anyone in the household. <a class="zem_slink" title="Digital Living Network Alliance" href="http://www.dlna.org/" rel="homepage">DLNA</a> seemed to be a reasonably OK way of doing this, the problem was, how to get it working in <a class="zem_slink" title="Linux" href="http://www.kernel.org/" rel="homepage">Linux</a>?</p>

<p>A lot of the problem is that it is hard to find a DLNA <strong>only</strong> server.  Sure <a class="zem_slink" title="MythTV" href="http://www.mythtv.org/" rel="homepage">MythTV</a> could do it, but it needs a tv tuner or a lot of fiddling around.  XMBC can also do it, but it needs to be running a GUI.  I even tried mediatomb but could not get the thing to compile as the library calls to mozjs were all using deprecated functions. I just wanted a daemon that served stuff, nothing more; no fancy ui, no need for X just file serving goodness.</p>

<p><a class="zem_slink" title="Rygel" href="http://live.gnome.org/Rygel" rel="homepage">Rygel</a> is almost that.  You could say it is a user server much like a torrent client/server.  The nice thing is you can fiddle around with rygel so it becomes close to a real server.  This is how I did it.</p>

<p>First, I made a rygel user with a home directory, but disabled login. I don&#8217;t like programs running root if they don&#8217;t need it and rygel doesn&#8217;t need it.  The home directory needs to be writeable to the rygel user too otherwise the program doesn&#8217;t work too well. I use /var/local/rygel as its home.</p>

<p>For the configuration, copy /etc/rygel.conf to ~rygel/.config/rygel.conf  This is the configuration file for rygel. I disabled all of the modules except MediaExport. Make sure you disable Tracker otherwise MediaExport will not work. Tracker is only useful for real users who are logged in and have dbus etc going which this user is certainly not.</p>

<p>I made a simple rygeld file in /usr/local/sbin which basically starts the program, forks and grabs the PID to write to a pidfile. This mean it was easier to track the program in the init scripts.</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Rygel daemon handling</span>
<span style="color: #007800;">RYGEL</span>=<span style="color: #ff0000;">'/usr/bin/rygel'</span>
<span style="color: #007800;">RYGEL_ARGS</span>=<span style="color: #ff0000;">''</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;nohup <span style="color: #007800;">$RYGEL</span> <span style="color: #007800;">$RYGEL_ARGS</span> &amp;gt; /var/local/rygel/rygel.log 2&amp;gt;&amp;amp;1 &amp;amp;&quot;</span>
rygel
<span style="color: #007800;">EXIT_CODE</span>=<span style="color: #007800;">$?</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$EXIT_CODE</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$EXIT_CODE</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">PGROUP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">--no-headers</span> <span style="color: #660033;">-o</span> pgrp <span style="color: #007800;">$$</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">PID</span>=<span style="color: #000000; font-weight: bold;">`</span>pgrep <span style="color: #660033;">-g</span> <span style="color: #007800;">$PGROUP</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$RYGEL</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$PID</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>rygel.pid
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>


<p>In case you were wondering, the pgrp finds the program group so the pgrep finds the right rygel process that has the same program group as the starting shell.</p>

<p>The init script is a standard init script except the &#8211;exec flag checks for /usr/bin/rygel but the start line starts /usr/local/sbin/rygeld  This is because we want to kill the real rygel process but start it with the script.</p>

<p>This setup works rather well. You do get some messages in the logfile about dbus not working but it is harmless. I tried disabling the mpris and external plugins but no matter what flag or configuration file option I tried, they would always try to start and fail with no dbus.</p>

<p>Rygel is a a reasonably light-weight way of serving media to your home network. It idles 200 MB virtual with 16MB resident and when idle uses almost no CPU.</p>

<p>&nbsp;
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
    <li class="zemanta-article-ul-li"><a href="http://www.techradar.com/news/television/networking/verizon-planning-media-server-for-fios-tv-1050043?src=rss&amp;attr=all">Verizon planning Media Server for FiOS TV</a> (techradar.com)</li>
    <li class="zemanta-article-ul-li"><a href="http://www.readwriteweb.com/archives/infographic_the_changing_tv_landscape.php">Infographic: The Changing TV Landscape</a> (readwriteweb.com)</li>
    <li class="zemanta-article-ul-li"><a href="http://www.huffingtonpost.com/evan-shapiro/tv-the-great-uniter_b_1162000.html">Evan Shapiro: TV: The Great Uniter?</a> (huffingtonpost.com)</li>
    <li class="zemanta-article-ul-li"><a href="http://essayboard.com/2012/01/10/ubuntu-expands-to-tv-a-video-shows-a-gorgeous-ubuntu-tv-prototype-in-action/">Ubuntu Expands To TV, A Video Shows A Gorgeous Ubuntu TV Prototype In Action</a> (essayboard.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"></a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://enc.com.au/2012/01/mediaserver-with-rygel/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>procps 3.32 Debian packages</title>
		<link>http://enc.com.au/2012/01/procps-3-32-debian-packages/</link>
		<comments>http://enc.com.au/2012/01/procps-3-32-debian-packages/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 20:01:34 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[procps]]></category>
		<category><![CDATA[Deb (file format)]]></category>
		<category><![CDATA[Distributions]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Patch (Unix)]]></category>

		<guid isPermaLink="false">https://enc.com.au/?p=591</guid>
		<description><![CDATA[Following up from the upstream release of a new procps, the debian packages have also been updated. This upload has a significant change in that, I hope, procps is now multi-arch compliant. To make this happen, the libprocps library is now in it&#8217;s own package, separate from the binaries. It also means that if you [...]]]></description>
			<content:encoded><![CDATA[<p>Following up from the upstream release of a new procps, the <span class='bm_keywordlink'><a href="http://www.debian.org/">debian</a></span> packages have also been updated. This upload has a significant change in that, I hope, procps is now multi-arch compliant. To make this happen, the libprocps library is now in it&#8217;s own package, separate from the binaries. It also means that if you have programs not from procps that link to this library they are now broken. I put in a Breaks: line for the three I know about (<a href="http://packages.debian.org/sid/xmem" target="_blank">xmem</a>, <a href="http://packages.debian.org/sid/guymager" target="_blank">guymager</a> and <a href="http://packages.debian.org/sid/open-vm-tools" target="_blank">open-vm-tools</a>) which will need a recompile with a small tweak in the control file and linked statements.</p>

<p>As suggested in the <a href="http://wiki.debian.org/Multiarch/Implementation" target="_blank">multi arch implementation wiki page</a>, I tested the libprocps0-dev package by compiling something against it, in this case another Debian package xmem. Doing this was very useful for teasing out some bugs on the dev package itself that did not appear while linking the library to the procps binaries.</p>

<p>In short, the new procps has a lot fewer patches than the old ones and the next version will have less as I have already included the current changes into the upstream git repository. The main differences are now
<ul>
    <li>freebsd linux version is read from a file not from uts</li>
    <li>includes use __restrict not the auto make defined restrict which may not be present in third party packages</li>
    <li>libnucrsesw conditionally linked with watch for 8bit watch</li>
</ul>
The three are really bugs, especially the last, which is why the patches will disappear next release.
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
    <li class="zemanta-article-ul-li"><a href="http://enc.com.au/2012/01/procps-ng-version-3-3-2-released/">procps-ng version 3.3.2 released</a> (enc.com.au)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"></a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://enc.com.au/2012/01/procps-3-32-debian-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rpath bites me again</title>
		<link>http://enc.com.au/2012/01/rpath-bites-me-again/</link>
		<comments>http://enc.com.au/2012/01/rpath-bites-me-again/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 06:25:37 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://enc.com.au/?p=574</guid>
		<description><![CDATA[It&#8217;s funny, in  bad way, when certain sorts of bugs come back to bite you.  People may remember the fun debian had with rpath issues around in the late 90s where some binaries wanted to set the path of where their libraries were located.  After much contraversy the consensus was at least in Debian (with [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 119px"><a href="http://commons.wikipedia.org/wiki/File:Debian-OpenLogo.svg"><img class="zemanta-img-inserted zemanta-img-configured" title="Debian OpenLogo" src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Debian-OpenLogo.svg/109px-Debian-OpenLogo.svg.png" alt="Debian OpenLogo" width="109" height="144" /></a><p class="wp-caption-text">Image via Wikipedia</p></div>

<p>It&#8217;s funny, in  bad way, when certain sorts of bugs come back to bite you.  People may remember the fun <span class='bm_keywordlink'><a href="http://www.debian.org/">debian</a></span> had with <a title="RPATH Issue on Debian Wiki" href="http://wiki.debian.org/RpathIssue" target="_blank">rpath issues</a> around in the late 90s where some binaries wanted to set the path of where their libraries were located.  After much contraversy the consensus was at least in Debian (with some specific exceptions) RPATH is bad and don&#8217;t use it.  I lived through that &#8220;fun&#8221; and remember hacking <a class="zem_slink" title="GNU Libtool" href="http://www.gnu.org/software/libtool/" rel="homepage">libtool</a> or autoconf or some such file.</p>

<p>The horror of those times came back to haunt me today while working on procps 3.3.2 packages.  <a class="zem_slink" title="Lintian" href="http://lintian.debian.org/" rel="homepage">lintian</a> was suddenly complaining that <a href="http://lintian.debian.org/tags/binary-or-shlib-defines-rpath.html" target="_blank">binary-or-shlib-defines-rpath</a> for all my binaries.  I&#8217;ve not seen rpath set for many years and as I&#8217;m also part of the upstream and never saw it set there it took me a while to work out what was going on.</p>

<p>Certainly, my binaries were setting the RPATH, it wasn&#8217;t lintian getting the wrong idea.  You can see this with <a class="zem_slink" title="Objdump" href="http://en.wikipedia.org/wiki/Objdump" rel="wikipedia">objdump</a> <em>myfile</em> | grep RPATH. If you get a hit, you got RPATH set, an empty result means no RPATH. libtool was definitely setting the rpath, with</p>


<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">cc -Iproc -g -O2 -o \$progdir/\$file pmap.o  ./proc/.libs/libprocps.so \
 -Wl,-rpath -Wl,/home/csmall/debian/procps/procps/proc/.libs \
 -Wl,-rpath -Wl,//usr/lib/x86_64-linux-gnu</pre></div></div>


<p>&nbsp;</p>

<p>That&#8217;s not one rpath setting but two, for double insult. Configure flags such as &#8211;disable-rpath wouldn&#8217;t work. I flicked back to a pure upstream archive and there was no rpath there in either the compile flags or objdump. There was obviously some sort of side-effect going on.</p>

<p>The problem, after much testing, was in the debian/rules file:</p>


<div class="wp_syntax"><div class="code"><pre class="makefile" style="font-family:monospace;">        ./configure \
          --build=$(DEB_BUILD_GNU_TYPE) \
          --enable-watch8bit --enable-w-from \
          --prefix=/ \
          --mandir=\$${prefix}/usr/share/man  \
          --libdir=\$${prefix}/usr/lib/$(DEB_HOST_MULTIARCH)</pre></div></div>


<p>&nbsp;</p>

<p>The problem is above, and all it was was a &#8220;/&#8221;. libtool does some checking to see if the library directory exists and if it doesn&#8217;t silently turns on rpath. It&#8217;s not smart enough to know that //usr/lib/x86&#95;64-linux-gnu is the same as /usr/lib/x86&#95;64-linux-gnu and so it enables rpath. Removing the slash before the usr fixed the problem.</p>

<p>I&#8217;d say this is bad behavour on libtools part. It should know that / is // or all the other alternative ways of specifying paths.  Hopefully this post will stop someone else wasting their time like I did.</p>

<p>&nbsp;
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"></a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://enc.com.au/2012/01/rpath-bites-me-again/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>procps-ng version 3.3.2 released</title>
		<link>http://enc.com.au/2012/01/procps-ng-version-3-3-2-released/</link>
		<comments>http://enc.com.au/2012/01/procps-ng-version-3-3-2-released/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 06:21:48 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[procps]]></category>
		<category><![CDATA[Application programming interface]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://enc.com.au/?p=569</guid>
		<description><![CDATA[procps-ng version 3.3.2 was released today.  This version fixes some bugs introduced in version 3.3.1 as well as a number of enhancements. Below is the most significant set of changes that 3.3.2 brings. NLS The most visible change is that procps-ng is now international.  The NLS changes took a long windy path but we got [...]]]></description>
			<content:encoded><![CDATA[<p>procps-ng version 3.3.2 was released today.  This version fixes some bugs introduced in version 3.3.1 as well as a number of enhancements. Below is the most significant set of changes that 3.3.2 brings.
<h2>NLS</h2>
The most visible change is that procps-ng is now international.  The NLS changes took a long windy path but we got there in the end. This means all procps-ng programs can now use standard gettext PO files to output in any supported language.  While the programs have been enabled for translations, there are no po files as yet but we expect them to follow soon.
<h2>Library Changes</h2>
procps always had a &#8220;closed&#8221; library, meaning that it wasn&#8217;t supposed to be used for other non-procps programs.  This meant the library was always called libprocps-(version) rather than using a SONAME. Procps 3.3.2 now uses a SONAME of version 0.0.0 The API hasn&#8217;t changed but it will be in subsequent versions.
<h2>Patch Backporting</h2>
Due to the stagnant natute of procps development in the past, there have been a large number of patches each distribution carries for procps. A significant number of patches have been incorportated into procps-ng, giving a more consistent look across the distributions and meaning any subsquent fixes or enhancements are done in one place.  A major goal of procps-ng was to reduce the number of distribution specific patches which this change has helped greatly.
<h1><span class='bm_keywordlink'><a href="http://www.debian.org/">debian</a></span> Packages</h1>
The Debian packages will be worked on soon and will clear up some confusion about the procps binaries and library packages as this will now be split into two.  It also means that some programs that depend on libprocps will break, but going on from this point will be able to use the normal shlibs process to manage that, rather than the ugly crunch we will have now.</p>

<p>&nbsp;
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"></a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://enc.com.au/2012/01/procps-ng-version-3-3-2-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>When a dynamic library and program share functions</title>
		<link>http://enc.com.au/2011/12/when-a-dynamic-library-and-program-share-functions/</link>
		<comments>http://enc.com.au/2011/12/when-a-dynamic-library-and-program-share-functions/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 12:08:47 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[procps]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://enc.com.au/?p=562</guid>
		<description><![CDATA[This is about making procps have a proper library but it really is a generic sort of question.  Say you are making a library and a program that uses that library.  Now at times you may have convience type functions; procps has them for things like escaping command names or allocation different sorts of memory.  [...]]]></description>
			<content:encoded><![CDATA[<p>This is about making procps have a proper library but it really is a generic sort of question.  Say you are making a library and a program that uses that library.  Now at times you may have convience type functions; procps has them for things like escaping command names or allocation different sorts of memory.  Both the library and the programs use some of these functions.</p>

<p>Now, there seems only two approaches to this setup.  The first is to have the function stay in the library and for the program to call this function, just like all the other library functions.  But this means the library has exposed for all other programs that link to it and that doesn&#8217;t really make a lot of sense.</p>

<p>The second method is to have the functions defined in both places, perhaps in a file that is linked with the program and the library.  That seems to be duplicating the code in two different places.  Namespace collision could be a problem but that easily fixed with using some unqiue prefix.  I really don&#8217;t think having procfs<em>malloc, procfs</em>calloc and procfs_strdup are that useful.</p>

<p>I&#8217;m sure this sort of problem has been solved elsewhere.  Has anyone else come across this? The functions are simple utility type functions such as malloc a block of memory, if there is a problem print to stderr.</p>

<p>&nbsp;
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"></a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://enc.com.au/2011/12/when-a-dynamic-library-and-program-share-functions/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>procps-ng 3.3.1 released</title>
		<link>http://enc.com.au/2011/12/procps-ng-3-3-1-released/</link>
		<comments>http://enc.com.au/2011/12/procps-ng-3-3-1-released/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 11:59:33 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[procps]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Distributions]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenSUSE]]></category>
		<category><![CDATA[Pgrep]]></category>

		<guid isPermaLink="false">http://enc.com.au/?p=557</guid>
		<description><![CDATA[Procps-ng, the debian, Fedora and OpenSuSE fork of procps had another release today.  This is a bugfix release that fixes some important bugs that have cropped up in 3.3.0 pgrep crashes, pgrep -u not finding processes and a problem with top forest view have all been fixed. An important addition to this release is that [...]]]></description>
			<content:encoded><![CDATA[<p>Procps-ng, the <span class='bm_keywordlink'><a href="http://www.debian.org/">debian</a></span>, <a class="zem_slink" title="Fedora (operating system)" href="http://www.fedoraproject.org/" rel="homepage">Fedora</a> and <a class="zem_slink" title="OpenSUSE" href="http://www.opensuse.org" rel="homepage">OpenSuSE</a> fork of procps had another release today.  This is a bugfix release that fixes some important bugs that have cropped up in 3.3.0</p>

<p>pgrep crashes, pgrep -u not finding processes and a problem with top forest view have all been fixed.</p>

<p>An important addition to this release is that test scripts have now been added using the <a class="zem_slink" title="DejaGnu" href="http://www.gnu.org/software/dejagnu/" rel="homepage">Dejagnu</a> framework.  This framework tests most of the programs that ship with procps-ng.  There is only 100 tests so far and they are only tested for <a class="zem_slink" title="Linux architecture" href="http://en.wikipedia.org/wiki/Linux_architecture" rel="wikipedia">Linux architecture</a>, but we expect to increase this test count and sophistication with each release.</p>

<p>The test scripts even found long-present but unknown bugs in the package. For example, running ps with output flags around the signal masks work as expected in Linux, but fail on kFreeBSD.  This is due to the unusual output of the relevant lines on that architecture. This is not a new bug, bug has been around for quite some time; noone ever noticed (or reported) it.</p>

<p>&nbsp;</p>

<p>The <a class="zem_slink" title="Deb (file format)" href="http://en.wikipedia.org/wiki/Deb_%28file_format%29" rel="wikipedia">Debian package</a> has already been built and uploaded to the master FTP server.</p>

<p>Oh, and it is the first package with my new <a class="zem_slink" title="GNU Privacy Guard" href="http://www.gnupg.org/" rel="homepage">GPG</a> key!</p>

<p>&nbsp;</p>

<p>&nbsp;
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"></a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://enc.com.au/2011/12/procps-ng-3-3-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New procps 3.3.0 for Debian</title>
		<link>http://enc.com.au/2011/11/new-procps-3-3-0-for-debian/</link>
		<comments>http://enc.com.au/2011/11/new-procps-3-3-0-for-debian/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 12:01:35 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[procps]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating system]]></category>
		<category><![CDATA[Unit testing]]></category>

		<guid isPermaLink="false">http://enc.com.au/?p=555</guid>
		<description><![CDATA[Coming soon after the upstream procps 3.3.0 being released, the debian packages have been uploaded tonight.  The Debian packages have had the added benefit of being a day late by having a tiny 2 line patch to stop pgrep from crashing. One regression that is on purpose, watch is currently not 8-bit clean again until [...]]]></description>
			<content:encoded><![CDATA[<p>Coming soon after the upstream <a href="http://enc.com.au/2011/11/procps-ng-3-3-0-released/">procps 3.3.0 being released</a>, the <span class='bm_keywordlink'><a href="http://www.debian.org/">debian</a></span> packages have been uploaded tonight.  The Debian packages have had the added benefit of being a day late by having a tiny 2 line patch to stop <a class="zem_slink" title="Pgrep" href="http://en.wikipedia.org/wiki/Pgrep" rel="wikipedia">pgrep</a> from crashing.</p>

<p>One regression that is on purpose, watch is currently not 8-bit clean again until I can sort out how to get the linking right with the new build process.</p>

<p>&nbsp;
<h2>Testing Systems</h2>
The embarrassing problem with pgrep did start a discussion about testing, especially <a class="zem_slink" title="Regression testing" href="http://en.wikipedia.org/wiki/Regression_testing" rel="wikipedia">regression testing</a>.  I&#8217;ve recently started using <a class="zem_slink" title="Unit testing" href="http://en.wikipedia.org/wiki/Unit_testing" rel="wikipedia">unit testing</a> in my python programs and love the level of assurance those tests give me that I haven&#8217;t broken anything (to a degree anyhow). I&#8217;d really like to be able to type &#8220;make test&#8221; and have each of the programs run through a series of tests.</p>

<p>The problem with packages like procps (psmisc too) is that you really need to test the entire program, not just a stub, and that the program needs access to a know level of <a class="zem_slink" title="Procfs" href="http://en.wikipedia.org/wiki/Procfs" rel="wikipedia">/proc</a>.  The only thing I have seen that is even remotely what is needed is the bunch of scripts that <a class="zem_slink" title="GNU Core Utilities" href="http://www.gnu.org/software/coreutils/" rel="homepage">coreutils</a> uses which creates dummy files and directories to operate the commands on.  I expect we could do something similar with some scripts that create a known process but if anyone has a better idea about how to test a command line program let me know.
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"></a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://enc.com.au/2011/11/new-procps-3-3-0-for-debian/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>procps-ng 3.3.0 Released</title>
		<link>http://enc.com.au/2011/11/procps-ng-3-3-0-released/</link>
		<comments>http://enc.com.au/2011/11/procps-ng-3-3-0-released/#comments</comments>
		<pubDate>Sun, 20 Nov 2011 12:40:13 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[procps]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SUSE Linux distributions]]></category>

		<guid isPermaLink="false">http://enc.com.au/?p=551</guid>
		<description><![CDATA[Tonight procps-ng, a fork of procps by developers from Debian, Fedora and SuSE was released.  The main goal of the team for this release was to reduce the number of patches we all carry in our respective distributions and learn from each other.  As an added bonus, we had one of the original authors of [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight procps-ng, a fork of procps by developers from <a class="zem_slink" title="Debian" href="http://www.debian.org/" rel="homepage">Debian</a>, <a class="zem_slink" title="Fedora (operating system)" href="http://www.fedoraproject.org/" rel="homepage">Fedora</a> and <a class="zem_slink" title="openSUSE" href="http://www.opensuse.org/" rel="homepage">SuSE</a> was released.  The main goal of the team for this release was to reduce the number of patches we all carry in our respective distributions and learn from each other.  As an added bonus, we had one of the original authors of top, Jim, join the team and greatly enhance top.</p>

<p>While the upstream version is now released, the <span class='bm_keywordlink'><a href="http://www.debian.org/">debian</a></span> package is not quite ready to go as it involves removing a lot of patches and adjusting some others.  The build system is also now a reasonably standard (but different to previous) setup that means the packing scripts need adjusting.</p>

<p>The best place to find out what is different is the procps <a title="NRWS file" href="https://gitorious.org/procps/procps/blobs/master/NEWS">NEWS</a> file. The source code is available from Gitorious  at <a title="Procps at Gitorious" href="https://gitorious.org/procps">https://gitorious.org/procps</a>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
    <li class="zemanta-article-ul-li"><a href="http://noone.org/blog/English/Computer/Debian/CoolTools/watch.html">Useful but Unknown Unix Tools: watch</a> (noone.org)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"></a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://enc.com.au/2011/11/procps-ng-3-3-0-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

