<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/2.4.5" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Fernando J. Pereda</title>
		<link>http://blogs.gentoo.org/ferdy</link>
		<description></description>
		<language>en-US</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=2.4.5"/>
		<ttl>60</ttl>
				<item>
			<title>On "How can someone miss a meeting?"</title>
			<link>http://blogs.gentoo.org/ferdy/2008/05/16/on_how_can_someone_miss_a_meeting</link>
			<pubDate>Fri, 16 May 2008 18:57:37 +0000</pubDate>			<dc:creator>Fernando J. Pereda</dc:creator>
			<category domain="main">Gentoo</category>			<guid isPermaLink="false">1527@http://blogs.gentoo.org/</guid>
						<description>&lt;p&gt;Since Diego is deleting my comments from his moderation queue, I'll try to give my impression of his post here. But first I'll state my opinion on the matter.&lt;/p&gt;

&lt;p&gt;I think the Council made a mistake (admittedly, not a big one) by missing their latest meeting. And I don't particularly care about &lt;i&gt;why&lt;/i&gt; it happened. Also, I don't think they have to give either reasons or excuses, this kind of stuff might happen, and that's all.&lt;/p&gt;

&lt;p&gt;However, there's one reason the Council exists: because we all voted for what today is &lt;a href=&quot;http://www.gentoo.org/proj/en/glep/glep-0039.html&quot;&gt;GLEP39&lt;/a&gt; (which wasn't a GLEP by that time, as far as I recall). And said document states it clearly:&lt;/p&gt;

&lt;p&gt;&lt;q&gt;If &lt;b&gt;&lt;i&gt;any&lt;/i&gt;&lt;/b&gt; meeting has less than 50% attendance by council members, a new election for all places must be held within a month. The 'one year' is then reset from that point.&lt;/q&gt;&lt;/p&gt;

&lt;p&gt;There is no point in &lt;b&gt;enforcing&lt;/b&gt; such a rule when Council members are late even for half an hour (or even a couple of hours). But there is no enforcing here, you guys missed the meeting, rules say you have to call an election. Hell, those of you who got my vote will get it again. (And I'm quite sure that's the situation for lots of people).&lt;/p&gt;

&lt;p&gt;Just follow the rules that give you the &lt;i&gt;power&lt;/i&gt; you have.&lt;/p&gt;

&lt;p&gt;However, I find it interesting that Diego, who is a Council member, didn't read the summary of that meeting:&lt;/p&gt;

&lt;q&gt;Did I read summary or log the day after? Sincerely, no. I did think I was there till the end, as we were already late, and I don&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.gentoo.org/ferdy/2008/05/16/on_how_can_someone_miss_a_meeting&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>Since Diego is deleting my comments from his moderation queue, I'll try to give my impression of his post here. But first I'll state my opinion on the matter.</p>

<p>I think the Council made a mistake (admittedly, not a big one) by missing their latest meeting. And I don't particularly care about <i>why</i> it happened. Also, I don't think they have to give either reasons or excuses, this kind of stuff might happen, and that's all.</p>

<p>However, there's one reason the Council exists: because we all voted for what today is <a href="http://www.gentoo.org/proj/en/glep/glep-0039.html">GLEP39</a> (which wasn't a GLEP by that time, as far as I recall). And said document states it clearly:</p>

<p><q>If <b><i>any</i></b> meeting has less than 50% attendance by council members, a new election for all places must be held within a month. The 'one year' is then reset from that point.</q></p>

<p>There is no point in <b>enforcing</b> such a rule when Council members are late even for half an hour (or even a couple of hours). But there is no enforcing here, you guys missed the meeting, rules say you have to call an election. Hell, those of you who got my vote will get it again. (And I'm quite sure that's the situation for lots of people).</p>

<p>Just follow the rules that give you the <i>power</i> you have.</p>

<p>However, I find it interesting that Diego, who is a Council member, didn't read the summary of that meeting:</p>

<q>Did I read summary or log the day after? Sincerely, no. I did think I was there till the end, as we were already late, and I don<div class="item_footer"><p><small><a href="http://blogs.gentoo.org/ferdy/2008/05/16/on_how_can_someone_miss_a_meeting">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.gentoo.org/ferdy/2008/05/16/on_how_can_someone_miss_a_meeting#comments</comments>
		</item>
				<item>
			<title>Slacker Council</title>
			<link>http://blogs.gentoo.org/ferdy/2008/05/15/slacker_council</link>
			<pubDate>Thu, 15 May 2008 20:44:55 +0000</pubDate>			<dc:creator>Fernando J. Pereda</dc:creator>
			<category domain="main">Gentoo</category>			<guid isPermaLink="false">1524@http://blogs.gentoo.org/</guid>
						<description>&lt;p&gt;As per &lt;a href=&quot;http://archives.gentoo.org/gentoo-dev/msg_19892c04f0e6cf4c24629f13718e45cb.xml&quot;&gt;http://archives.gentoo.org/gentoo-dev/msg_19892c04f0e6cf4c24629f13718e45cb.xml&lt;/a&gt; there was a meeting council scheduled for 20:00 UTC today (that's a bit more than half an hour ago).&lt;/p&gt;

&lt;p&gt;For some reason, only amne and dberkholz showed up. As per &lt;a href=&quot;http://www.gentoo.org/proj/en/glep/glep-0039.html&quot;&gt;GLEP39&lt;/a&gt;'s &lt;b&gt;Specification&lt;/b&gt;:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;If any meeting has less than 50% attendance by council members, a new election for &lt;i&gt;all&lt;/i&gt; places must be held within a month. The 'one year' is then reset from that point.&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;What's the council going to do? Place your bets.&lt;/p&gt;

