Use SNAP_COMMON for domain socket, too (Issue Issue
@@ -461,6 +461,9 @@ _papplMainloopGetServerPath(
char *buffer, // I - Buffer for filename
size_t bufsize) // I - Size of buffer
{
+ const char *snap_common; // SNAP_COMMON environment variable
+
+
if (uid)
{
// Per-user server...
@@ -477,6 +480,11 @@ _papplMainloopGetServerPath(
snprintf(buffer, bufsize, "%s/%s%d.sock", tmpdir, base_name, (int)uid);
}
+ else if ((snap_common = getenv("SNAP_COMMON")) != NULL)
+ {
+ // System server running as root inside a snap (https://snapcraft.io)...
+ snprintf(buffer, bufsize, "%s/%s.sock", snap_common, base_name);
+ }
else
{
// System server running as root
