]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsipc: report shared memory creator GID correctly
authordongshengyuan <545258830@qq.com>
Fri, 17 Jul 2026 10:20:18 +0000 (18:20 +0800)
committerdongshengyuan <545258830@qq.com>
Fri, 17 Jul 2026 10:20:18 +0000 (18:20 +0800)
Change:
  Use shm_perm.cgid for the shared memory CGID column.
  Keep CGID consistent with CGROUP and other IPC types.

Before:
  lsipc --shmems --creator printed CUID as CGID.
  The error was visible when creator UID and GID differed.

Follow:
  d8461c4e4d8046fb8bd1da8c57383854159d48d1

sys-utils/lsipc.c

index a555edf7caf6c63938b59128b9c6c9fcda478541..7862b33982736e95a797154ea4d0f33482ecc3d0 100644 (file)
@@ -1200,7 +1200,7 @@ static void do_shm(int id, struct lsipc_control *ctl, struct libscols_table *tb)
                                        rc = scols_line_refer_data(ln, n, arg);
                                break;
                        case COL_CGID:
-                               rc = scols_line_sprintf(ln, n, "%u", p->shm_perm.cuid);
+                               rc = scols_line_sprintf(ln, n, "%u", p->shm_perm.cgid);
                                break;
                        case COL_CGROUP:
                                arg = get_groupname(&gr, p->shm_perm.cgid);