<p><b>@kugel-</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/2222#discussion_r305113299">src/socket.c</a>:</p>
<pre style='color:#555'>> @@ -439,20 +441,35 @@ static gint socket_fd_open_unix(const gchar *path)
                return -1;
        }
 
-       /* fix for #1888561:
-        * in case the configuration directory is located on a network file system or any other
-        * file system which doesn't support sockets, we just link the socket there and create the
-        * real socket in the system's tmp directory assuming it supports sockets */
-       real_path = g_strdup_printf("%s%cgeany_socket.%08x",
-               g_get_tmp_dir(), G_DIR_SEPARATOR, g_random_int());
+       /* Try to place the socket in XDG_RUNTIME_DIR, according to XDG Base
+        * Directory Specification, see
+        * https://specifications.freedesktop.org/basedir-spec/latest */
+       real_dir = g_build_filename(g_get_user_runtime_dir(), "geany", NULL);
+       if (g_mkdir_with_parents(real_dir, 0755) == 0)
</pre>
<p>I use <code>_with_parents()</code> in case the geany directory already exists. I could also use mkdir() and handle EEXIST but this seemed more convenient.</p>
<p>For the runtime directory, I assume it already exists, since it's provided by the spec. If that's not the case I think we cuoldn't create it since users generally don't have sufficient permissions for /var/run/user.</p>
<p>I also considered that the 0700 requirement applies to the $XDG_RUNTIME_DIR itself. A quick survey on my system shows that the subdirectories are inconsistent, but the systemd subdirectory (and systemd manages $XDG_RUNTIME_DIR) has 0755. I guess it doesn't matter much. Can change to 0700 if you want.</p>
<pre><code>srw-rw-rw- 1 kugel kugel   0 16. Jul 06:57 bus
drwx------ 2 kugel kugel  60 17. Jul 16:14 dconf
drwxr-xr-x 2 kugel kugel  40 18. Jul 07:13 geany
drwx------ 2 kugel kugel 140 16. Jul 06:57 gnupg
srw------- 1 kugel kugel   0 16. Jul 06:57 kdeinit5__0
srwxr-xr-x 1 kugel kugel   0 16. Jul 06:57 klauncherdKXvtl.1.slave-socket
-rw-r--r-- 1 kugel kugel  74 16. Jul 06:57 KSMserver__0
srwxr-xr-x 1 kugel kugel   0 16. Jul 06:57 kwallet5.socket
drwxr-xr-x 2 kugel kugel  60 16. Jul 06:57 Nextcloud
drwxr-xr-x 2 kugel kugel  60 16. Jul 06:57 p11-kit
srw-rw-rw- 1 kugel kugel   0 16. Jul 06:57 pipewire-0
drwx------ 2 kugel kugel 100 16. Jul 06:57 pulse
drwxr-xr-x 3 kugel kugel 100 16. Jul 06:57 systemd
drwx------ 2 kugel kugel  40 18. Jul 21:56 xpra
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2222?email_source=notifications&email_token=AAIOWJ6VP2KCOC35PSKJXODQADK23A5CNFSM4IE3PHAKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB65OBZA#discussion_r305113299">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ6TIMTO3O5SZ4BEBGDQADK23ANCNFSM4IE3PHAA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAIOWJYS42FPYWBZMNKAIKDQADK23A5CNFSM4IE3PHAKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB65OBZA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2222?email_source=notifications\u0026email_token=AAIOWJ6VP2KCOC35PSKJXODQADK23A5CNFSM4IE3PHAKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB65OBZA#discussion_r305113299",
"url": "https://github.com/geany/geany/pull/2222?email_source=notifications\u0026email_token=AAIOWJ6VP2KCOC35PSKJXODQADK23A5CNFSM4IE3PHAKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB65OBZA#discussion_r305113299",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>