git: 099c07fc9f4d - main - sysutils/consolekit2: Fix XDG_RUNTIME_DIR setting to match what pam_xdg.so sets

Gleb Popov <[email protected]> Tue, 04 Aug 2026 17:35:40 +0000
Newsgroups gmane.os.freebsd.devel.cvs.ports
Message-ID <[email protected]>
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=099c07fc9f4d1bba63318cb4556626aa6d451659

commit 099c07fc9f4d1bba63318cb4556626aa6d451659
Author:     Gleb Popov <[email protected]>
AuthorDate: 2026-08-04 17:31:23 +0000
Commit:     Gleb Popov <[email protected]>
CommitDate: 2026-08-04 17:35:04 +0000

    sysutils/consolekit2: Fix XDG_RUNTIME_DIR setting to match what pam_xdg.so sets
    
    PR:             276084
---
 sysutils/consolekit2/Makefile                      |  2 +-
 .../consolekit2/files/patch-src_ck-sysdeps-unix.c  | 60 ++++++++++++++++++++++
 2 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/sysutils/consolekit2/Makefile b/sysutils/consolekit2/Makefile
index 9b1cbc7c8c52..ea6160b6456b 100644
--- a/sysutils/consolekit2/Makefile
+++ b/sysutils/consolekit2/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	consolekit
 DISTVERSION=	2.0.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	sysutils gnome
 PKGNAMESUFFIX=	2
 
diff --git a/sysutils/consolekit2/files/patch-src_ck-sysdeps-unix.c b/sysutils/consolekit2/files/patch-src_ck-sysdeps-unix.c
new file mode 100644
index 000000000000..cb73adc97ea9
--- /dev/null
+++ b/sysutils/consolekit2/files/patch-src_ck-sysdeps-unix.c
@@ -0,0 +1,60 @@
+--- src/ck-sysdeps-unix.c.orig	2026-04-17 08:41:44 UTC
++++ src/ck-sysdeps-unix.c
+@@ -390,15 +390,15 @@ static gchar *
+ 
+ /* Call g_free on string when done using it. [transfer: full] */
+ static gchar *
+-get_rundir (guint uid)
++get_rundir (struct passwd *pwent)
+ {
+         const gchar *base;
+ 
+         TRACE ();
+ 
+-        base = RUNDIR "/user";
++        base = RUNDIR "/xdg";
+ 
+-        return g_strdup_printf ("%s/%d", base, uid);
++        return g_strdup_printf ("%s/%s", base, pwent->pw_name);
+ }
+ 
+ static gboolean
+@@ -408,7 +408,7 @@ create_rundir_base (guint uid)
+ 
+         TRACE ();
+ 
+-        base = RUNDIR "/user";
++        base = RUNDIR "/xdg";
+ 
+         /* Create the base directory that we will own. */
+         if (g_mkdir_with_parents (base, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) {
+@@ -477,7 +477,7 @@ ck_generate_runtime_dir_for_user (guint uid)
+                 return NULL;
+         }
+ 
+-        dest = get_rundir (uid);
++        dest = get_rundir (pwent);
+ 
+         /* Ensure any files from the last session are removed */
+         if (g_file_test (dest, G_FILE_TEST_EXISTS) == TRUE) {
+@@ -512,10 +512,19 @@ ck_remove_runtime_dir_for_user (guint uid)
+ ck_remove_runtime_dir_for_user (guint uid)
+ {
+         gchar        *dest;
++        struct passwd *pwent;
+ 
+         TRACE ();
+ 
+-        dest = get_rundir (uid);
++        errno = 0;
++        pwent = getpwuid (uid);
++        if (pwent == NULL) {
++                g_warning ("Unable to lookup UID: %s", g_strerror (errno));
++                errno = 0;
++                return FALSE;
++        }
++
++        dest = get_rundir (pwent);
+ 
+         /* attempt to remove the tmpfs */
+         ck_remove_tmpfs (uid, dest);