<?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>ejohansson.se &#187; computers</title>
	<atom:link href="http://ejohansson.se/categories/computers/feed/" rel="self" type="application/rss+xml" />
	<link>http://ejohansson.se</link>
	<description>Random bits about Linux, programming, computers and occasionally other stuff.</description>
	<lastBuildDate>Sun, 18 Apr 2010 20:23:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>debian/licq.git mirror on&#160;Gitorious</title>
		<link>http://ejohansson.se/archives/2010/04/18/debianlicq-git-mirror-on-gitorious/</link>
		<comments>http://ejohansson.se/archives/2010/04/18/debianlicq-git-mirror-on-gitorious/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 20:23:14 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[licq]]></category>

		<guid isPermaLink="false">http://ejohansson.se/?p=332</guid>
		<description><![CDATA[To get better speed and a backup I&#8217;ve set up a mirror of debian/licq.git on Gitorious.org.
I don&#8217;t really know the best way to do this, but I did it by adding the following line to hooks/post-update:

git push --mirror git@gitorious.org:licq/debian.git

This way the mirror will always be updated when I push to the &#8220;real&#8221; repository.
Get it by [...]]]></description>
			<content:encoded><![CDATA[<p>To get better speed and a backup I&#8217;ve set up a mirror of <a href="http://git.ejohansson.se/?p=debian/licq.git;a=summary">debian/licq.git</a> on <a href="http://gitorious.org/licq/debian">Gitorious.org</a>.</p>
<p>I don&#8217;t really know the best way to do this, but I did it by adding the following line to hooks/post-update:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git push <span style="color: #660033;">--mirror</span> git<span style="color: #000000; font-weight: bold;">@</span>gitorious.org:licq<span style="color: #000000; font-weight: bold;">/</span>debian.git</pre></div></div>

<p>This way the mirror will always be updated when I push to the &#8220;real&#8221; repository.</p>
<p>Get it by running</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> gbp-clone <span style="color: #660033;">--pristine-tar</span> git:<span style="color: #000000; font-weight: bold;">//</span>gitorious.org<span style="color: #000000; font-weight: bold;">/</span>licq<span style="color: #000000; font-weight: bold;">/</span>debian.git</pre></div></div>

<p>or clone it on Gitorious and send me merge requests <img src='http://ejohansson.se/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2010/04/18/debianlicq-git-mirror-on-gitorious/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>/me is the new Debian maintainer for&#160;Licq</title>
		<link>http://ejohansson.se/archives/2010/01/15/me-is-the-new-debian-maintainer-for-licq/</link>
		<comments>http://ejohansson.se/archives/2010/01/15/me-is-the-new-debian-maintainer-for-licq/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 23:01:01 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[licq]]></category>

		<guid isPermaLink="false">http://ejohansson.se/?p=320</guid>
		<description><![CDATA[Update 2010-10-30: Changed the initial setup to use gbp-clone.
I&#8217;m now officially the maintainer of Licq&#8217;s Debian packages. Since I&#8217;m not a real Debian maintainer, I&#8217;m very grateful to Joel Rosdahl who is my sponsor.
Version 1.3.8-1 is coming to a mirror near you as I write this.
The package source is kept in my git repository. To [...]]]></description>
			<content:encoded><![CDATA[<p><b>Update 2010-10-30:</b> Changed the initial setup to use gbp-clone.</p>
<p>I&#8217;m now officially the maintainer of Licq&#8217;s Debian packages. Since I&#8217;m not a real Debian maintainer, I&#8217;m very grateful to <a href="http://joel.rosdahl.net/">Joel Rosdahl</a> who is my sponsor.</p>
<p>Version 1.3.8-1 is coming to a mirror near you as I write this.</p>
<p>The package source is kept in my <a href="http://git.ejohansson.se/">git repository</a>. To build the package from the git repository, install git-buildpackage and pristine-tar then follow the instructions below.</p>
<p>Initial setup:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> gbp-clone <span style="color: #660033;">--pristine-tar</span> git:<span style="color: #000000; font-weight: bold;">//</span>git.ejohansson.se<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span>licq.git</pre></div></div>

<p><strike></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> git clone git:<span style="color: #000000; font-weight: bold;">//</span>git.ejohansson.se<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span>licq.git
licq <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">cd</span> licq
licq <span style="color: #000000; font-weight: bold;">%</span> git checkout <span style="color: #660033;">-b</span> pristine-tar origin<span style="color: #000000; font-weight: bold;">/</span>pristine-tar
licq <span style="color: #000000; font-weight: bold;">%</span> git <span style="color: #c20cb9; font-weight: bold;">co</span> master</pre></div></div>

<p></strike></p>
<p>To build the latest version:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">licq <span style="color: #000000; font-weight: bold;">%</span> git-buildpackage <span style="color: #660033;">--git-export-dir</span>=..<span style="color: #000000; font-weight: bold;">/</span>build-area</pre></div></div>

<p>To build a specific version:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">licq <span style="color: #000000; font-weight: bold;">%</span> git-buildpackage <span style="color: #660033;">--git-export-dir</span>=..<span style="color: #000000; font-weight: bold;">/</span>build-area <span style="color: #660033;">--git-export</span>=debian<span style="color: #000000; font-weight: bold;">/</span>1.3.8-<span style="color: #000000;">1</span></pre></div></div>

<p>The final packages will be available in ../build-area.</p>
<p>Later on when you wish to update:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">licq <span style="color: #000000; font-weight: bold;">%</span> git pull
licq <span style="color: #000000; font-weight: bold;">%</span> git-buildpackage ...</pre></div></div>

<p>The next version will have qt4-gui.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2010/01/15/me-is-the-new-debian-maintainer-for-licq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wake on LAN with&#160;Debian</title>
		<link>http://ejohansson.se/archives/2009/12/31/wake-on-lan-with-debian/</link>
		<comments>http://ejohansson.se/archives/2009/12/31/wake-on-lan-with-debian/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 13:45:20 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ejohansson.se/?p=309</guid>
		<description><![CDATA[To enable Wake on LAN on a Asus P5E-V motherboard under Debian you can do the following. Since I have a Asus motherboard, that&#8217;s the only one I&#8217;ve tested, but except from the BIOS (which may differ a bit), the instructions should be the same for all motherboards/NIC that supports Wake on LAN.
In the BIOS, [...]]]></description>
			<content:encoded><![CDATA[<p>To enable <a href="http://en.wikipedia.org/wiki/Wake-on-LAN">Wake on LAN</a> on a Asus P5E-V motherboard under Debian you can do the following. Since I have a Asus motherboard, that&#8217;s the only one I&#8217;ve tested, but except from the BIOS (which may differ a bit), the instructions should be the same for all motherboards/NIC that supports Wake on LAN.</p>
<p>In the BIOS, enable &#8220;Power on by PCIE device&#8221;.</p>
<p>In Linux, first install ethtool and then check that Wake on LAN is supported by running the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>host$ ethtool eth0
...
        Supports Wake-on: g
        Wake-on: g
...</pre></div></div>

<p>The output should contain a &#8216;g&#8217; to indicate that the device can be woken by sending it a &#8220;magic packet&#8221;.</p>
<p>Enable Wake-on by running:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>host$ ethtool <span style="color: #660033;">-s</span> eth0 wol g</pre></div></div>

<p>Since this command must be run on every boot, add it to /etc/rc.local.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>host$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.local
...
ethtool <span style="color: #660033;">-s</span> eth0 wol g
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

<p>As the last step we must make sure that halt doesn&#8217;t disable the network device. This is done by adding this line to /etc/default/halt:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">NETDOWN</span>=no</pre></div></div>

<p>We also need the MAC address to send the magic packet to.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>host$ <span style="color: #c20cb9; font-weight: bold;">ifconfig</span> eth0
eth0      Link encap:Ethernet  HWaddr 00:1e:8c:cf:d0:bb  
...</pre></div></div>

<p>Then shutdown the computer. On an other computer, install e.g. <a href="http://gsd.di.uminho.pt/jpo/software/wakeonlan/">wakeonlan</a> and run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>other$ wakeonlan 00:1e:8c:cf:d0:bb</pre></div></div>

<p>The computer should now start.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2009/12/31/wake-on-lan-with-debian/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>git and svn back&#160;online</title>
		<link>http://ejohansson.se/archives/2009/04/04/git-and-svn-back-online/</link>
		<comments>http://ejohansson.se/archives/2009/04/04/git-and-svn-back-online/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 16:52:56 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[nslu2]]></category>

		<guid isPermaLink="false">http://ejohansson.se/?p=283</guid>
		<description><![CDATA[After a long time offline, git.ejohansson.se and svn.ejohansson.se are finally back online. They are served from my NSLU2 machine (running Debian) so they are not the fastest loading pages out there.
]]></description>
			<content:encoded><![CDATA[<p>After a long time offline, <a href="http://git.ejohansson.se/">git.ejohansson.se</a> and <a href="http://svn.ejohansson.se/">svn.ejohansson.se</a> are finally back online. They are served from my <a href="http://en.wikipedia.org/wiki/NSLU2">NSLU2</a> machine (running Debian) so they are not the fastest loading pages out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2009/04/04/git-and-svn-back-online/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wii and Netgear&#160;WNR834B</title>
		<link>http://ejohansson.se/archives/2008/12/20/wii-and-netgear-wnr834b/</link>
		<comments>http://ejohansson.se/archives/2008/12/20/wii-and-netgear-wnr834b/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 17:44:23 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wii]]></category>

		<guid isPermaLink="false">http://ejohansson.se/?p=276</guid>
		<description><![CDATA[I recently had a lot of problems connecting my Nintendo Wii wireless to my girlfriend&#8217;s Netgear router (WNR834B). The router was configured to use WPA-PSK [TKIP] + WPA2-PSK [AES] with a fairly long pass phrase (ASCII characters). It worked very well with my iBook (Mac OS X) and worked most of the time with my [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a lot of problems connecting my Nintendo Wii wireless to my girlfriend&#8217;s Netgear router (WNR834B). The router was configured to use WPA-PSK [TKIP] + WPA2-PSK [AES] with a fairly long pass phrase (ASCII characters). It worked very well with my iBook (Mac OS X) and worked most of the time with my girlfriend&#8217;s laptop (Windows Vista). But it seemed like Windows used the WPA variant instead of WPA2. It just didn&#8217;t connect when forcing it to use WPA2. And the Wii would only connect if we turned encryption off. Not acceptable!</p>
<p>We tried many things to get the Wii to connect, without any success. In a last attempt we tried changing the pass phrase to a 64 characters long hexadecimal pass phrase. That did the trick. Both the Wii and both laptops now connect without any problem. So if you are having problems connecting your Wii to the wireless network, try changing the pass phrase to consist of hexadecimal characters (0-9, A-F) only. For WPA/WPA2 it must be exactly 64 characters long.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2008/12/20/wii-and-netgear-wnr834b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNS&#160;vulnerability</title>
		<link>http://ejohansson.se/archives/2008/09/09/dns-vulnerability/</link>
		<comments>http://ejohansson.se/archives/2008/09/09/dns-vulnerability/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 18:07:20 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://ejohansson.se/?p=273</guid>
		<description><![CDATA[A very interesting read about the serious vulnerability in DNS discovered by Dan Kaminsky earlier this year: An Illustrated Guide to the Kaminsky DNS Vulnerability. Recommend read if you are interested in security. Should be possible to understand even for people without prior knowledge of DNS.
]]></description>
			<content:encoded><![CDATA[<p>A very interesting read about the serious vulnerability in DNS discovered by Dan Kaminsky earlier this year: <a href="http://www.unixwiz.net/techtips/iguide-kaminsky-dns-vuln.html">An Illustrated Guide to the Kaminsky DNS Vulnerability</a>. Recommend read if you are interested in security. Should be possible to understand even for people without prior knowledge of DNS.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2008/09/09/dns-vulnerability/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debian&#160;packages</title>
		<link>http://ejohansson.se/archives/2008/08/23/debian-packages/</link>
		<comments>http://ejohansson.se/archives/2008/08/23/debian-packages/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 13:55:03 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://ejohansson.se/?p=192</guid>
		<description><![CDATA[My Debian packages are now available at debian.ejohansson.se instead of eddie.ejohansson.se. Please update your /etc/apt/sources.list to point to the new location.
]]></description>
			<content:encoded><![CDATA[<p>My Debian packages are now available at <a href="http://debian.ejohansson.se/">debian.ejohansson.se</a> instead of eddie.ejohansson.se. Please update your /etc/apt/sources.list to point to the new location.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2008/08/23/debian-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web&#160;security</title>
		<link>http://ejohansson.se/archives/2008/06/16/web-security/</link>
		<comments>http://ejohansson.se/archives/2008/06/16/web-security/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 17:13:40 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://ejohansson.se/archives/2008/06/16/web-security/</guid>
		<description><![CDATA[LWN has an interesting article on web security. Linked from that article is another interesting blog entry: Hardened stateless session cookies by the guy that discovered the latest WordPress vulnerabilities.
Back to catching up on LWN issues&#8230;
]]></description>
			<content:encoded><![CDATA[<p>LWN has an <a href="http://lwn.net/Articles/283383/">interesting article</a> on web security. Linked from that article is another interesting blog entry: <a href="http://www.lightbluetouchpaper.org/2008/05/16/hardened-stateless-session-cookies/">Hardened stateless session cookies</a> by the guy that discovered the latest WordPress vulnerabilities.</p>
<p>Back to catching up on LWN issues&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2008/06/16/web-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux and mail() in&#160;PHP</title>
		<link>http://ejohansson.se/archives/2008/02/22/selinux-and-mail-in-php/</link>
		<comments>http://ejohansson.se/archives/2008/02/22/selinux-and-mail-in-php/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 21:37:13 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://ejohansson.se/archives/2008/02/22/selinux-and-mail-in-php/</guid>
		<description><![CDATA[Since I upgraded my server and activated SELinux I haven&#8217;t gotten any emails from wordpress when people post comments on this blog (that&#8217;s why it has taken my so long time to approve comments). Today I decided it was time to look into the problem.
It turned out that the problem was related to the following [...]]]></description>
			<content:encoded><![CDATA[<p>Since I upgraded my server and activated SELinux I haven&#8217;t gotten any emails from wordpress when people post comments on this blog (that&#8217;s why it has taken my so long time to approve comments). Today I decided it was time to look into the problem.</p>
<p>It turned out that the problem was related to the following message that I&#8217;ve been seeing in my log:</p>
<pre>
avc:  denied  { execute_no_trans } for  pid=972 comm="apache2"
name="bash" dev=hda1 ino=26110
scontext=user_u:system_r:httpd_t:s0
tcontext=system_u:object_r:shell_exec_t:s0 tclass=file
</pre>
<p>The mail() function in PHP (which is what wordpress uses to send the notification mail) is implemented using popen(3). When you call mail(), PHP executes popen(&#8220;sendmail &#8230;&#8221;, &#8220;w&#8221;). This ends up with a call to &#8220;sh -c sendmail &#8230;&#8221;, which explains the log message.</p>
<p>The solution was allow execute_no_trans for httpd:</p>
<pre>
allow httpd_t shell_exec_t:file execute_no_trans;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2008/02/22/selinux-and-mail-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SELinux, Subversion and&#160;mod_svn</title>
		<link>http://ejohansson.se/archives/2007/11/04/selinux-subversion-and-mod_svn/</link>
		<comments>http://ejohansson.se/archives/2007/11/04/selinux-subversion-and-mod_svn/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 01:22:48 +0000</pubDate>
		<dc:creator>Erik Johansson</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://ejohansson.se/archives/2007/11/04/selinux-subversion-and-mod_svn/</guid>
		<description><![CDATA[After upgrading my server (from Debian Sarge to Debian Etch) I decided to enabled SELinux. After reading some documentation (besides Debian&#8217;s basic setup documentation I can recommend Fedora&#8217;s SELinux wiki and especially this presentation) I got the basic setup working. Getting Subversion to fully work required a few extra steps. For your convenience and my [...]]]></description>
			<content:encoded><![CDATA[<p>After upgrading my server (from Debian Sarge to Debian Etch) I decided to enabled SELinux. After reading some documentation (besides <a href="http://wiki.debian.org/SELinux">Debian&#8217;s basic setup documentation</a> I can recommend <a href="http://fedoraproject.org/wiki/SELinux">Fedora&#8217;s SELinux wiki</a> and especially <a href="http://people.redhat.com/dwalsh/SELinux/Presentations/ManageRHEL5.pdf">this presentation</a>) I got the basic setup working. Getting Subversion to fully work required a few extra steps. For your convenience and my memory I&#8217;ve listed them below.</p>
<p>1. Turn on httpd_builtin_scripting and httpd_enable_cgi. Turning on httpd_builtin_scripting gives httpd_t (i.e. apache) permission to read and write files marked httpd_sys_script_rw_t. This is needed for commits to work. Turning on httpd_enable_cgi gives httpd_t permission to execute scripts (marked httpd_sys_script_exec_t), something which is needed for hooks to work.</p>
<pre>
# setsebool -P httpd_builtin_scripting=1
# setsebool -P httpd_enable_cgi=1
</pre>
<p>2. Set the proper security context on the files in the repository. Assuming that all repositories are located under /home/svn, the following commands will do the job. Also make sure that the user apache is running as (e.g. www-data) has read access to the repository and write access to the directories dav and db (<a href="http://svn.ejohansson.se/repos/src/misc/bash/svn_perms">this is the script I use for that</a>).</p>
<pre>
# semanage fcontext -a -t httpd_sys_content_t '/home/svn(/.*)?'
# semanage fcontext -a -t httpd_sys_script_rw_t '/home/svn/[^/]+/(dav|db)(/.*)?'
# semanage fcontext -a -t httpd_sys_script_exec_t '/home/svn/[^/]+/hooks(/.*)?'
# restorecon -Rv /home/svn
</pre>
<p>3. Make sure selinux-policy-refpolicy-dev is installed.</p>
<p>4. Create the directory mysvn. In that directory, create the file mysvn.te with the following contents:</p>
<pre>
policy_module(mysvn,0.0.1)

require {
        type httpd_t;
        type shell_exec_t;
        type httpd_sys_script_t;
        type var_run_t;
};

# If hooks are shell scripts, apache must be able to run a shell. The
# hooks will run in httpd_sys_script_t.
allow httpd_t shell_exec_t:file rx_file_perms;

# For some reason the scripts searches /var/run
allow httpd_sys_script_t var_run_t:dir search;
</pre>
<p>5. Then run:</p>
<pre>
# make -f /usr/share/selinux/refpolicy-targeted/include/Makefile
# semodule -i mysvn.pp
</pre>
<p>The mysvn policy module is needed because hooks are normally shell scripts. For apache to be able to run them it must be able to run a shell. Once the scripts have started, they run in the httpd_sys_script_t domain.</p>
]]></content:encoded>
			<wfw:commentRss>http://ejohansson.se/archives/2007/11/04/selinux-subversion-and-mod_svn/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