&lt;p&gt;&amp;mdash; ferdy&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.gentoo.org/ferdy/2008/05/15/slacker_council&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>As per <a href="http://archives.gentoo.org/gentoo-dev/msg_19892c04f0e6cf4c24629f13718e45cb.xml">http://archives.gentoo.org/gentoo-dev/msg_19892c04f0e6cf4c24629f13718e45cb.xml</a> there was a meeting council scheduled for 20:00 UTC today (that's a bit more than half an hour ago).</p>

<p>For some reason, only amne and dberkholz showed up. As per <a href="http://www.gentoo.org/proj/en/glep/glep-0039.html">GLEP39</a>'s <b>Specification</b>:</p>

<ul><li>If any meeting has less than 50% attendance by council members, a new election for <i>all</i> places must be held within a month. The 'one year' is then reset from that point.</li></ul>

<p>What's the council going to do? Place your bets.</p>

<p>&mdash; ferdy</p><div class="item_footer"><p><small><a href="http://blogs.gentoo.org/ferdy/2008/05/15/slacker_council">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.gentoo.org/ferdy/2008/05/15/slacker_council#comments</comments>
		</item>
				<item>
			<title>On cooperating and paludis vulnerability</title>
			<link>http://blogs.gentoo.org/ferdy/2008/05/03/on_cooperating_and_paludis_vulnerability</link>
			<pubDate>Sat, 03 May 2008 22:24:10 +0000</pubDate>			<dc:creator>Fernando J. Pereda</dc:creator>
			<category domain="main">Gentoo</category>			<guid isPermaLink="false">1518@http://blogs.gentoo.org/</guid>
						<description>&lt;p&gt;A serious security issue in paludis was brought to my attention recently, and I feel I should make you all aware. Apparently someone, with root access to a machine, can gain root access by installing or editing paludis config files.&lt;/p&gt;

&lt;p&gt;For those interested, this is how it happened (times are GMT+1):&lt;/p&gt;

&lt;pre&gt;22:34 &amp;lt;@ferdy&amp;gt; bonsaikitten: can you give me any details regarding that
 security bug in paludis?
22:35 &amp;lt;+bonsaikitten&amp;gt; ferdy: it's so obvious you should have found it already
22:37 &amp;lt;@ferdy&amp;gt; bonsaikitten: I should, but I probably haven't
22:37 &amp;lt;+bonsaikitten&amp;gt; ferdy: well, as I am a moron I'm unable to coherently explain :)
22:37 &amp;lt;@ferdy&amp;gt; bonsaikitten: I mean, depends on whether we are talking about
a real security issue or about something we should document to avoid people
shooting themselves in the foot
22:39 &amp;lt;@ferdy&amp;gt; bonsaikitten: is that all you are going to tell me?
22:39 &amp;lt;+bonsaikitten&amp;gt; ferdy: come on, it's obvious. You're supposed to be smart ...
22:39 * bonsaikitten is not in a mood to explain
22:40 &amp;lt;@ferdy&amp;gt; bonsaikitten: you aren't really talking about the paludisbuild issue, are you?
22:41 &amp;lt;+bonsaikitten&amp;gt; mmh no, that's a different one
22:41 &amp;lt;@ferdy&amp;gt; k
22:41 &amp;lt;@ferdy&amp;gt; bonsaikitten: what are we talking about?
22:42 &amp;lt;@ferdy&amp;gt; bonsaikitten: you don't need to explain it... just say, in general 
terms, what the issue is
22:50 &amp;lt;@ferdy&amp;gt; bonsaikitten: so? care to give any useful hint?
22:50 &amp;lt;+bonsaikitten&amp;gt; ferdy: doesn't happen in portage compatibility mode
22:51 &amp;lt;+bonsaikitten&amp;gt; but I blame the vodka, hard to explain when *burp* *giggle*
22:52 &amp;lt;@ferdy&amp;gt; bonsaikitten: what's the impact?
22:53 &amp;lt;+bonsaikitten&amp;gt; ferdy: depends on how annoying the other person is
22:54 &amp;lt;+bonsaikitten&amp;gt; ferdy: worst case random file modification
22:58 &amp;lt;@ferdy&amp;gt; bonsaikitten: and we already agreed that we aren't talking about
the paludisbuild issue, right?
22:59 &amp;lt;@ferdy&amp;gt; bonsaikitten: if we aren't, I'll need more hints....
23:05 &amp;lt;@ferdy&amp;gt; bonsaikitten: can I get an attack vector?
23:05 &amp;lt;@ferdy&amp;gt; that shouldn't need lots of explaining... I can figure out that
part myself
23:19 &amp;lt;@ferdy&amp;gt; bonsaikitten: have you got that attack vector for me?
23:24 &amp;lt;+bonsaikitten&amp;gt; ferdy: look at configuration files, maybe you notice that
there's some exquisit code execution possible there
23:29 &amp;lt;@ferdy&amp;gt; bonsaikitten: you mean those config files that only root can
edit? I must be missing something here
23:29 &amp;lt;+bonsaikitten&amp;gt; ferdy: you are :)
23:29 &amp;lt;+bonsaikitten&amp;gt; not much, and it's basically the same flaw bashrc is
for portage
23:29 &amp;lt;+bonsaikitten&amp;gt; only that bashrc is config_protect'ed ...
23:30 &amp;lt;@ferdy&amp;gt; bonsaikitten: but for a package to clover those files, it must be
in a repo root added, right?
23:31 &amp;lt;+bonsaikitten&amp;gt; someone in the package mangler group, but yes
23:35 &amp;lt;@ferdy&amp;gt; bonsaikitten: but if you can change those files in the first place,
why clover them by adding a malicious repo with a malicious package that changes
those files?
23:35 &amp;lt;+bonsaikitten&amp;gt; ferdy: because it's very subtle
23:36 &amp;lt;@ferdy&amp;gt; moreover, if you can already do that, why not just make the
package install whatever backdoor you want?
23:37 &amp;lt;@ferdy&amp;gt; I mean, it is subtle, but why would anyone go the 'convoluted'
route? he is already able to edit those files (since he had to add that repo)
23:38 &amp;lt;+bonsaikitten&amp;gt; 'cause only paludis is affected and you will find it very
hard to trace
23:38 &amp;lt;+bonsaikitten&amp;gt; that makes it so tempting ...
23:40 &amp;lt;+bonsaikitten&amp;gt; just don't be surprised if it suddenly unmerges itself :)
23:41 &amp;lt;@ferdy&amp;gt; yeah... well...
23:41 &amp;lt;@ferdy&amp;gt; bonsaikitten: mind if I disclose this vulnerability in
 planet.gentoo.org?
