<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nethackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Setgid</id>
	<title>Setgid - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nethackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Setgid"/>
	<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Setgid&amp;action=history"/>
	<updated>2026-07-21T15:40:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.5</generator>
	<entry>
		<id>https://nethackwiki.com/index.php?title=Setgid&amp;diff=170986&amp;oldid=prev</id>
		<title>Furey: Delinkify &quot;shell script&quot;. It's commentary in a TODO, so we don't need to make a reference to explain it.</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Setgid&amp;diff=170986&amp;oldid=prev"/>
		<updated>2024-06-18T14:16:17Z</updated>

		<summary type="html">&lt;p&gt;Delinkify &amp;quot;shell script&amp;quot;. It&amp;#039;s commentary in a TODO, so we don&amp;#039;t need to make a reference to explain it.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 14:16, 18 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l11&quot; &gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  drwxrwxr-x  3 root  games  512 Jul 18 15:50 /var/games/hackdir&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  drwxrwxr-x  3 root  games  512 Jul 18 15:50 /var/games/hackdir&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Todo|Perhaps someone should edit the page and provide this info for their NetHack installation. Note that the &amp;lt;tt&amp;gt;nethack&amp;lt;/tt&amp;gt; command is a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/del&gt;shell script&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]] &lt;/del&gt;and that the setgid executable might be in the playground somewhere.}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Todo|Perhaps someone should edit the page and provide this info for their NetHack installation. Note that the &amp;lt;tt&amp;gt;nethack&amp;lt;/tt&amp;gt; command is a shell script and that the setgid executable might be in the playground somewhere.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;quot;s&amp;quot; in &amp;quot;-r-xr-sr-x&amp;quot; indicates that '''setgid''' is set. The group of the setgid executable (here /usr/games/hack) and that of the playground (here /var/games/hackdir) must match.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;quot;s&amp;quot; in &amp;quot;-r-xr-sr-x&amp;quot; indicates that '''setgid''' is set. The group of the setgid executable (here /usr/games/hack) and that of the playground (here /var/games/hackdir) must match.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Furey</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=Setgid&amp;diff=147549&amp;oldid=prev</id>
		<title>Aximili: put suggestion in a todo</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Setgid&amp;diff=147549&amp;oldid=prev"/>
		<updated>2022-08-15T13:48:11Z</updated>

		<summary type="html">&lt;p&gt;put suggestion in a todo&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:48, 15 August 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l11&quot; &gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  drwxrwxr-x  3 root  games  512 Jul 18 15:50 /var/games/hackdir&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  drwxrwxr-x  3 root  games  512 Jul 18 15:50 /var/games/hackdir&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(&lt;/del&gt;Perhaps someone should edit the page and provide this info for their NetHack installation. Note that the &amp;lt;tt&amp;gt;nethack&amp;lt;/tt&amp;gt; command is a [[shell script]] and that the setgid executable might be in the playground somewhere.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{Todo|&lt;/ins&gt;Perhaps someone should edit the page and provide this info for their NetHack installation. Note that the &amp;lt;tt&amp;gt;nethack&amp;lt;/tt&amp;gt; command is a [[shell script]] and that the setgid executable might be in the playground somewhere.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;quot;s&amp;quot; in &amp;quot;-r-xr-sr-x&amp;quot; indicates that '''setgid''' is set. The group of the setgid executable (here /usr/games/hack) and that of the playground (here /var/games/hackdir) must match.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;quot;s&amp;quot; in &amp;quot;-r-xr-sr-x&amp;quot; indicates that '''setgid''' is set. The group of the setgid executable (here /usr/games/hack) and that of the playground (here /var/games/hackdir) must match.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aximili</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=Setgid&amp;diff=147546&amp;oldid=prev</id>
		<title>Phol ende wodan: add noversion template</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Setgid&amp;diff=147546&amp;oldid=prev"/>
		<updated>2022-08-15T13:22:51Z</updated>

		<summary type="html">&lt;p&gt;add noversion template&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:22, 15 August 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l15&quot; &gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;quot;s&amp;quot; in &amp;quot;-r-xr-sr-x&amp;quot; indicates that '''setgid''' is set. The group of the setgid executable (here /usr/games/hack) and that of the playground (here /var/games/hackdir) must match.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;quot;s&amp;quot; in &amp;quot;-r-xr-sr-x&amp;quot; indicates that '''setgid''' is set. The group of the setgid executable (here /usr/games/hack) and that of the playground (here /var/games/hackdir) must match.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{noversion}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Development]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Development]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Phol ende wodan</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=Setgid&amp;diff=87328&amp;oldid=prev</id>
		<title>220.255.1.23 at 12:44, 9 October 2013</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Setgid&amp;diff=87328&amp;oldid=prev"/>
		<updated>2013-10-09T12:44:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 12:44, 9 October 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[NetHack]] needs to be able to write files into a directory called the [[playground]]. This is necessary to save games, to delete saved games when loading them, to save [[persistent level]]s during gameplay, to log games, and to add to the list of high scores. However, on multiuser [[Unix]] systems, users should not have write permision to the playground ''except'' when they play NetHack. Why let users cheat, or worse, corrupt the saves of other users?&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[NetHack]] needs to be able to write files into a directory called the [[playground]]. This is necessary to save games, to delete saved games when loading them, to save [[persistent level]]s during gameplay, to log games, and to add to the list of high scores. However, on multiuser [[Unix]] systems, users should not have write permision to the playground ''except'' when they play NetHack. Why let users cheat, or worse, corrupt the saves of other users?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The solution is to give write access for the playground not to the users, but to a special Unix group such as &amp;lt;tt&amp;gt;games&amp;lt;/tt&amp;gt;. Then [http://www.freebsd.org/cgi/man.cgi?query=chown chown] the executable to user &amp;lt;tt&amp;gt;root&amp;lt;/tt&amp;gt;, group &amp;lt;tt&amp;gt;games&amp;lt;/tt&amp;gt; and set the '''setgid''' bit. When the game starts, the system will ''set'' the effective ''g''roup ''id'' to &amp;lt;tt&amp;gt;games&amp;lt;/tt&amp;gt; and NetHack will have the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;priveleges &lt;/del&gt;necessary to write to the [[playground]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The solution is to give write access for the playground not to the users, but to a special Unix group such as &amp;lt;tt&amp;gt;games&amp;lt;/tt&amp;gt;. Then [http://www.freebsd.org/cgi/man.cgi?query=chown chown] the executable to user &amp;lt;tt&amp;gt;root&amp;lt;/tt&amp;gt;, group &amp;lt;tt&amp;gt;games&amp;lt;/tt&amp;gt; and set the '''setgid''' bit. When the game starts, the system will ''set'' the effective ''g''roup ''id'' to &amp;lt;tt&amp;gt;games&amp;lt;/tt&amp;gt; and NetHack will have the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;privileges &lt;/ins&gt;necessary to write to the [[playground]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This sort of arrangement dates back to [[Hack]], which needed this setup for the same reasons as NetHack does. Here is [[Hack 1.0.3]] upon [[User:Kernigh|Kernigh]]'s [[OpenBSD]] system:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This sort of arrangement dates back to [[Hack]], which needed this setup for the same reasons as NetHack does. Here is [[Hack 1.0.3]] upon [[User:Kernigh|Kernigh]]'s [[OpenBSD]] system:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>220.255.1.23</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=Setgid&amp;diff=9039&amp;oldid=prev</id>
		<title>Kernigh: Brief page discussing setgid on Unix.</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Setgid&amp;diff=9039&amp;oldid=prev"/>
		<updated>2006-08-31T01:11:37Z</updated>

		<summary type="html">&lt;p&gt;Brief page discussing &lt;a href=&quot;/wiki/Setgid&quot; title=&quot;Setgid&quot;&gt;setgid&lt;/a&gt; on &lt;a href=&quot;/wiki/Unix&quot; title=&quot;Unix&quot;&gt;Unix&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{man|setgid|2}}&lt;br /&gt;
