[fink:package-submissions] #4970 xvfb-run fix for not needing previously run X11

Daniel Macks via Fink-tracker <[email protected]> Wed, 18 Jul 2018 19:03:00 -0000
Newsgroups gmane.os.apple.fink.tracker
Message-ID </p/fink/package-submissions/4970/5eda918f0ce4106e734515afc0e83947b80525b9.package-submissions@fink.p.sourceforge.net>
This is a multi-part message in MIME format.
--===============0998828832676178506==
Content-Type: multipart/related;
 boundary="===============1345113814902592591=="

This is a multi-part message in MIME format.
--===============1345113814902592591==
Content-Type: multipart/alternative;
 boundary="===============2832076881581768583=="
MIME-Version: 1.0

--===============2832076881581768583==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

- **status**: open --> closed-fixed
- **Group**: Undergoing_Validation -->  Supplanted
- **Comment**:

Fixed in 792e352d8c508b5819db3aa183cc63dba68dde20 using a suid wrapper written in C that runs xquartz's privileged_startx program (which runs its .d scriptlets). This all needs to happen at runtime, since the directories get nuked on reboot, not at PostInst.



---

** [package-submissions:#4970] xvfb-run fix for not needing previously run X11**

**Status:** closed-fixed
**Group:**  Supplanted
**Labels:** x11 Updated Revision of Existing 
**Created:** Fri Aug 18, 2017 03:17 AM UTC by Hanspeter Niederstrasser
**Last Updated:** Sun Jan 28, 2018 07:08 PM UTC
**Owner:** Daniel Macks
**Attachments:**

- [xvfb-run.info](https://sourceforge.net/p/fink/package-submissions/4970/attachment/xvfb-run.info) (1.4 kB; application/octet-stream)


If you reboot, xvfb-run fails unless X11 has been run once (you can even quit X11 and xvfb-run will still work afterwards; it just needs that initial run). This run sets up /tmp/.X11-unix, where X stores its sockets.

Without the first run, xvfb-run fails with this error:
````
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
````
If I manually create /tmp/.X11-unix, the error changes to:
````
_XSERVTransmkdir: ERROR: Mode of /tmp/.X11-unix must be set to 1777
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 1
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
````
If I chmod /tmp/.X11-unix, then xvfb-run runs successfully.

This is the change to xvfb-run:
~~~~
--- xvfb-run.info	10 Sep 2015 21:02:21 -0000	1.1
+++ xvfb-run.info	18 Aug 2017 03:07:26 -0000
@@ -1,11 +1,11 @@
 Package: xvfb-run
 Version: 1.4.2
-Revision: 3
+Revision: 4
 Source: http://patch-tracker.debian.org/patch/debianonly/dl/xorg-server/2:%v-10.lenny4/debian-dir%%20only%%20changes
 SourceRename: xorg-server_%v-10.lenny4.debian-only-changes.diff
 Source-MD5: 6e67c13a732a29318330f9e605c6e2a8
 NoSourceDirectory: true
 Depends: <<
 	getoptbin,
 	x11
 <<
@@ -17,16 +17,24 @@
 <<
 CompileScript: #
 InstallScript: <<
 	mkdir -p %i/bin
 	install -m0755 debian/local/xvfb-run %i/bin
 	mkdir -p %i/share/man/man1
 	install -m0644 debian/local/xvfb-run.1 %i/share/man/man1
 <<
+PostInstScript: <<
+# /tmp/.X11-unix stores the sockets for the X11 server.
+# It needs to exist even if we're faking X11
+if [ ! -d /tmp/.X11-unix/ ]; then
+	/bin/mkdir -p /tmp/.X11-unix
+	/bin/chmod 1777 /tmp/.X11-unix
+fi
+<<
 DocFiles: debian/copyright
 DescPort: <<
 	darwin-specific patch from:
 	http://www.hexten.net/wiki/?title=Patch_xvfb-run_for_Mac_OS_X
 <<
 DescPackaging: <<
 	Script is apparently a debian add-on (various websites say
 	it's standard part of x.org?)
~~~~


---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/fink/package-submissions/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/fink/admin/package-submissions/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
--===============2832076881581768583==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit

<div class="markdown_content"><ul>
<li><strong>status</strong>: open --&gt; closed-fixed</li>
<li><strong>Group</strong>: Undergoing_Validation --&gt;  Supplanted</li>
<li><strong>Comment</strong>:</li>
</ul>
<p>Fixed in 792e352d8c508b5819db3aa183cc63dba68dde20 using a suid wrapper written in C that runs xquartz's privileged_startx program (which runs its .d scriptlets). This all needs to happen at runtime, since the directories get nuked on reboot, not at PostInst.</p>
<hr/>
<p><strong> <a class="alink strikethrough" href="https://sourceforge.net/p/fink/package-submissions/4970/">[package-submissions:#4970]</a> xvfb-run fix for not needing previously run X11</strong></p>
<p><strong>Status:</strong> closed-fixed<br/>
<strong>Group:</strong>  Supplanted<br/>
<strong>Labels:</strong> x11 Updated Revision of Existing <br/>
<strong>Created:</strong> Fri Aug 18, 2017 03:17 AM UTC by Hanspeter Niederstrasser<br/>
<strong>Last Updated:</strong> Sun Jan 28, 2018 07:08 PM UTC<br/>
<strong>Owner:</strong> Daniel Macks<br/>
<strong>Attachments:</strong></p>
<ul>
<li><a class="" href="https://sourceforge.net/p/fink/package-submissions/4970/attachment/xvfb-run.info">xvfb-run.info</a> (1.4 kB; application/octet-stream)</li>
</ul>
<p>If you reboot, xvfb-run fails unless X11 has been run once (you can even quit X11 and xvfb-run will still work afterwards; it just needs that initial run). This run sets up /tmp/.X11-unix, where X stores its sockets.</p>
<p>Without the first run, xvfb-run fails with this error:</p>
<div class="codehilite"><pre><span></span><span class="n">_XSERVTransmkdir</span><span class="o">:</span> <span class="n">ERROR</span><span class="o">:</span> <span class="n">euid</span> <span class="o">!=</span> <span class="mi">0</span><span class="o">,</span><span class="n">directory</span> <span class="sr">/tmp/</span><span class="o">.</span><span class="na">X11</span><span class="o">-</span><span class="n">unix</span> <span class="n">will</span> <span class="n">not</span> <span class="n">be</span> <span class="n">created</span><span class="o">.</span>
<span class="n">_XSERVTransSocketUNIXCreateListener</span><span class="o">:</span> <span class="n">mkdir</span><span class="o">(/</span><span class="n">tmp</span><span class="o">/.</span><span class="n">X11</span><span class="o">-</span><span class="n">unix</span><span class="o">)</span> <span class="n">failed</span><span class="o">,</span> <span class="n">errno</span> <span class="o">=</span> <span class="mi">2</span>
<span class="n">_XSERVTransMakeAllCOTSServerListeners</span><span class="o">:</span> <span class="n">failed</span> <span class="n">to</span> <span class="n">create</span> <span class="n">listener</span> <span class="k">for</span> <span class="n">local</span>
</pre></div>


<p>If I manually create /tmp/.X11-unix, the error changes to:</p>
<div class="codehilite"><pre><span></span><span class="n">_XSERVTransmkdir</span><span class="o">:</span> <span class="n">ERROR</span><span class="o">:</span> <span class="n">Mode</span> <span class="n">of</span> <span class="sr">/tmp/</span><span class="o">.</span><span class="na">X11</span><span class="o">-</span><span class="n">unix</span> <span class="n">must</span> <span class="n">be</span> <span class="kd">set</span> <span class="n">to</span> <span class="mi">1777</span>
<span class="n">_XSERVTransSocketUNIXCreateListener</span><span class="o">:</span> <span class="n">mkdir</span><span class="o">(/</span><span class="n">tmp</span><span class="o">/.</span><span class="n">X11</span><span class="o">-</span><span class="n">unix</span><span class="o">)</span> <span class="n">failed</span><span class="o">,</span> <span class="n">errno</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">_XSERVTransMakeAllCOTSServerListeners</span><span class="o">:</span> <span class="n">failed</span> <span class="n">to</span> <span class="n">create</span> <span class="n">listener</span> <span class="k">for</span> <span class="n">local</span>
</pre></div>


<p>If I chmod /tmp/.X11-unix, then xvfb-run runs successfully.</p>
<p>This is the change to xvfb-run:</p>
<div class="codehilite"><pre><span></span><span class="gd">--- xvfb-run.info   10 Sep 2015 21:02:21 -0000  1.1</span>
<span class="gi">+++ xvfb-run.info   18 Aug 2017 03:07:26 -0000</span>
<span class="gu">@@ -1,11 +1,11 @@</span>
 Package: xvfb-run
 Version: 1.4.2
<span class="gd">-Revision: 3</span>
<span class="gi">+Revision: 4</span>
 Source: http://patch-tracker.debian.org/patch/debianonly/dl/xorg-server/2:%v-10.lenny4/debian-dir%%20only%%20changes
 SourceRename: xorg-server_%v-10.lenny4.debian-only-changes.diff
 Source-MD5: 6e67c13a732a29318330f9e605c6e2a8
 NoSourceDirectory: true
 Depends: &lt;&lt;
    getoptbin,
    x11
 &lt;&lt;
<span class="gu">@@ -17,16 +17,24 @@</span>
 &lt;&lt;
 CompileScript: #
 InstallScript: &lt;&lt;
    mkdir -p %i/bin
    install -m0755 debian/local/xvfb-run %i/bin
    mkdir -p %i/share/man/man1
    install -m0644 debian/local/xvfb-run.1 %i/share/man/man1
 &lt;&lt;
<span class="gi">+PostInstScript: &lt;&lt;</span>
<span class="gi">+# /tmp/.X11-unix stores the sockets for the X11 server.</span>
<span class="gi">+# It needs to exist even if we're faking X11</span>
<span class="gi">+if [ ! -d /tmp/.X11-unix/ ]; then</span>
<span class="gi">+   /bin/mkdir -p /tmp/.X11-unix</span>
<span class="gi">+   /bin/chmod 1777 /tmp/.X11-unix</span>
<span class="gi">+fi</span>
<span class="gi">+&lt;&lt;</span>
 DocFiles: debian/copyright
 DescPort: &lt;&lt;
    darwin-specific patch from:
    http://www.hexten.net/wiki/?title=Patch_xvfb-run_for_Mac_OS_X
 &lt;&lt;
 DescPackaging: &lt;&lt;
    Script is apparently a debian add-on (various websites say
    it's standard part of x.org?)
</pre></div>


<hr/>
<p>Sent from sourceforge.net because [email protected] is subscribed to <a href="https://sourceforge.net/p/fink/package-submissions/">https://sourceforge.net/p/fink/package-submissions/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/fink/admin/package-submissions/options.">https://sourceforge.net/p/fink/admin/package-submissions/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>
--===============2832076881581768583==--
--===============1345113814902592591==--


--===============0998828832676178506==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--===============0998828832676178506==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Fink-tracker mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.tracker
--===============0998828832676178506==--