xpra icon
Bug tracker and wiki

Opened 7 months ago

Closed 5 months ago

#1394 closed defect (needinfo)

XDG_RUNTIME_DIR should not contain executable scripts

Reported by: Todd Vierling Owned by: Todd Vierling
Priority: minor Milestone:
Component: android Version: 1.0.x
Keywords: Cc:

Description (last modified by Antoine Martin)

In short, getting this:

sh: 1: /run/user/1000/xpra/run-xpra: Permission denied

on Ubuntu 12.04, where /run is mounted by default as:

tmpfs on /run type tmpfs (rw,'''noexec''',nosuid,size=10%,mode=0755)

I can of course modify this in fstab, but filing ticket as this is the default on Ubuntu. Either run-xpra should remain in $HOME, or some test should be done to check whether $XDG_RUNTIME_DIR is mounted noexec.

Attachments (1)

xdg-runtime-dir-ubuntu1404.patch (806 bytes) - added by Antoine Martin 7 months ago.
don't use XDG_RUNTIME_DIR for run-xpra script on Ubuntu 14.04

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 months ago by Todd Vierling

(Note that /run is mounted in the initramfs, so a hack in fstab to change this actually requires an entry containing "remount" in its options, since /run is not listed in fstab normally at all.)

comment:2 Changed 7 months ago by Todd Vierling

Summary: XDG_RIUNTIME_DIR should not contain executable scriptsXDG_RUNTIME_DIR should not contain executable scripts

comment:3 Changed 7 months ago by Antoine Martin

Description: modified (diff)
Owner: changed from Antoine Martin to Todd Vierling

Original feature ticket: #1129

I've re-tested 1.0 on all those distributions to verify:

  • Debian wheezy, Ubuntu 12.04, centos 5.x / 6.x: n/a, the directory [/var]/run/user does not exist
  • centos 7.x: OK
  • Ubuntu 16.04 / 16.10: OK
  • Debian Jessie / Stretch: OK
  • Fedora 24 / 25: OK
  • Ubuntu 14.04: exists but mounted noexec

So the only problem that I can see is with 14.04, not 12.04, and it isn't a huge problem since we try to execute ~/.xpra/run-xpra first.
What is the problem you're seeing?

comment:4 Changed 7 months ago by Todd Vierling

Sorry, it was a typo; I am in fact on 14.04 (trusty).

The problem is occurring when there is neither a ~/.xpra or $XDG_RUNTIME_DIR/xpra directory yet existing on the destination host. The autogenerated run-xpra script gets created in $XDG_RUNTIME_DIR in this case.

Looks like changing 'bind' from 'auto' to '~/.xpra/' makes the script appear in ~/.xpra as with previous versions. I suppose the least overhead solution to this issue would be a documentation note, or comment in the shipped 50_server_network.conf, that Ubuntu 14.04 systems should use that setting.

Changed 7 months ago by Antoine Martin

don't use XDG_RUNTIME_DIR for run-xpra script on Ubuntu 14.04

comment:5 Changed 7 months ago by Antoine Martin

Version: trunk1.0.x

Forgive me if I am being thick but I still fail to reproduce any kind of showstopper problem on 14.04:

rm -fr ~/.xpra ${XDG_RUNTIME_DIR}/xpra

Resets things for testing, then I can use any xpra command I like and when the "run-xpra" scripts get created (xpra start, xpra shadow, etc), they are created in both locations.

If I use a command that relies on those scripts (ie: xpra start ssh:HOST --start=xterm), then it finds the one in "~/.xpra" first and the command runs without problems.
What exact commands are you using to get a failure?

Does the patch attached above fix things?

comment:6 Changed 5 months ago by Antoine Martin

Resolution: needinfo
Status: newclosed

Not heard back, closing.

Note: See TracTickets for help on using tickets.