23:42 &amp;lt;+bonsaikitten&amp;gt; go ahead
23:42 &amp;lt;@ferdy&amp;gt; ta
23:42 &amp;lt;+bonsaikitten&amp;gt; 't is even on the features page of the package mangler :)&lt;/pre&gt;

&lt;p&gt;This is a good lesson to learn today:&lt;/p&gt;

&lt;p&gt;&lt;cite&gt;If you can edit files owned by root in a machine, you can get root access to that machine.&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;So the bottom line is: There is no vulnerability, if you can mangle paludis config files, you are already root so you don't need to edit a file to run any command you want. Another lesson one can learn by reading that log is how to be really cooperative.&lt;/p&gt;

&lt;p&gt;Ah, and before someone with a need to use cheap psychology asks, the intention of this blag post is to stop the &lt;a href=&quot;http://gentooexperimental.org/~patrick/weblog/archives/2008-05.html#e2008-05-03T21_04_56.txt&quot;&gt;FUD&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;- ferdy&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.gentoo.org/ferdy/2008/05/03/on_cooperating_and_paludis_vulnerability&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>A serious security issue in paludis was brought to my attention recently, and I feel I should make you all aware. Apparently someone, with root access to a machine, can gain root access by installing or editing paludis config files.</p>

<p>For those interested, this is how it happened (times are GMT+1):</p>

<pre>22:34 &lt;@ferdy&gt; bonsaikitten: can you give me any details regarding that
 security bug in paludis?
22:35 &lt;+bonsaikitten&gt; ferdy: it's so obvious you should have found it already
22:37 &lt;@ferdy&gt; bonsaikitten: I should, but I probably haven't
22:37 &lt;+bonsaikitten&gt; ferdy: well, as I am a moron I'm unable to coherently explain :)
22:37 &lt;@ferdy&gt; bonsaikitten: I mean, depends on whether we are talking about
a real security issue or about something we should document to avoid people
shooting themselves in the foot
22:39 &lt;@ferdy&gt; bonsaikitten: is that all you are going to tell me?
22:39 &lt;+bonsaikitten&gt; ferdy: come on, it's obvious. You're supposed to be smart ...
22:39 * bonsaikitten is not in a mood to explain
22:40 &lt;@ferdy&gt; bonsaikitten: you aren't really talking about the paludisbuild issue, are you?
22:41 &lt;+bonsaikitten&gt; mmh no, that's a different one
22:41 &lt;@ferdy&gt; k
22:41 &lt;@ferdy&gt; bonsaikitten: what are we talking about?
22:42 &lt;@ferdy&gt; bonsaikitten: you don't need to explain it... just say, in general 
terms, what the issue is
22:50 &lt;@ferdy&gt; bonsaikitten: so? care to give any useful hint?
22:50 &lt;+bonsaikitten&gt; ferdy: doesn't happen in portage compatibility mode
22:51 &lt;+bonsaikitten&gt; but I blame the vodka, hard to explain when *burp* *giggle*
22:52 &lt;@ferdy&gt; bonsaikitten: what's the impact?
22:53 &lt;+bonsaikitten&gt; ferdy: depends on how annoying the other person is
22:54 &lt;+bonsaikitten&gt; ferdy: worst case random file modification
22:58 &lt;@ferdy&gt; bonsaikitten: and we already agreed that we aren't talking about
the paludisbuild issue, right?
22:59 &lt;@ferdy&gt; bonsaikitten: if we aren't, I'll need more hints....
23:05 &lt;@ferdy&gt; bonsaikitten: can I get an attack vector?
23:05 &lt;@ferdy&gt; that shouldn't need lots of explaining... I can figure out that
part myself
23:19 &lt;@ferdy&gt; bonsaikitten: have you got that attack vector for me?
23:24 &lt;+bonsaikitten&gt; ferdy: look at configuration files, maybe you notice that
there's some exquisit code execution possible there
23:29 &lt;@ferdy&gt; bonsaikitten: you mean those config files that only root can
edit? I must be missing something here
23:29 &lt;+bonsaikitten&gt; ferdy: you are :)
23:29 &lt;+bonsaikitten&gt; not much, and it's basically the same flaw bashrc is
for portage
23:29 &lt;+bonsaikitten&gt; only that bashrc is config_protect'ed ...
23:30 &lt;@ferdy&gt; bonsaikitten: but for a package to clover those files, it must be
in a repo root added, right?
23:31 &lt;+bonsaikitten&gt; someone in the package mangler group, but yes
23:35 &lt;@ferdy&gt; bonsaikitten: but if you can change those files in the first place,
why clover them by adding a malicious repo with a malicious package that changes
those files?
23:35 &lt;+bonsaikitten&gt; ferdy: because it's very subtle
23:36 &lt;@ferdy&gt; moreover, if you can already do that, why not just make the
package install whatever backdoor you want?
23:37 &lt;@ferdy&gt; I mean, it is subtle, but why would anyone go the 'convoluted'
route? he is already able to edit those files (since he had to add that repo)
23:38 &lt;+bonsaikitten&gt; 'cause only paludis is affected and you will find it very
hard to trace
23:38 &lt;+bonsaikitten&gt; that makes it so tempting ...
23:40 &lt;+bonsaikitten&gt; just don't be surprised if it suddenly unmerges itself :)
23:41 &lt;@ferdy&gt; yeah... well...
23:41 &lt;@ferdy&gt; bonsaikitten: mind if I disclose this vulnerability in
 planet.gentoo.org?