[[NetHack]] needs to be able to write files into a directory called the [[playground]]. This is necessary to save games, to delete saved games when loading them, to save [[persistent level]]s during gameplay, to log games, and to add to the list of high scores. However, on multiuser [[Unix]] systems, users should not have write permision to the playground ''except'' when they play NetHack. Why let users cheat, or worse, corrupt the saves of other users?&lt;br /&gt;
&lt;br /&gt;
The solution is to give write access for the playground not to the users, but to a special Unix group such as &amp;lt;tt&amp;gt;games&amp;lt;/tt&amp;gt;. Then [http://www.freebsd.org/cgi/man.cgi?query=chown chown] the executable to user &amp;lt;tt&amp;gt;root&amp;lt;/tt&amp;gt;, group &amp;lt;tt&amp;gt;games&amp;lt;/tt&amp;gt; and set the '''setgid''' bit. When the game starts, the system will ''set'' the effective ''g''roup ''id'' to &amp;lt;tt&amp;gt;games&amp;lt;/tt&amp;gt; and NetHack will have the priveleges necessary to write to the [[playground]].&lt;br /&gt;
&lt;br /&gt;
This sort of arrangement dates back to [[Hack]], which needed this setup for the same reasons as NetHack does. Here is [[Hack 1.0.3]] upon [[User:Kernigh|Kernigh]]'s [[OpenBSD]] system:&lt;br /&gt;
&lt;br /&gt;
 $ ls -l /usr/games/hack&lt;br /&gt;
 -r-xr-sr-x  1 root  games  250568 Mar  1  2006 /usr/games/hack&lt;br /&gt;
 $ ls -ld /var/games/hackdir&lt;br /&gt;
 drwxrwxr-x  3 root  games  512 Jul 18 15:50 /var/games/hackdir&lt;br /&gt;
&lt;br /&gt;
(Perhaps someone should edit the page and provide this info for their NetHack installation. Note that the &amp;lt;tt&amp;gt;nethack&amp;lt;/tt&amp;gt; command is a [[shell script]] and that the setgid executable might be in the playground somewhere.)&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;s&amp;quot; in &amp;quot;-r-xr-sr-x&amp;quot; indicates that '''setgid''' is set. The group of the setgid executable (here /usr/games/hack) and that of the playground (here /var/games/hackdir) must match.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Kernigh</name></author>
		
	</entry>
</feed>