From bf01750381726db3052d94514eec4048c90a616a Mon Sep 17 00:00:00 2001
From: Nick Porter <nick@portercomputing.co.uk>
Date: Thu, 2 May 2024 08:48:14 +0100
Subject: [PATCH 1/1] ITS#10211 slapd: Fix peercred uid and gid format

uid and gid are unsigned int and so should be formatted as such when
creating the authid string.

Reference:https://git.openldap.org/openldap/openldap/-/commit/bf01750381726db3052d94514eec4048c90a616a
Conflict:NA

---
 servers/slapd/daemon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c
index 26e7e67619..8c2dd83efd 100644
--- a/servers/slapd/daemon.c
+++ b/servers/slapd/daemon.c
@@ -2270,9 +2270,9 @@ slap_listener(
 					STRLENOF( "gidNumber=4294967295+uidNumber=4294967295,"
 					"cn=peercred,cn=external,cn=auth" ) + 1 );
 				authid.bv_len = sprintf( authid.bv_val,
-					"gidNumber=%d+uidNumber=%d,"
+					"gidNumber=%u+uidNumber=%u,"
 					"cn=peercred,cn=external,cn=auth",
-					(int) gid, (int) uid );
+					gid, uid );
 				assert( authid.bv_len <=
 					STRLENOF( "gidNumber=4294967295+uidNumber=4294967295,"
 					"cn=peercred,cn=external,cn=auth" ) );
-- 
2.33.0