23:42 &lt;+bonsaikitten&gt; go ahead
23:42 &lt;@ferdy&gt; ta
23:42 &lt;+bonsaikitten&gt; 't is even on the features page of the package mangler :)</pre>

<p>This is a good lesson to learn today:</p>

<p><cite>If you can edit files owned by root in a machine, you can get root access to that machine.</cite></p>

<p>So the bottom line is: There is no vulnerability, if you can mangle paludis config files, you are already root so you don't need to edit a file to run any command you want. Another lesson one can learn by reading that log is how to be really cooperative.</p>

<p>Ah, and before someone with a need to use cheap psychology asks, the intention of this blag post is to stop the <a href="http://gentooexperimental.org/~patrick/weblog/archives/2008-05.html#e2008-05-03T21_04_56.txt">FUD</a>.</p>

<p>- ferdy</p><div class="item_footer"><p><small><a href="http://blogs.gentoo.org/ferdy/2008/05/03/on_cooperating_and_paludis_vulnerability">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.gentoo.org/ferdy/2008/05/03/on_cooperating_and_paludis_vulnerability#comments</comments>
		</item>
				<item>
			<title>When you think you've seen everything...</title>
			<link>http://blogs.gentoo.org/ferdy/2008/04/28/when_you_think_you_ve_seen_everything</link>
			<pubDate>Mon, 28 Apr 2008 08:07:11 +0000</pubDate>			<dc:creator>Fernando J. Pereda</dc:creator>
			<category domain="main">Gentoo</category>
<category domain="alt">Rants</category>			<guid isPermaLink="false">1513@http://blogs.gentoo.org/</guid>
						<description>&lt;p&gt;...you get up, fire your mail client just to find:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://bugs.gentoo.org/show_bug.cgi?id=64840&quot;&gt;https://bugs.gentoo.org/show_bug.cgi?id=64840&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://bugs.gentoo.org/show_bug.cgi?id=168573&quot;&gt;https://bugs.gentoo.org/show_bug.cgi?id=168573&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://bugs.gentoo.org/show_bug.cgi?id=161368&quot;&gt;https://bugs.gentoo.org/show_bug.cgi?id=161368&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please take the time to read those 'Excerpts', they are really enlightening. Politics is so much fun.&lt;/p&gt;

