[Users] Revisiting the socket_dir $TMPDIR issue

Ricardo Mones ricardo at mones.org
Thu Nov 6 09:44:15 CET 2014


On Thu, Nov 06, 2014 at 09:18:05AM +0100, Colin Leroy wrote:
> On Tue, 4 Nov 2014 19:35:39 +0100, Michael Schwendt
> <bugreporter at abwesend.de> wrote:
> 
> Hi Michael,
> 
> >  		socket_dir = g_strdup_printf("%s%cclaws-mail-%d",
> > -					   g_get_tmp_dir(),
> > G_DIR_SEPARATOR,
> > +					   g_get_user_runtime_dir(),
> > G_DIR_SEPARATOR, #if HAVE_GETUID
> 
> > Unforunately, the opposite case, setting $XDG_RUNTIME_DIR to something
> > else, doesn't work with gnome-terminal's mailto handler either. The
> > env var also get's deleted. It's just the default that somehow works.
>  
> So unfortunately, not a very good fix? 
> 
> I'm not very enthusiastic about changing this, because when the change
> will arrive on users' desktops, the new binary could be launched along
> the old one if it was running during the upgrade, and things could get
> real messy...
> 
> So probably such a patch should check for a socket in the old place, and
> if it doesn't exist use one in the new place.

Don't forget to bump glib's version check in configure.ac; that function
is only available since 2.28¹.

Anyway that function introduces a disparity of locations of the socket.
See attached program's output:

$ ./runtimedir # debian wheezy box
$XDG_RUNTIME_DIR         : (null)
$XDG_CACHE_HOME          : (null)
g_get_tmp_dir()          : /tmp
g_get_user_runtime_dir() : /home/mones/.cache

$ ./runtimedir # debian sid box
$XDG_RUNTIME_DIR         : /run/user/1000
$XDG_CACHE_HOME          : (null)
g_get_tmp_dir()          : /tmp
g_get_user_runtime_dir() : /run/user/1000

So I'd like also to see a patch for Clawsker to cope with this ;)

¹ https://developer.gnome.org/glib/2.30/glib-Miscellaneous-Utility-Functions.html#g-get-user-runtime-dir
-- 
  Ricardo Mones 
  ~
  Don't take the name of root in vain.          /usr/src/linux/README

-------------- next part --------------
A non-text attachment was scrubbed...
Name: runtimedir.c
Type: text/x-csrc
Size: 478 bytes
Desc: not available
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20141106/1dffa7ff/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20141106/1dffa7ff/attachment.sig>


More information about the Users mailing list