#781174 thunar: unable to mount password protected shares (jessie)

Package:
thunar
Source:
thunar
Description:
File Manager for Xfce
Submitter:
Janis Hamme
Date:
2015-03-25 16:54:07 UTC
Severity:
normal
#781174#5
Date:
2015-03-25 16:52:13 UTC
From:
To:
Dear Maintainer,

I have some password protected shares in my /etc/fstab that are mounted
by unprivileged users, e. g.

When mounting the share with the 'mount' command a password is prompted
as intended. However, mounting the share with thunar fails: On the first
access thunar tries to mount the share and a graphical password prompt
*should* appear. Instead an error message is shown:

After some investigation I found out that the ask-password functionality
from systemd is used. Therefore a file has to be created in
/run/systemd/ask-password and password agents watching the directory
might prompt for the password. See [1] for reference.

Creating the password file fails, as /run/systemd/ask-password is only
writable by root. As this functionality is intended to be used for
system-level passwords only, I guess it shouldn't be world writable.

To mount the volume, thunar seems to rely on libglib2 (Thunar calls
g_volume_mount). See [2], [3] for the source code. I don't really
understand how that code works and why systemd ask-password is used - I
didn't manage to find the corresponding code.

Im not sure if this bug can be fixed in thunar or if either systemd or
glib2 are to blame, but I hope you can help to track down the root
cause. Probably systemd shouldn't be used at all for mounting shares in
thunar.

To reproduce this bug you don't need an actual share - you can add a
fake entry to your fstab.

Janis

[1] http://www.freedesktop.org/wiki/Software/systemd/PasswordAgents/
[2]
http://git.xfce.org/xfce/thunar/tree/thunar/thunar-device.c?h=thunar-1.6.3
[3] https://git.gnome.org/browse/glib/tree/gio/gvolume.c?h=glib-2-42