&lt;p&gt;Some facts:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;All of them work in Paludis&lt;/li&gt;
  &lt;li&gt;Some of them have been vocal against how #gentoo and forums.gentoo.org are managed and its politics.&lt;/li&gt;
  &lt;li&gt;Using the image I posted yesterday as an avatar is one of the reasons one of them got the boot.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wonder who is going to be next. I also wonder who 'started' the process. It is difficult to know, because the bug is restricted ( &lt;a href=&quot;https://bugs.gentoo.org/show_bug.cgi?id=216219&quot;&gt;https://bugs.gentoo.org/show_bug.cgi?id=216219&lt;/a&gt; ).&lt;/p&gt;

&lt;p&gt;Way to go Gentoo. No love for you today.&lt;/p&gt;

&lt;p&gt;- ferdy&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.gentoo.org/ferdy/2008/04/28/when_you_think_you_ve_seen_everything&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>...you get up, fire your mail client just to find:</p>

<p><a href="https://bugs.gentoo.org/show_bug.cgi?id=64840">https://bugs.gentoo.org/show_bug.cgi?id=64840</a><br />
<a href="https://bugs.gentoo.org/show_bug.cgi?id=168573">https://bugs.gentoo.org/show_bug.cgi?id=168573</a><br />
<a href="https://bugs.gentoo.org/show_bug.cgi?id=161368">https://bugs.gentoo.org/show_bug.cgi?id=161368</a></p>

<p>Please take the time to read those 'Excerpts', they are really enlightening. Politics is so much fun.</p>

<p>Some facts:</p>

<ul>
  <li>All of them work in Paludis</li>
  <li>Some of them have been vocal against how #gentoo and forums.gentoo.org are managed and its politics.</li>
  <li>Using the image I posted yesterday as an avatar is one of the reasons one of them got the boot.</li>
</ul>

<p>I wonder who is going to be next. I also wonder who 'started' the process. It is difficult to know, because the bug is restricted ( <a href="https://bugs.gentoo.org/show_bug.cgi?id=216219">https://bugs.gentoo.org/show_bug.cgi?id=216219</a> ).</p>

<p>Way to go Gentoo. No love for you today.</p>

<p>- ferdy</p><div class="item_footer"><p><small><a href="http://blogs.gentoo.org/ferdy/2008/04/28/when_you_think_you_ve_seen_everything">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.gentoo.org/ferdy/2008/04/28/when_you_think_you_ve_seen_everything#comments</comments>
		</item>
				<item>
			<title>Doing It Wrong</title>
			<link>http://blogs.gentoo.org/ferdy/2008/04/27/doing_it_wrong</link>
			<pubDate>Sun, 27 Apr 2008 19:39:16 +0000</pubDate>			<dc:creator>Fernando J. Pereda</dc:creator>
			<category domain="main">Gentoo</category>
<category domain="alt">Rants</category>			<guid isPermaLink="false">1511@http://blogs.gentoo.org/</guid>
						<description>&lt;p&gt;I hear this image got someone a Developer Relations complain. Way to go, Gentoo. Way to go.&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src=&quot;http://forums.gentoo.org/images/avatars/150511225947d5a05181db1.png&quot; /&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;You are clearly doing it wrong.&lt;/p&gt;

&lt;p&gt;(For those that aren't aware of this rather old issue: have &lt;a href=&quot;http://forums.gentoo.org/viewtopic-t-480537.html&quot;&gt;fun&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;- ferdy&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.gentoo.org/ferdy/2008/04/27/doing_it_wrong&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>I hear this image got someone a Developer Relations complain. Way to go, Gentoo. Way to go.</p>

<p><center><img src="http://forums.gentoo.org/images/avatars/150511225947d5a05181db1.png" /></center></p>

<p>You are clearly doing it wrong.</p>

<p>(For those that aren't aware of this rather old issue: have <a href="http://forums.gentoo.org/viewtopic-t-480537.html">fun</a>).</p>

<p>- ferdy</p><div class="item_footer"><p><small><a href="http://blogs.gentoo.org/ferdy/2008/04/27/doing_it_wrong">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.gentoo.org/ferdy/2008/04/27/doing_it_wrong#comments</comments>
		</item>
				<item>
			<title>From yoswink: 1st Technological days of Isla Cristina</title>
			<link>http://blogs.gentoo.org/ferdy/2008/04/13/from_yoswink_1st_technological_days_of_i</link>
			<pubDate>Sun, 13 Apr 2008 12:44:44 +0000</pubDate>			<dc:creator>Fernando J. Pereda</dc:creator>
			<category domain="main">Gentoo</category>			<guid isPermaLink="false">1498@http://blogs.gentoo.org/</guid>
						<description>&lt;p&gt;I'm proxy-posting this to Gentoo Planet from yoswink:&lt;/p&gt;

&lt;p&gt;---&lt;/p&gt;

&lt;p&gt;During the last week, the people of &lt;a href=&quot;http://www.terra.es/personal/xilcar/&quot;&gt;Isla Cristina&lt;/a&gt;  (a beautiful town in the Atlantic coast with probably the best beaches of all Spain) organized an event called &lt;a href=&quot;http://www.iesmirabent.com/jornadas/index2.html&quot;&gt;'1st Technological days of Isla Cristina'&lt;/a&gt;. They invited me to participate and give a talk about Gentoo.&lt;/p&gt;

&lt;p&gt;On Friday I was there explaining what makes our distribution different, what the 'All about choice' is and the technology behind it. I shared the day with Spanish developers of other open source projects such as &lt;a href=&quot;http://www.openbsd.org&quot;&gt;OpenBSD&lt;/a&gt;, &lt;a href=&quot;http://www.netbsd.org&quot;&gt;NetBSD&lt;/a&gt; and &lt;a href=&quot;http://www.kde.org&quot;&gt;KDE&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The day organization was perfect, any more to say, it couldn't be better. I want to thanks the people (teachers and students) from &lt;a href=&quot;http://iesmirabent.com/enlaces.html&quot;&gt;IES Mirabent&lt;/a&gt;, who fought to make this idea a reality in a small town of 22k people (is not so common to find this kind of event in Spain with official devs from big OSS projects even in the big cities or universities), and to the youth department of Isla Cristina for all they have done for me.&lt;/p&gt;

&lt;p&gt;If someone want to take an example about how an event should treat a lecturer, please contact with them.&lt;/p&gt;

&lt;p&gt;P.D: thanks to Julio Merio from NetBSD for lending me the computer (I forgot the damn Mini-DVI cable) and sorry to Antonio Larrosa from KDE, I ate some minutes of his time :(&lt;/p&gt;

&lt;p&gt;---&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.gentoo.org/ferdy/2008/04/13/from_yoswink_1st_technological_days_of_i&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>I'm proxy-posting this to Gentoo Planet from yoswink:</p>

<p>---</p>

<p>During the last week, the people of <a href="http://www.terra.es/personal/xilcar/">Isla Cristina</a>  (a beautiful town in the Atlantic coast with probably the best beaches of all Spain) organized an event called <a href="http://www.iesmirabent.com/jornadas/index2.html">'1st Technological days of Isla Cristina'</a>. They invited me to participate and give a talk about Gentoo.</p>

<p>On Friday I was there explaining what makes our distribution different, what the 'All about choice' is and the technology behind it. I shared the day with Spanish developers of other open source projects such as <a href="http://www.openbsd.org">OpenBSD</a>, <a href="http://www.netbsd.org">NetBSD</a> and <a href="http://www.kde.org">KDE</a>.</p>

<p>The day organization was perfect, any more to say, it couldn't be better. I want to thanks the people (teachers and students) from <a href="http://iesmirabent.com/enlaces.html">IES Mirabent</a>, who fought to make this idea a reality in a small town of 22k people (is not so common to find this kind of event in Spain with official devs from big OSS projects even in the big cities or universities), and to the youth department of Isla Cristina for all they have done for me.</p>

<p>If someone want to take an example about how an event should treat a lecturer, please contact with them.</p>

<p>P.D: thanks to Julio Merio from NetBSD for lending me the computer (I forgot the damn Mini-DVI cable) and sorry to Antonio Larrosa from KDE, I ate some minutes of his time :(</p>

<p>---</p><div class="item_footer"><p><small><a href="http://blogs.gentoo.org/ferdy/2008/04/13/from_yoswink_1st_technological_days_of_i">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.gentoo.org/ferdy/2008/04/13/from_yoswink_1st_technological_days_of_i#comments</comments>
		</item>
				<item>
			<title>On tool boxes</title>
			<link>http://blogs.gentoo.org/ferdy/2008/01/15/on_tool_boxes</link>
			<pubDate>Tue, 15 Jan 2008 10:12:00 +0000</pubDate>			<dc:creator>Fernando J. Pereda</dc:creator>
			<category domain="main">Gentoo</category>			<guid isPermaLink="false">1450@http://blogs.gentoo.org/</guid>
						<description>&lt;p&gt;Apparently, people are bashing Joshua Jackson (a.k.a. tsunam) for posting his opinion (which happens to be shared among lots of us). So just in case someone hasn't read what he said yet, I'm going to link his posts here. Please, do read them:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://tsunam.org/2008/01/12/in-response/&quot;&gt;http://tsunam.org/2008/01/12/in-response/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://tsunam.org/2008/01/14/clarifications/&quot;&gt;http://tsunam.org/2008/01/14/clarifications/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://tsunam.org/2008/01/14/tool-box/&quot;&gt;http://tsunam.org/2008/01/14/tool-box/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I simply can't trust Daniel Robbins after what he tried to do the last time he tried to come back. Has everybody forgotten that? I hope not.&lt;/p&gt;

&lt;p&gt;No love.&lt;/p&gt;

&lt;p&gt;- ferdy&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.gentoo.org/ferdy/2008/01/15/on_tool_boxes&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>Apparently, people are bashing Joshua Jackson (a.k.a. tsunam) for posting his opinion (which happens to be shared among lots of us). So just in case someone hasn't read what he said yet, I'm going to link his posts here. Please, do read them:</p>

<p><a href="http://tsunam.org/2008/01/12/in-response/">http://tsunam.org/2008/01/12/in-response/</a><br />
<a href="http://tsunam.org/2008/01/14/clarifications/">http://tsunam.org/2008/01/14/clarifications/</a><br />
<a href="http://tsunam.org/2008/01/14/tool-box/">http://tsunam.org/2008/01/14/tool-box/</a></p>

<p>I simply can't trust Daniel Robbins after what he tried to do the last time he tried to come back. Has everybody forgotten that? I hope not.</p>

<p>No love.</p>

<p>- ferdy</p><div class="item_footer"><p><small><a href="http://blogs.gentoo.org/ferdy/2008/01/15/on_tool_boxes">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.gentoo.org/ferdy/2008/01/15/on_tool_boxes#comments</comments>
		</item>
				<item>
			<title>Paludis meets Java, part III</title>
			<link>http://blogs.gentoo.org/ferdy/2007/11/28/paludis_meets_java_part_iii</link>
			<pubDate>Wed, 28 Nov 2007 21:14:28 +0000</pubDate>			<dc:creator>Fernando J. Pereda</dc:creator>
			<category domain="main">Gentoo</category>
<category domain="alt">Programming</category>			<guid isPermaLink="false">1434@http://blogs.gentoo.org/</guid>
						<description>&lt;p&gt;Once we've converted native types we face the task of converting arbitrary classes and types. Another thing we'll need is extract the C++ type of a Java object (&lt;tt&gt;jobject&lt;/tt&gt; in JNI).&lt;/p&gt;

&lt;p&gt;For that task, we will follow the convention of calling the native pointers in Java classes &lt;tt&gt;_ptr&lt;/tt&gt;. With that, we can define the following templates:&lt;/p&gt;

&lt;pre&gt;template &amp;lt;typename T_&amp;gt;
inline T_ * get_native_ptr(JNIEnv * env, const char * const class_name, jobject obj)
{
    jclass cls(env-&amp;gt;FindClass(class_name));
    jfieldID ptr_field(env-&amp;gt;GetFieldID(cls, &quot;_ptr&quot;, &quot;J&quot;));
    jlong ptr(env-&amp;gt;GetLongField(obj, ptr_field));
    env-&amp;gt;DeleteLocalRef(cls);
    return from_java_ptr&amp;lt;T_&amp;gt;(ptr);
}

template &amp;lt;typename T_&amp;gt;
inline tr1::shared_ptr&amp;lt;T_&amp;gt; get_native_sptr(JNIEnv * env, const char * const class_name, jobject obj)
{
    jclass cls(env-&amp;gt;FindClass(class_name));
    jfieldID ptr_field(env-&amp;gt;GetFieldID(cls, &quot;_ptr&quot;, &quot;J&quot;));
    jlong ptr(env-&amp;gt;GetLongField(obj, ptr_field));
    env-&amp;gt;DeleteLocalRef(cls);
    return from_java_ptr_sptr&amp;lt;T_&amp;gt;(ptr);
}&lt;/pre&gt;

&lt;p&gt;This should really be doing more error checking, but it is good enough for ilustrating how nice are things when using proper tools (both languages and libraries).&lt;/p&gt;

&lt;p&gt;Converting arbitrary types also uses some template magic:&lt;/p&gt;

&lt;pre&gt;template &amp;lt;typename T_&amp;gt;
struct NativeToJavaTypeMapper
{
    jobject operator() (JNIEnv *, const T_ &amp;amp;);
};&lt;/pre&gt;

&lt;p&gt;Now we need specializations for each type we want to convert, for instance, converting a paludis' &lt;tt&gt;FSEntry&lt;/tt&gt; into a &lt;tt&gt;java.io.File&lt;/tt&gt; looks like the following:&lt;/p&gt;

&lt;pre&gt;template&amp;lt;&amp;gt;
struct NativeToJavaTypeMapper&amp;lt;FSEntry&amp;gt;
{
    jobject operator() (JNIEnv * env, const FSEntry &amp;amp; f)
    {
        jclass cls(env-&amp;gt;FindClass(&quot;java/io/File&quot;));
        jmethodID constructor(env-&amp;gt;GetMethodID(cls, &quot;&amp;lt;init&amp;gt;&quot;, &quot;(Ljava/lang/String;)V&quot;));
        jobject ret(env-&amp;gt;NewObject(cls, constructor, to_java_string(env, stringify(f))));
        env-&amp;gt;DeleteLocalRef(cls);
        return ret;
    }
};&lt;/pre&gt;

&lt;p&gt;Neat and clean.&lt;/p&gt;

&lt;p&gt;For containers, a &lt;tt&gt;java.util.LinkedList&lt;/tt&gt; would be used for paludis' &lt;tt&gt;Sequence&lt;/tt&gt;; and &lt;tt&gt;java.util.TreeSet&lt;/tt&gt; for paludis' &lt;tt&gt;Set&lt;/tt&gt;:&lt;/p&gt;

&lt;pre&gt;template &amp;lt;typename T_, typename It_&amp;gt;
jobject range_to_list(JNIEnv * env, It_ begin, It_ end)
{
    jclass list_class(env-&amp;gt;FindClass(&quot;java/util/LinkedList&quot;));
    jmethodID constructor(env-&amp;gt;GetMethodID(list_class, &quot;&amp;lt;init&amp;gt;&quot;, &quot;()V&quot;));
    jobject our_list(env-&amp;gt;NewObject(list_class, constructor));
    jmethodID add_method(env-&amp;gt;GetMethodID(list_class, &quot;add&quot;, &quot;(Ljava/lang/Object;)Z&quot;));

    for (It_ i(begin) ; i != end ; ++i)
        env-&amp;gt;CallBooleanMethod(our_list, add_method, NativeToJavaTypeMapper&amp;lt;T_&amp;gt;()(env, *i));

    env-&amp;gt;DeleteLocalRef(list_class);

    return our_list;
}

template &amp;lt;typename T_, typename It_&amp;gt;
jobject range_to_set(JNIEnv * env, It_ begin, It_ end)
{
    jclass set_class(env-&amp;gt;FindClass(&quot;java/util/TreeSet&quot;));
    jmethodID constructor(env-&amp;gt;GetMethodID(set_class, &quot;&amp;lt;init&amp;gt;&quot;, &quot;()V&quot;));
    jobject our_set(env-&amp;gt;NewObject(set_class, constructor));
    jmethodID add_method(env-&amp;gt;GetMethodID(set_class, &quot;add&quot;, &quot;(Ljava/lang/Object;)Z&quot;));

    for (It_ i(begin) ; i != end ; ++i)
        env-&amp;gt;CallBooleanMethod(our_set, add_method, NativeToJavaTypeMapper&amp;lt;T_&amp;gt;()(env, *i));

    env-&amp;gt;DeleteLocalRef(set_class);

    return our_set;
}&lt;/pre&gt;

&lt;p&gt;And now defining &lt;tt&gt;NativeToJavaTypeMapper&lt;/tt&gt; specializations for containers is quite easy:&lt;/p&gt;

&lt;pre&gt;template&amp;lt;&amp;gt;
template &amp;lt;typename T_&amp;gt;
struct NativeToJavaTypeMapper&amp;lt;tr1::shared_ptr&amp;lt;const Sequence&amp;lt;T_&amp;gt; &amp;gt; &amp;gt;
{
    jobject operator() (JNIEnv * env, const tr1::shared_ptr&amp;lt;const Sequence&amp;lt;T_&amp;gt; &amp;gt; &amp;amp; s)
    {
        return range_to_list&amp;lt;T_&amp;gt;(env, s-&amp;gt;begin(), s-&amp;gt;end());
    }
};

template&amp;lt;&amp;gt;
template &amp;lt;typename T_&amp;gt;
struct NativeToJavaTypeMapper&amp;lt;tr1::shared_ptr&amp;lt;const Set&amp;lt;T_&amp;gt; &amp;gt; &amp;gt;
{
    jobject operator() (JNIEnv * env, const tr1::shared_ptr&amp;lt;const Set&amp;lt;T_&amp;gt; &amp;gt; &amp;amp; s)
    {
        return range_to_set&amp;lt;T_&amp;gt;(env, s-&amp;gt;begin(), s-&amp;gt;end());
    }
};&lt;/pre&gt;

&lt;p&gt;I've spent a fair amount of the time fighting with make and the build system. It looks mostly sane now, though.&lt;/p&gt;

&lt;p&gt;Dealing with exceptions has been a bit tricky, however, I think I have a good &lt;i&gt;system&lt;/i&gt; to deal with it now, even  though Ciaran tagged it as &lt;i&gt;icky&lt;/i&gt; and &lt;i&gt;ugly&lt;/i&gt; &lt;tt&gt;&lt;img src=&quot;http://blogs.gentoo.org/rsc/smilies/icon_smile.gif&quot; alt=&quot;&amp;#58;&amp;#41;&quot; class=&quot;middle&quot; /&gt;&lt;/tt&gt;. That'd be the topic of the next part of the series.&lt;/p&gt;

&lt;p&gt;The documentation is currently at &lt;a href=&quot;http://dev.gentoo.org/~ferdy/paludis-jni/&quot;&gt;http://dev.gentoo.org/~ferdy/paludis-jni/&lt;/a&gt; . All of that has been accomplished in:&lt;/p&gt;

&lt;pre&gt;[ $ ~/git/paludis/jni(jni) ] git diff --shortstat trunk..
 65 files changed, 4371 insertions(+), 0 deletions(-)&lt;/pre&gt;

&lt;p&gt;Which is not a lot of code for what's exposed.&lt;/p&gt;

&lt;p&gt;&amp;mdash; ferdy&lt;/p&gt;

&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.gentoo.org/ferdy/2007/11/28/paludis_meets_java_part_iii&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>Once we've converted native types we face the task of converting arbitrary classes and types. Another thing we'll need is extract the C++ type of a Java object (<tt>jobject</tt> in JNI).</p>

<p>For that task, we will follow the convention of calling the native pointers in Java classes <tt>_ptr</tt>. With that, we can define the following templates:</p>

<pre>template &lt;typename T_&gt;
inline T_ * get_native_ptr(JNIEnv * env, const char * const class_name, jobject obj)
{
    jclass cls(env-&gt;FindClass(class_name));
    jfieldID ptr_field(env-&gt;GetFieldID(cls, "_ptr", "J"));
    jlong ptr(env-&gt;GetLongField(obj, ptr_field));
    env-&gt;DeleteLocalRef(cls);
    return from_java_ptr&lt;T_&gt;(ptr);
}

template &lt;typename T_&gt;
inline tr1::shared_ptr&lt;T_&gt; get_native_sptr(JNIEnv * env, const char * const class_name, jobject obj)
{
    jclass cls(env-&gt;FindClass(class_name));
    jfieldID ptr_field(env-&gt;GetFieldID(cls, "_ptr", "J"));
    jlong ptr(env-&gt;GetLongField(obj, ptr_field));
    env-&gt;DeleteLocalRef(cls);
    return from_java_ptr_sptr&lt;T_&gt;(ptr);
}</pre>

<p>This should really be doing more error checking, but it is good enough for ilustrating how nice are things when using proper tools (both languages and libraries).</p>

<p>Converting arbitrary types also uses some template magic:</p>

<pre>template &lt;typename T_&gt;
struct NativeToJavaTypeMapper
{
    jobject operator() (JNIEnv *, const T_ &amp;);
};</pre>

<p>Now we need specializations for each type we want to convert, for instance, converting a paludis' <tt>FSEntry</tt> into a <tt>java.io.File</tt> looks like the following:</p>

<pre>template&lt;&gt;
struct NativeToJavaTypeMapper&lt;FSEntry&gt;
{
    jobject operator() (JNIEnv * env, const FSEntry &amp; f)
    {
        jclass cls(env-&gt;FindClass("java/io/File"));
        jmethodID constructor(env-&gt;GetMethodID(cls, "&lt;init&gt;", "(Ljava/lang/String;)V"));
        jobject ret(env-&gt;NewObject(cls, constructor, to_java_string(env, stringify(f))));
        env-&gt;DeleteLocalRef(cls);
        return ret;
    }
};</pre>

<p>Neat and clean.</p>

<p>For containers, a <tt>java.util.LinkedList</tt> would be used for paludis' <tt>Sequence</tt>; and <tt>java.util.TreeSet</tt> for paludis' <tt>Set</tt>:</p>

<pre>template &lt;typename T_, typename It_&gt;
jobject range_to_list(JNIEnv * env, It_ begin, It_ end)
{
    jclass list_class(env-&gt;FindClass("java/util/LinkedList"));
    jmethodID constructor(env-&gt;GetMethodID(list_class, "&lt;init&gt;", "()V"));
    jobject our_list(env-&gt;NewObject(list_class, constructor));
    jmethodID add_method(env-&gt;GetMethodID(list_class, "add", "(Ljava/lang/Object;)Z"));

    for (It_ i(begin) ; i != end ; ++i)
        env-&gt;CallBooleanMethod(our_list, add_method, NativeToJavaTypeMapper&lt;T_&gt;()(env, *i));

    env-&gt;DeleteLocalRef(list_class);

    return our_list;
}

template &lt;typename T_, typename It_&gt;
jobject range_to_set(JNIEnv * env, It_ begin, It_ end)
{
    jclass set_class(env-&gt;FindClass("java/util/TreeSet"));
    jmethodID constructor(env-&gt;GetMethodID(set_class, "&lt;init&gt;", "()V"));
    jobject our_set(env-&gt;NewObject(set_class, constructor));
    jmethodID add_method(env-&gt;GetMethodID(set_class, "add", "(Ljava/lang/Object;)Z"));

    for (It_ i(begin) ; i != end ; ++i)
        env-&gt;CallBooleanMethod(our_set, add_method, NativeToJavaTypeMapper&lt;T_&gt;()(env, *i));

    env-&gt;DeleteLocalRef(set_class);

    return our_set;
}</pre>

<p>And now defining <tt>NativeToJavaTypeMapper</tt> specializations for containers is quite easy:</p>

<pre>template&lt;&gt;
template &lt;typename T_&gt;
struct NativeToJavaTypeMapper&lt;tr1::shared_ptr&lt;const Sequence&lt;T_&gt; &gt; &gt;
{
    jobject operator() (JNIEnv * env, const tr1::shared_ptr&lt;const Sequence&lt;T_&gt; &gt; &amp; s)
    {
        return range_to_list&lt;T_&gt;(env, s-&gt;begin(), s-&gt;end());
    }
};

template&lt;&gt;
template &lt;typename T_&gt;
struct NativeToJavaTypeMapper&lt;tr1::shared_ptr&lt;const Set&lt;T_&gt; &gt; &gt;
{
    jobject operator() (JNIEnv * env, const tr1::shared_ptr&lt;const Set&lt;T_&gt; &gt; &amp; s)
    {
        return range_to_set&lt;T_&gt;(env, s-&gt;begin(), s-&gt;end());
    }
};</pre>

<p>I've spent a fair amount of the time fighting with make and the build system. It looks mostly sane now, though.</p>

<p>Dealing with exceptions has been a bit tricky, however, I think I have a good <i>system</i> to deal with it now, even  though Ciaran tagged it as <i>icky</i> and <i>ugly</i> <tt><img src="http://blogs.gentoo.org/rsc/smilies/icon_smile.gif" alt="&#58;&#41;" class="middle" /></tt>. That'd be the topic of the next part of the series.</p>

<p>The documentation is currently at <a href="http://dev.gentoo.org/~ferdy/paludis-jni/">http://dev.gentoo.org/~ferdy/paludis-jni/</a> . All of that has been accomplished in:</p>

<pre>[ $ ~/git/paludis/jni(jni) ] git diff --shortstat trunk..
 65 files changed, 4371 insertions(+), 0 deletions(-)</pre>

<p>Which is not a lot of code for what's exposed.</p>

<p>&mdash; ferdy</p>

<div class="item_footer"><p><small><a href="http://blogs.gentoo.org/ferdy/2007/11/28/paludis_meets_java_part_iii">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.gentoo.org/ferdy/2007/11/28/paludis_meets_java_part_iii#comments</comments>
		</item>
			</channel>
</rss>
