Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 634478 - gnome-base/gvfs-1.30.4 admin backend broken by app-shells/dash-0.5.9.1-r3
Summary: gnome-base/gvfs-1.30.4 admin backend broken by app-shells/dash-0.5.9.1-r3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2017-10-16 19:22 UTC by Chris Mayo
Modified: 2019-03-06 19:39 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge info while testing bash as /bin/sh (emerge-info,1.89 KB, text/plain)
2017-10-16 19:22 UTC, Chris Mayo
Details
gvfs patch to prevent shell optimisation (gvfs-admin-no-opt.patch,568 bytes, patch)
2017-10-19 09:56 UTC, Chris Mayo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Mayo 2017-10-16 19:22:59 UTC
Created attachment 498900 [details]
emerge info while testing bash as /bin/sh

dash as /bin/sh

Test with:
$ gedit admin:///etc/hosts

Outcome:
gedit hangs and follwing message in syslog:
org.gtk.vfs.Daemon[nnn]: Refusing to render service to dead parents.

Works fine with app-shells/dash-0.5.8.2

Guessing it might be something to do with /usr/share/gvfs/mounts/admin.mount:
[Mount]
Type=admin
# Add a dummy argument after pkexec, or '/bin/sh -c' will eat the first argument in '$@'
Exec=/bin/sh -c 'pkexec /usr/libexec/gvfsd-admin "$@" --address $DBUS_SESSION_BUS_ADDRESS' gvfsd-admin
AutoMount=true


But editing Exec line to use /bin/bash or changing system /bin/sh to bash doesn't work.

Works with dash as /bin/sh and running in a terminal:
$ /bin/sh -c 'pkexec /usr/libexec/gvfsd-admin "$@" --address $DBUS_SESSION_BUS_ADDRESS'

Problem also exists with gnome-base/gvfs-1.32.1 and out of tree gnome-base/gvfs-1.34.1.
Comment 1 Chris Mayo 2017-10-17 17:10:17 UTC
Fixed by this Debian patch, Disable sh -c "command" -> sh -c "exec command"
 optimization:
https://sources.debian.net/src/dash/0.5.8-2.5/debian/diff/0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff/

Was being applied in app-shells/dash-0.5.8.2, applies cleanly to app-shells/dash-0.5.9.1-r3.
Comment 2 Chris Mayo 2017-10-19 09:56:40 UTC
Created attachment 499274 [details, diff]
gvfs patch to prevent shell optimisation

Alternatively fixed for me by patching gvfs /usr/share/gvfs/mounts/admin.mount adding  exit $? to the end of the script as suggested here:
http://austingroupbugs.net/view.php?id=236

bug 631572 comment 0 suggests other programs are relying on the shell optimisation?
Comment 3 Pacho Ramos gentoo-dev 2019-01-05 13:12:02 UTC
Was this patch upstreamed? Thanks
Comment 4 Chris Mayo 2019-01-06 20:02:46 UTC
No. I wasn't sure which upstream!

Is the problem with DASH, Debian are still carrying the patch:

https://sources.debian.org/patches/dash/0.5.10.2-4/0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff/

or is DASH correct and the others including gvfs doing it wrong?
Comment 5 Chris Mayo 2019-03-06 19:39:38 UTC
Working for me OK now with:

gnome-base/gvfs-1.38.1
app-shells/dash-0.5.9.1-r3

both without patches.

Not sure what fixed it.